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.
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { buildWorkspaceEntries } from '../src/workspaces'
|
|
|
|
// 三栏工作台(2026-10-11):文件浏览并入第三栏「文件」入口,体系工具只补「代理」。
|
|
describe('buildWorkspaceEntries', () => {
|
|
it('没有领域插件时,代理补在 ⌘1', () => {
|
|
const entries = buildWorkspaceEntries([])
|
|
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'])
|
|
expect(entries[0].key).toBe('ws:trace')
|
|
})
|
|
|
|
it('未编号的工作区排在内置工具后面', () => {
|
|
const entries = buildWorkspaceEntries([
|
|
{ id: 'mem', title: '记忆库' },
|
|
])
|
|
expect(entries.map(e => e.title)).toEqual(['代理', '记忆库'])
|
|
})
|
|
})
|