From 3ed10e122042a64180fb24a42d9cc6438cd2d2d6 Mon Sep 17 00:00:00 2001 From: weichen Date: Sun, 11 Oct 2026 02:41:39 +0000 Subject: [PATCH] Update workspace builtin expectations and drop an unused selector Why: Removing the artifacts builtin shifts the shortcut ranking, so the workspaces tests now expect agents at cmd-1; Workbench no longer selects previewOpen in its outer scope (FilesTab owns that read). Evidence: npx vitest run 85/85 passed; npm run build (tsc -b && vite build) passed in the task worktree (SELF). Impact: test/workspaces.test.ts expectations; Workbench.tsx selector cleanup. No behavior change beyond the committed layout rework. --- src/components/Workbench.tsx | 1 - test/workspaces.test.ts | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Workbench.tsx b/src/components/Workbench.tsx index 0cd9f87..b0bbaed 100644 --- a/src/components/Workbench.tsx +++ b/src/components/Workbench.tsx @@ -58,7 +58,6 @@ export function Workbench() { const inboxScope = useStore(s => s.inboxScope) const projectCards = useStore(s => s.projectCards) const filter = useStore(s => s.ui.inboxFilter) - const previewOpen = useStore(s => (s.previewTabs[previewTabsKey(s.currentConvId)]?.length ?? 0) > 0) const visible = inboxScope === 'project' ? projectCards : cards const pending = pendingCount(visible) // 离开文件入口时收回全屏展开,避免出现「工作」铺满主区的怪态。 diff --git a/test/workspaces.test.ts b/test/workspaces.test.ts index ad11aa0..2c7423a 100644 --- a/test/workspaces.test.ts +++ b/test/workspaces.test.ts @@ -1,18 +1,19 @@ import { describe, expect, it } from 'vitest' import { buildWorkspaceEntries } from '../src/workspaces' +// 三栏工作台(2026-10-11):文件浏览并入第三栏「文件」入口,体系工具只补「代理」。 describe('buildWorkspaceEntries', () => { - it('没有领域插件时,工件和代理补在 ⌘1 ⌘2', () => { + it('没有领域插件时,代理补在 ⌘1', () => { const entries = buildWorkspaceEntries([]) - expect(entries.map(e => `${e.shortcut} ${e.title}`)).toEqual(['⌘1 工件', '⌘2 代理']) + expect(entries.map(e => `${e.shortcut} ${e.title}`)).toEqual(['⌘1 代理']) }) it('声明了 shortcut 的工作区占住该位,内置工具让位', () => { const entries = buildWorkspaceEntries([ { id: 'trace', title: '追溯网', shortcut: '1' }, ]) - expect(entries.map(e => e.title)).toEqual(['追溯网', '工件', '代理']) - expect(entries.map(e => e.shortcut)).toEqual(['⌘1', '⌘2', '⌘3']) + expect(entries.map(e => e.title)).toEqual(['追溯网', '代理']) + expect(entries.map(e => e.shortcut)).toEqual(['⌘1', '⌘2']) expect(entries[0].key).toBe('ws:trace') }) @@ -20,6 +21,6 @@ describe('buildWorkspaceEntries', () => { const entries = buildWorkspaceEntries([ { id: 'mem', title: '记忆库' }, ]) - expect(entries.map(e => e.title)).toEqual(['工件', '代理', '记忆库']) + expect(entries.map(e => e.title)).toEqual(['代理', '记忆库']) }) })