From be5a84ad0bec2bdc839ee74760e71f45af5bddbd Mon Sep 17 00:00:00 2001 From: liyao Date: Thu, 24 Sep 2026 16:49:23 +0800 Subject: [PATCH] fix(workspace): capitalize Untitled and align title fixtures --- .../first-batch.expected.md | 24 +++++++++---------- .../sidebar.expected.md | 10 ++++---- .../workspace-new-session-folding.e2e.ts | 4 ++-- packages/client/ui-workspace/README.i18n.yaml | 4 ++-- packages/client/ui-workspace/README.md | 2 +- packages/client/ui-workspace/README.zh.md | 2 +- .../client/ui-workspace/src/client/locales.ts | 2 +- .../ui-workspace/tests/rows.client.spec.tsx | 2 +- .../tests/workspace-browser.client.spec.tsx | 2 +- .../search-results.expected.md | 2 +- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/web/tests/expected/workspace-new-session-folding/first-batch.expected.md b/apps/web/tests/expected/workspace-new-session-folding/first-batch.expected.md index 6009227833..ec04e12324 100644 --- a/apps/web/tests/expected/workspace-new-session-folding/first-batch.expected.md +++ b/apps/web/tests/expected/workspace-new-session-folding/first-batch.expected.md @@ -1,18 +1,18 @@ - tree "Sessions": - treeitem "{{workspace}}" [expanded] - treeitem "New Session" [selected] - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} Session actions for {{workspace}} Archive session Pin session": - - text: {{workspace}} - - button "Session actions for {{workspace}}" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled Session actions for Untitled Archive session Pin session": + - text: Untitled + - button "Session actions for Untitled" - button "Archive session" - button "Pin session" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" - button "Show 6 more sessions" diff --git a/apps/web/tests/expected/workspace-new-session-folding/sidebar.expected.md b/apps/web/tests/expected/workspace-new-session-folding/sidebar.expected.md index 8778baac12..1aeb3e5a77 100644 --- a/apps/web/tests/expected/workspace-new-session-folding/sidebar.expected.md +++ b/apps/web/tests/expected/workspace-new-session-folding/sidebar.expected.md @@ -4,9 +4,9 @@ - button "Workspace actions for {{workspace}}" - button "New session in {{workspace}}" - treeitem "New Session" [selected] - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" - - treeitem "{{workspace}} 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" + - treeitem "Untitled 1min" - button "Show 11 more sessions" diff --git a/apps/web/tests/workspace-new-session-folding.e2e.ts b/apps/web/tests/workspace-new-session-folding.e2e.ts index e23e0e9a80..9567153471 100644 --- a/apps/web/tests/workspace-new-session-folding.e2e.ts +++ b/apps/web/tests/workspace-new-session-folding.e2e.ts @@ -71,7 +71,7 @@ describe('web e2e: blank New Session folding quota', () => { const sidebar = page.getByRole('tree', { name: 'Sessions' }) await expect.poll(() => sidebar.getByRole('treeitem').count(), { timeout: 15_000 }).toBe(7) expect(await sidebar.getByText('New Session', { exact: true }).count()).toBe(1) - expect(await sidebar.getByText(basename(scaffold.workspaceCwd), { exact: true }).count()).toBe(6) + expect(await sidebar.getByText('Untitled', { exact: true }).count()).toBe(5) const showMore = sidebar.getByRole('button', { name: 'Show 11 more sessions' }) await showMore.waitFor({ timeout: 15_000 }) await compareOrRefreshGolden( @@ -82,7 +82,7 @@ describe('web e2e: blank New Session folding quota', () => { await showMore.click() await expect.poll(() => sidebar.getByRole('treeitem').count(), { timeout: 10_000 }).toBe(12) - expect(await sidebar.getByText(basename(scaffold.workspaceCwd), { exact: true }).count()).toBe(11) + expect(await sidebar.getByText('Untitled', { exact: true }).count()).toBe(10) await compareOrRefreshGolden( join(EXPECTED_DIR, 'first-batch.expected.md'), await captureStableAria(page, '[role="tree"][aria-label="Sessions"]', scaffold.workspaceCwd), diff --git a/packages/client/ui-workspace/README.i18n.yaml b/packages/client/ui-workspace/README.i18n.yaml index 1bdd9019a6..83686cce32 100644 --- a/packages/client/ui-workspace/README.i18n.yaml +++ b/packages/client/ui-workspace/README.i18n.yaml @@ -69,5 +69,5 @@ en: 00d7b1ddda7390f5 zh: 1e5a1055d1be4d1d /deepseek-ai-dsh-client-ui-workspace/known-limitations-and-deferred-work/dev-note: - en: 77d2291f37844028 - zh: b95797542a367620 + en: 72e98246e3f8430c + zh: 5d17178d6122cc42 diff --git a/packages/client/ui-workspace/README.md b/packages/client/ui-workspace/README.md index ce167af31c..52c42b4820 100644 --- a/packages/client/ui-workspace/README.md +++ b/packages/client/ui-workspace/README.md @@ -223,4 +223,4 @@ None. **Runtime invariant:** No companion is published. This is a pure-consumer plugin that registers presentational components into two host-declared slots and registers its locale dictionaries; its inject face consists of stateless RPC wrappers plus a create-and-open call. It emits no Cordis events and owns no cross-plugin mutable state. -History rows without a stored title use the localized unnamed label (未命名 / untitled), rather than a directory name. The current blank row remains New Session; other blank rows remain hidden. +History rows without a stored title use the localized unnamed label (未命名 / Untitled), rather than a directory name. The current blank row remains New Session; other blank rows remain hidden. diff --git a/packages/client/ui-workspace/README.zh.md b/packages/client/ui-workspace/README.zh.md index 58168dd0fd..90abe627aa 100644 --- a/packages/client/ui-workspace/README.zh.md +++ b/packages/client/ui-workspace/README.zh.md @@ -223,4 +223,4 @@ Workspace 与 Session 悬浮卡片会复制对应行被截断的值:激活 Wor **运行时不变式:** 不发布伴生入口。这是一个纯消费方插件,只向两个由宿主声明的 slot 注册展示组件,并注册自身的 locale dictionaries;inject face 由无状态 RPC 包装层和一次 create-and-open 调用组成;本插件不发出 Cordis 事件,也不持有跨插件可变状态。 -未保存标题的历史会话显示本地化名称「未命名 / untitled」,不使用目录名兜底。当前空会话仍显示「新会话」,其他空会话仍隐藏。 +未保存标题的历史会话显示本地化名称「未命名 / Untitled」,不使用目录名兜底。当前空会话仍显示「新会话」,其他空会话仍隐藏。 diff --git a/packages/client/ui-workspace/src/client/locales.ts b/packages/client/ui-workspace/src/client/locales.ts index a8462fa282..7e181f0232 100644 --- a/packages/client/ui-workspace/src/client/locales.ts +++ b/packages/client/ui-workspace/src/client/locales.ts @@ -129,7 +129,7 @@ export const en = { 'defaultWorkspace.failed': 'Unable to create default workspace. Use Choose workspace to select a folder.', 'group.ungrouped': 'Ungrouped', 'session.new': 'New Session', - 'session.untitled': 'untitled', + 'session.untitled': 'Untitled', 'shortcut.hint': '{label} {keys}', 'shortcut.noSession': 'Select a session first', 'shortcut.noPicker': 'Directory picker unavailable', diff --git a/packages/client/ui-workspace/tests/rows.client.spec.tsx b/packages/client/ui-workspace/tests/rows.client.spec.tsx index f0a7cd8be2..f1c8ef7574 100644 --- a/packages/client/ui-workspace/tests/rows.client.spec.tsx +++ b/packages/client/ui-workspace/tests/rows.client.spec.tsx @@ -1081,7 +1081,7 @@ describe('session row schedule seats', () => { }) }) -it.each([['未命名', t], ['untitled', tEn]])('labels unnamed history as %s', (label, translate) => { +it.each([['未命名', t], ['Untitled', tEn]])('labels unnamed history as %s', (label, translate) => { const node: SessionNode = { id: sid('unnamed'), title: '', blank: false, running: false, runningSubagentCount: 0, completed: false, updatedAt: 0, pinned: false, archived: false } render( id as SessionId const wid = (id: string) => id as WorkspaceId const summary = (id: string, updatedAt: number, overrides: Partial = {}): SessionSummary => ({ - id: sid(id), displayTitle: id, running: false, blank: false, updatedAt, ...overrides, + id: sid(id), title: overrides.displayTitle ?? id, displayTitle: id, running: false, blank: false, updatedAt, ...overrides, retainedBy: overrides.retainedBy ?? {}, }) const sessionState = ( diff --git a/snapshots/web/navigation-panes/search-results.expected.md b/snapshots/web/navigation-panes/search-results.expected.md index 49de115594..6be6bf1767 100644 --- a/snapshots/web/navigation-panes/search-results.expected.md +++ b/snapshots/web/navigation-panes/search-results.expected.md @@ -1,2 +1,2 @@ - tree "Search results": - - 'treeitem "{{workspace}} {{workspace}} ## Navigation Summary - alpha nav - beta nav ``` echo WATERFALL ```"' + - 'treeitem "Untitled {{workspace}} ## Navigation Summary - alpha nav - beta nav ``` echo WATERFALL ```"'