feat(ui): refine desktop workbench navigation

This commit is contained in:
NI0317
2026-07-18 17:39:31 +08:00
parent 649183aa65
commit 2f37bbc61a
13 changed files with 457 additions and 139 deletions

View File

@@ -48,7 +48,7 @@ describe('desktop ACP subprocess bridge', () => {
let stderr = ''
child.stderr.setEncoding('utf8')
child.stderr.on('data', chunk => { stderr += String(chunk) })
child.stderr.on('data', (chunk) => { stderr += String(chunk) })
const stream: Stream = ndJsonStream(
Writable.toWeb(child.stdin) as WritableStream<Uint8Array>,
@@ -69,7 +69,7 @@ describe('desktop ACP subprocess bridge', () => {
}), stream)
const init = await client.initialize({ protocolVersion: PROTOCOL_VERSION, clientCapabilities: {} })
expect(init.agentInfo.name).toBe('deepseek-harness-acp')
expect(init.agentInfo?.name).toBe('deepseek-harness-acp')
const session = await client.newSession({ cwd: process.cwd(), mcpServers: [] })
expect(session.sessionId).toBeTruthy()

View File

@@ -11,9 +11,9 @@ import {
ownsComposer,
SURFACE_DEFINITIONS,
SURFACE_POLICIES,
type DesktopSurface,
type InspectorTarget,
} from '../src/index.ts'
import { translate } from '../src/i18n.ts'
const target: InspectorTarget = {
id: 'session:one:event:1',
@@ -89,7 +89,7 @@ describe('desktop inspector contracts', () => {
it('keeps inspector tabs ordered with feedback last', () => {
expect(INSPECTOR_TABS).toEqual(['input', 'output', 'metadata', 'feedback'])
expect(openInspectorState(target).tabs.map((tab) => tab.tab)).toEqual(INSPECTOR_TABS)
expect(openInspectorState(target).tabs.map(tab => tab.tab)).toEqual(INSPECTOR_TABS)
expect(closedInspectorState()).toEqual({
open: false,
activeTab: 'input',
@@ -101,3 +101,12 @@ describe('desktop inspector contracts', () => {
expect(DEFAULT_FEEDBACK_AUTHOR).toBe('shentuni')
})
})
describe('desktop i18n', () => {
it('switches visible shell labels between Chinese and English', () => {
expect(translate('zh-CN', 'app.newChat')).toBe('新对话')
expect(translate('en-US', 'app.newChat')).toBe('New chat')
expect(translate('zh-CN', 'app.language')).toBe('EN')
expect(translate('en-US', 'app.language')).toBe('中文')
})
})