Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/web-ui/src/flow_chat/components/WelcomePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,28 @@ export const WelcomePanel: React.FC<WelcomePanelProps> = ({
if (!gitState) return null;
const parts: { key: string; label: string; suffix: string }[] = [];
if (gitState.unstagedFiles > 0)
parts.push({ key: 'unstaged', label: `${gitState.unstagedFiles} 个文件`, suffix: '等待暂存' });
parts.push({ key: 'unstaged', label: t('welcome.gitUnstaged', { count: gitState.unstagedFiles }), suffix: t('welcome.waitingToStage') });
if (gitState.stagedFiles > 0)
parts.push({ key: 'staged', label: `${gitState.stagedFiles} 个文件`, suffix: '已暂存待提交' });
parts.push({ key: 'staged', label: t('welcome.gitStaged', { count: gitState.stagedFiles }), suffix: t('welcome.stagedReady') });
if (gitState.unpushedCommits > 0)
parts.push({ key: 'unpushed', label: `${gitState.unpushedCommits} 个提交`, suffix: '待推送' });
parts.push({ key: 'unpushed', label: t('welcome.gitUnpushed', { count: gitState.unpushedCommits }), suffix: t('welcome.toPush') });
if (parts.length === 0) return null;
return (
<>
目前有{' '}
{t('welcome.currentlyHas')}
{parts.map(({ key, label, suffix }, i) => (
<React.Fragment key={key}>
{i > 0 && ','}
{i > 0 && t('welcome.commaSeparator')}
<button type="button" className="welcome-panel__inline-btn" onClick={handleGitClick}>
{label}
</button>
{' '}{suffix}
</React.Fragment>
))}
{t('welcome.period')}
</>
);
}, [gitState, handleGitClick]);
}, [gitState, handleGitClick, t]);

const loadGitState = useCallback(async (workspacePath: string) => {
try {
Expand Down Expand Up @@ -179,20 +179,20 @@ export const WelcomePanel: React.FC<WelcomePanelProps> = ({
<p className="welcome-panel__narrative-text">
{!hasWorkspace ? (
<>
还没有选择项目,
{t('welcome.noWorkspaceHint')}
<button
type="button"
className="welcome-panel__inline-btn"
onClick={() => { void handleOpenOtherFolder(); }}
disabled={isSelectingWorkspace}
>
打开一个
{t('welcome.openOne')}
</button>
{' '}开始吧。
{' '}{t('welcome.toStart')}
</>
) : (
<>
我们正在
{isCoworkSession ? t('welcome.workingInCowork') : t('welcome.workingIn')}{' '}
<span className="welcome-panel__context-row">
<span className="welcome-panel__workspace-anchor" ref={workspaceDropdownRef}>
<button
Expand Down Expand Up @@ -250,15 +250,15 @@ export const WelcomePanel: React.FC<WelcomePanelProps> = ({
</span>
{!isCoworkSession && gitState ? (
<>
工作。
{t('welcome.project')}
<br />
{isGitClean
? <span className="welcome-panel__narrative-clean">一切干净,可以放手大干了 ✦</span>
? <span className="welcome-panel__narrative-clean">{t('welcome.gitClean')}</span>
: buildGitNarrative()
}
</>
) : (
<>项目里工作。</>
<>{t('welcome.projectCowork')}</>
)}
</>
)}
Expand Down
19 changes: 18 additions & 1 deletion src/web-ui/src/locales/en-US/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,24 @@
"defaultAction3Command": "Start a new feature",
"workspace": "Workspace",
"noWorkspace": "No workspace open",
"openOtherProject": "Open other project..."
"openOtherProject": "Open other project...",
"noWorkspaceHint": "No project selected yet",
"openOne": "Open one",
"toStart": "to get started.",
"workingIn": "We are working in",
"workingInCowork": "Working in",
"gitClean": "All clean, ready to get to work ✦",
"gitUnstaged": "{{count}} file(s)",
"gitStaged": "{{count}} file(s)",
"gitUnpushed": "{{count}} commit(s)",
"waitingToStage": "waiting to stage",
"stagedReady": "staged and ready to commit",
"toPush": "to push",
"currentlyHas": "Currently there ",
"commaSeparator": ", ",
"period": ".",
"project": "working.",
"projectCowork": "working in the project."
},
"modelSelector": {
"model": "Model",
Expand Down
20 changes: 19 additions & 1 deletion src/web-ui/src/locales/zh-CN/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,25 @@
"defaultAction3Command": "开始新功能",
"workspace": "工作区",
"noWorkspace": "未打开工作区",
"openOtherProject": "打开其他项目..."
"openOtherProject": "打开其他项目...",
"noWorkspaceHint": "还没有选择项目",
"openOne": "打开一个",
"toStart": "开始吧。",
"workingIn": "我们正在",
"project": "项目里工作。",
"workingInCowork": "在",
"gitClean": "一切干净,可以放手大干了 ✦",
"gitUnstaged": "{{count}} 个文件",
"gitStaged": "{{count}} 个文件",
"gitUnpushed": "{{count}} 个提交",
"waitingToStage": "等待暂存",
"stagedReady": "已暂存待提交",
"toPush": "待推送",
"currentlyHas": "目前有",
"commaSeparator": ",",
"period": "。",
"project": "工作。",
"projectCowork": "项目里工作。"
},
"modelSelector": {
"model": "模型",
Expand Down
Loading