Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
Align release regression tests with current desktop and localized workflows
Leggett5daf92a38f40
diff --git a/apps/desktop/e2e/desktop.spec.ts b/apps/desktop/e2e/desktop.spec.tsindex 678a8b41..b6e630c4 100644--- a/apps/desktop/e2e/desktop.spec.ts+++ b/apps/desktop/e2e/desktop.spec.ts@@ -657,7 +657,7 @@ test('bundled 模式在最小 PATH 下忽略 ChatGPT 应用内置的 Codex', asy}});-test('@package-smoke 成功 Probe 后进入 Dashboard,刷新不重复 Probe,并代理 JSON、二进制和 SSE', async ({}, testInfo) => {+test('@package-smoke 启动和刷新不触发付费 Probe,并代理 JSON、二进制和 SSE', async ({}, testInfo) => {const fixture = await launchPlatformProbeDesktop('success');try {await waitForWorkspace(fixture.page);@@ -669,7 +669,9 @@ test('@package-smoke 成功 Probe 后进入 Dashboard,刷新不重复 Probe,await fixture.page.getByRole('button', { name: '工作台' }).click();await expect(fixture.page.getByText('登录即可享受云端协作')).toHaveCount(0);await expect(fixture.page.getByRole('button', { name: '登录' })).toHaveCount(0);- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect((await runtimeRequest(fixture.page, 'GET', '/codex/status')).body)+ .toMatchObject({ availabilityProbe: { status: 'skipped' } });+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);const startupMetrics = await fixture.page.evaluate(async () => (await window.opencreatorDesktop?.readBootstrapState())?.startupMetrics);@@ -864,7 +866,7 @@ test('@package-smoke 成功 Probe 后进入 Dashboard,刷新不重复 Probe,await fixture.page.reload({ waitUntil: 'domcontentloaded' });await waitForWorkspace(fixture.page);}- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);const pageClosed = fixture.page.waitForEvent('close');await fixture.page.evaluate(() => {@@ -1162,9 +1164,9 @@ test('打包 App 使用 Codex app-server 并持久化项目与会话', async ({}}>(fixture.page, 'GET', '/projects?status=all');expect(initialProjects.status).toBe(200);expect(- initialProjects.body.projects.filter(project => project.name === '默认项目')+ initialProjects.body.projects.filter(project => project.name === 'Default project')).toHaveLength(1);- const defaultProject = initialProjects.body.projects.find(project => project.name === '默认项目');+ const defaultProject = initialProjects.body.projects.find(project => project.name === 'Default project');if (defaultProject === undefined) throw new Error('打包 App 未创建默认工作目录');const initialCreatorJob = await runtimeRequest<{job: { id: string };@@ -1255,7 +1257,7 @@ test('打包 App 使用 Codex app-server 并持久化项目与会话', async ({}}>(fixture.page, 'GET', '/projects?status=all');expect(persistedProjects.status).toBe(200);expect(- persistedProjects.body.projects.filter(project => project.name === '默认项目')+ persistedProjects.body.projects.filter(project => project.name === 'Default project')).toHaveLength(1);expect(persistedProjects.body.projects).toContainEqual(expect.objectContaining({id: createdProject.body.project.id,@@ -1343,11 +1345,10 @@ test('打包 App 首页 Skills 菜单保持在内容区内', async ({}, testInfo}});-test('后台 Probe 失败时仍进入 Dashboard 并暴露诊断状态', async () => {- const fixture = await launchPackagedDesktop('probe-failure');+test('未启用付费 Probe 时不执行失败探测,工作区保持可用', async () => {+ const fixture = await launchPlatformProbeDesktop('probe-failure');try {await waitForWorkspace(fixture.page);- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);await expect.poll(async () => await fixture.page.evaluate(async () => {const response = await fetch('/.opencreator/runtime/codex/status');const payload = await response.json() as {@@ -1362,10 +1363,11 @@ test('后台 Probe 失败时仍进入 Dashboard 并暴露诊断状态', async ()) ?? false};}), { timeout: 15_000 }).toEqual({- status: 'failed',- errorCode: 'CODEX_PROBE_EXIT_NON_ZERO',- hasDiagnostic: true+ status: 'skipped',+ errorCode: undefined,+ hasDiagnostic: false});+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);expect(fixture.page.url()).toContain('opencreator-app://app/');} finally {await closeFixture(fixture);@@ -1382,13 +1384,13 @@ test('Dashboard 握手超时后显示本地错误页并可无 Probe 重载', asyawait expect(fixture.page.locator('#reload-workspace')).toBeVisible();await expect(fixture.page.locator('#restart-runtime')).toBeVisible();await expect(fixture.page.locator('#failure-actions')).toBeHidden();- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);const mainPid = requiredPid(fixture.process.pid);const daemonPid = await waitForDaemonUtilityPid(mainPid);await fixture.page.locator('#reload-workspace').click();await waitForWorkspace(fixture.page);- expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);expect(findDaemonUtilityPid(mainPid)).toBe(daemonPid);} finally {await closeFixture(fixture);@@ -1399,7 +1401,7 @@ test('@package-smoke Daemon 连续退出保留 Creator 草稿,自动恢复耗const fixture = await launchPlatformProbeDesktop('success');try {await waitForWorkspace(fixture.page);- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);const mainPid = requiredPid(fixture.process.pid);await fixture.page.getByRole('button', { name: '工作台', exact: true }).click();await fixture.page.getByRole('button', { name: /^视频翻译/ }).click();@@ -1422,7 +1424,7 @@ test('@package-smoke Daemon 连续退出保留 Creator 草稿,自动恢复耗phase: undefined,health: undefined})), { timeout: 30_000 }).toEqual({ phase: 'ready', health: 200 });- await expect.poll(() => readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);await expect(composer).toHaveValue('保留这段尚未提交的翻译要求');let currentPid = replacementPid;for (let attempt = 0; attempt < 2; attempt += 1) {@@ -1445,14 +1447,14 @@ test('@package-smoke Daemon 连续退出保留 Creator 草稿,自动恢复耗phase: 'failed',code: 'DAEMON_RESTART_EXHAUSTED'});- expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);await expect(fixture.page.getByRole('button', { name: '重启本地服务', exact: true })).toBeVisible();fixture.page.once('dialog', dialog => void dialog.accept());await fixture.page.getByRole('button', { name: '重启本地服务', exact: true }).click();await expect.poll(async () => (await fixture.page.evaluate(() => window.opencreatorDesktop?.readBootstrapState()))?.phase).toBe('ready');await expect(composer).toHaveValue('保留这段尚未提交的翻译要求');expect(await fixture.page.evaluate(() => document.body.dataset.runtimeRecoveryMarker)).toBe('retain-renderer');- expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(1);+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);} finally {await closeFixture(fixture);}@@ -1500,28 +1502,21 @@ test('启动页使用 OpenCreator 文字品牌', async ({}, testInfo) => {}});-test('@package-smoke 退出期间会回收仍在 Probe 中的 Codex 子进程', async () => {- test.setTimeout(120_000);+test('@package-smoke 跳过付费 Probe 并快速退出,回收 Codex 子进程', async () => {const fixture = await launchPlatformProbeDesktop('probe-hang');- const pidPath = join(fixture.stateDir, 'probe-pid.txt');try {- await expect.poll(async () => ({- pidRecorded: existsSync(pidPath),- bootstrapFailure: await fixture.page.evaluate(async () => {- const state = await window.opencreatorDesktop?.readBootstrapState();- return state?.phase === 'failed' ? state.error?.code ?? 'failed' : undefined;- }).catch(() => undefined)- }), { timeout: 45_000 }).toEqual({- pidRecorded: true,- bootstrapFailure: undefined- });- const codexPid = Number(readFileSync(pidPath, 'utf8'));- expect(isProcessAlive(codexPid)).toBe(true);+ await waitForWorkspace(fixture.page);+ expect((await runtimeRequest(fixture.page, 'GET', '/codex/status')).body)+ .toMatchObject({ availabilityProbe: { status: 'skipped' } });+ expect(readCounter(fixture.stateDir, 'probe-count.txt')).toBe(0);+ const codexPids = readFileSync(join(fixture.stateDir, 'invocations.ndjson'), 'utf8')+ .trim().split('\n').map(line => (JSON.parse(line) as { pid: number }).pid);+ expect(codexPids.length).toBeGreaterThan(0);await requestPackagedAppQuit(fixture);- expect(await waitForProcessExit(fixture.process, 15_000)).toBe(true);+ expect(await waitForProcessExit(fixture.process, 3_000)).toBe(true);expect(fixture.process.exitCode).toBe(0);- await expect.poll(() => isProcessAlive(codexPid), { timeout: 15_000 }).toBe(false);+ await expect.poll(() => codexPids.some(isProcessAlive), { timeout: 15_000 }).toBe(false);} finally {await closeFixture(fixture);}@@ -1557,12 +1552,12 @@ test('@package-smoke 关闭后隐藏保留本地服务,重新打开后可以await fixture.page.evaluate(async () => {await window.opencreatorDesktop?.updateDesktopPreferences({ closeBehavior: 'hide' });});- await fixture.page.getByRole('button', { name: 'Close window', exact: true }).click();+ await fixture.page.getByRole('button', { name: '关闭窗口', exact: true }).click();expect(fixture.process.exitCode).toBeNull();expect((await runtimeRequest(fixture.page, 'GET', '/healthz')).status).toBe(200);await launchSecondInstance(fixture);- await expect(fixture.page.getByRole('button', { name: 'Close window', exact: true })).toBeVisible();+ await expect(fixture.page.getByRole('button', { name: '关闭窗口', exact: true })).toBeVisible();await requestPackagedAppQuit(fixture);expect(await waitForProcessExit(fixture.process, 3_000)).toBe(true);expect(fixture.process.exitCode).toBe(0);@@ -1581,7 +1576,7 @@ test('@package-smoke 创作模块连接内嵌 Runtime 并使用默认项目', asconst response = await runtimeRequest<{ projects: Array<{ name: string }> }>(fixture.page, 'GET', '/projects?status=all');- return response.body.projects.filter(project => project.name === '默认项目').length;+ return response.body.projects.filter(project => project.name === 'Default project').length;}).toBe(1);expect((await runtimeRequest(fixture.page, 'GET', '/creator/templates')).status).toBe(200);@@ -1697,7 +1692,7 @@ test('@package-smoke 设置关闭后退出时,关闭按钮结束实际 App', aawait fixture.page.evaluate(async () => {await window.opencreatorDesktop?.updateDesktopPreferences({ closeBehavior: 'quit' });});- await fixture.page.getByRole('button', { name: 'Close window', exact: true }).click();+ await fixture.page.getByRole('button', { name: '关闭窗口', exact: true }).click();expect(await waitForProcessExit(fixture.process, 3_000)).toBe(true);expect(fixture.process.exitCode).toBe(0);} finally {@@ -1719,12 +1714,6 @@ async function launchPlatformProbeDesktop(mode: string): Promise<DesktopFixture>const path = request.url?.split('?')[0];if (path === '/api/v1/client/bootstrap') {response.end(JSON.stringify(bootstrap));- } else if (path === '/api/v1/client/probe-credentials') {- response.end(JSON.stringify({- costBearer: 'platform', modelKey: 'platform-probe-key', keyVersion: 'probe-1',- baseUrl: 'https://openrouter.ai/api/v1',- expiresAt: new Date(Date.now() + 900_000).toISOString()- }));} else if (path === '/api/v1/client/models') {response.end(JSON.stringify({ models }));} else if (path === '/api/v1/client/usage') {@@ -1742,9 +1731,10 @@ async function launchPlatformProbeDesktop(mode: string): Promise<DesktopFixture>});const origin = `http://127.0.0.1:${(gateway.address() as AddressInfo).port}`;const bootstrap = {- schemaVersion: 1 as const, account, models, defaults: { text: 'official-model' },- modelKey: 'user-model-key', keyVersion: '1', bindingVersion: 'probe:1',- baseUrl: `${origin}/v1`, keyRotation: true+ schemaVersion: 3 as const, account, models, defaults: { text: 'official-model' },+ keyVersion: '1', bindingVersion: 'probe:1',+ transport: 'gateway' as const, supplier: 'chatanywhere' as const,+ baseUrl: `${origin}/v1`, keyRotation: false};const closeGateway = async () => {gateway.closeAllConnections();diff --git a/apps/desktop/release-notes/v3.2.7.md b/apps/desktop/release-notes/v3.2.7.mdnew file mode 100644index 00000000..f33ee1df--- /dev/null+++ b/apps/desktop/release-notes/v3.2.7.md@@ -0,0 +1,8 @@+## 更新内容++- 扩展官方文本、图像、配音、转录和视频服务,使用网关模型目录中的推荐模型与价格。+- 统一积分价格和整数余额展示,明确 Token、图片张数、视频秒数和转录分钟的计费单位。+- 加快启动时的账户状态恢复,改进网关迁移、授权回调和充值结果确认。+- 优化字幕并发翻译、双语单行字幕和时间轴,支持独立 SRT 翻译与下载。+- 临时供应商错误交由任务重试处理,异步配音请求先查询原结果,减少重复提交。+- 扩展视频下载能力,支持链接队列和封面下载,改进平台兼容性。diff --git a/apps/web/e2e/fixtures/runtime.ts b/apps/web/e2e/fixtures/runtime.tsindex 9c9de7cb..6a863ec5 100644--- a/apps/web/e2e/fixtures/runtime.ts+++ b/apps/web/e2e/fixtures/runtime.ts@@ -332,7 +332,7 @@ export const test = base.extend<TestFixtures>({legacyProjects: options.legacyProjects});await page.goto(`${origin}/#/thread/${encodeURIComponent(selectedThreadId)}`);- await expect(page.getByRole('status', { name: 'The local Runtime is ready' })).toBeVisible();+ await expect(page.getByRole('status', { name: '本地运行内核正常' })).toBeVisible();if (await page.evaluate(() => localStorage.getItem('opencreator.agent-setup-confirmed.v1') === null)) {const setup = page.getByRole('region', { name: '开始使用 Agent' });await expect(setup).toBeVisible();diff --git a/apps/web/e2e/scheduled-task-performance.spec.ts b/apps/web/e2e/scheduled-task-performance.spec.tsindex c0f062d8..699309c2 100644--- a/apps/web/e2e/scheduled-task-performance.spec.ts+++ b/apps/web/e2e/scheduled-task-performance.spec.ts@@ -78,7 +78,7 @@ test('100 个任务只加载摘要,并按需加载单个任务会话历史', aexpectLoadRequestBudget(initialRequests, taskThreadIds);await page.reload();- await expect(page.getByRole('status', { name: 'The local Runtime is ready' })).toBeVisible();+ await expect(page.getByRole('status', { name: '本地运行内核正常' })).toBeVisible();const refreshSample = await readPerformanceSample(page);const refreshRequests = requests.splice(0);expectLoadRequestBudget(refreshRequests, taskThreadIds);diff --git a/apps/web/e2e/web-desktop-parity.spec.ts b/apps/web/e2e/web-desktop-parity.spec.tsindex 81b5f202..8954968a 100644--- a/apps/web/e2e/web-desktop-parity.spec.ts+++ b/apps/web/e2e/web-desktop-parity.spec.ts@@ -23,7 +23,7 @@ test('Windows YouTube 专用登录和完成在 Browser/Desktop 下保持一致',try {await runtime.openApp(page);await page.goto(`${runtime.origin}/#/settings?tab=platform-connections`);- const section = page.getByRole('region', { name: '平台连接' });+ const section = page.getByRole('region', { name: '平台连接' }).getByLabel('YouTube', { exact: true });await expect(section.getByRole('button', { name: '连接', exact: true })).toBeVisible();await expect(section.getByRole('button', { name: '下载浏览器连接器' })).toHaveCount(0);await section.getByRole('button', { name: '连接', exact: true }).click();@@ -65,11 +65,11 @@ test('首页和项目页按需加载管理、登录与插件资源且 Browser/Deexpect(resources.some(url => /ProjectManagementDialog|\/packages\/skill-market\//.test(url))).toBe(false);resources.length = 0;await page.reload();- await expect(page.getByRole('status', { name: 'The local Runtime is ready' })).toBeVisible();+ await expect(page.getByRole('status', { name: '本地运行内核正常' })).toBeVisible();await expect(page.locator('.startup-agent-setup')).toHaveCount(0);expect(resources).toHaveLength(0);await page.getByRole('button', { name: '我的项目', exact: true }).click();- const workspace = page.getByRole('region', { name: 'OpenCreator workspace' });+ const workspace = page.getByRole('region', { name: 'OpenCreator 工作区' });const heading = workspace.getByRole('heading', { name: '我的项目', exact: true });await expect(heading).toBeVisible();expect(resources).toHaveLength(0);@@ -1115,7 +1115,7 @@ test('通用界面设置在 Browser/Desktop Bridge 下读取并写入相同 Runtawait page.goto(`${runtime.origin}/#/settings`);const settings = page- .getByRole('region', { name: 'OpenCreator workspace' })+ .getByRole('region', { name: 'OpenCreator 工作区' }).getByRole('main');const lightButton = settings.getByRole('button', { name: '浅色' });const permission = settings.getByRole('combobox', { name: '默认权限' });@@ -1274,7 +1274,7 @@ test('视频下载在 Browser/Desktop Bridge 下保持相同界面、请求和await expect(sources).toHaveCount(0);await workspace.getByRole('textbox', { name: '视频链接', exact: true }).fill('https://www.youtube.com/watch?v=OpenCreatorParity');- await workspace.getByRole('button', { name: '添加并解析' }).click();+ await workspace.getByRole('button', { name: '获取' }).click();await expect(sources.getByRole('listitem')).toHaveCount(1);await expect(workspace.getByRole('textbox', { name: '视频链接', exact: true })).toHaveCount(0);@@ -1599,7 +1599,7 @@ test('本地 Whisper 在 Browser/Desktop Bridge 下遵守相同 Runtime 能力await runtime.openApp(page);await page.goto(`${runtime.origin}/#/settings?tab=ai-services§ion=transcription`);const settings = page- .getByRole('region', { name: 'OpenCreator workspace' })+ .getByRole('region', { name: 'OpenCreator 工作区' }).getByRole('main');const localMode = settings.getByRole('button', { name: '本地 Whisper' });if (localProvider) {@@ -2042,7 +2042,7 @@ test('第三方组件设置在 Browser/Desktop Bridge 下保持相同状态、await page.goto(`${runtime.origin}/#/settings?tab=local-components`);const settings = page- .getByRole('region', { name: 'OpenCreator workspace' })+ .getByRole('region', { name: 'OpenCreator 工作区' }).getByRole('main');const component = settings.locator('.runtime-component-item').filter({has: page.getByRole('heading', { name: 'yt-dlp nightly' })@@ -2133,7 +2133,7 @@ test('工作台模块新建 Creator Job,刷新和最近项目精确恢复历const input = page.getByRole('textbox', { name: '视频链接', exact: true });await expect(input).toBeVisible();await input.fill('https://www.youtube.com/watch?v=OpenCreatorDemo');- await page.getByRole('button', { name: '添加并解析' }).click();+ await page.getByRole('button', { name: '获取' }).click();await expect(page).toHaveURL(/#\/workbench\?tool=video-download&jobId=creator_job_/);const firstJobId = new URL(page.url()).hash.match(/jobId=([^&]+)/)?.[1];expect(firstJobId).toBeTruthy();@@ -2159,7 +2159,7 @@ test('工作台模块新建 Creator Job,刷新和最近项目精确恢复历await page.getByRole('button', { name: '添加链接', exact: true }).click();await input.fill('https://www.youtube.com/watch?v=OpenCreatorChild');- await page.getByRole('button', { name: '添加并解析' }).click();+ await page.getByRole('button', { name: '获取' }).click();await expect(page.getByRole('list', { name: '视频链接列表' }).getByRole('listitem')).toHaveCount(2);const children = await runtime.api<{ jobs: Array<{ state: Record<string, unknown> }> }>('GET', `/creator/jobs?projectId=${encodeURIComponent(runtime.projectId)}`@@ -2180,7 +2180,7 @@ test('工作台模块新建 Creator Job,刷新和最近项目精确恢复历await expect(page.getByRole('textbox', { name: '视频链接', exact: true })).toHaveValue('');await page.getByRole('textbox', { name: '视频链接', exact: true }).fill('https://www.youtube.com/watch?v=OpenCreatorSecond');- await page.getByRole('button', { name: '添加并解析' }).click();+ await page.getByRole('button', { name: '获取' }).click();await expect(page).toHaveURL(/#\/workbench\?tool=video-download&jobId=creator_job_/);const secondJobId = new URL(page.url()).hash.match(/jobId=([^&]+)/)?.[1];expect(secondJobId).toBeTruthy();diff --git a/apps/web/src/app/App.test.tsx b/apps/web/src/app/App.test.tsxindex bbeca938..2bbaafcc 100644--- a/apps/web/src/app/App.test.tsx+++ b/apps/web/src/app/App.test.tsx@@ -153,7 +153,7 @@ describe('App', () => {render(<App hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);expect(await screen.findByRole('heading', { name: 'OpenCreator' })).toBeInTheDocument();- expect(screen.queryByLabelText('OpenCreator navigation')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('OpenCreator 导航')).not.toBeInTheDocument();await user.click(screen.getByRole('button', { name: '稍后配置,进入本地模式' }));expect(await screen.findByText('Agent 尚未配置,暂时无法发送任务。')).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '配置 Agent' }));@@ -179,7 +179,7 @@ describe('App', () => {render(<App hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);await waitFor(() => {expect(screen.queryByText('正在检查 Agent 配置…')).not.toBeInTheDocument();- expect(screen.getByLabelText('OpenCreator navigation')).toBeInTheDocument();+ expect(screen.getByLabelText('OpenCreator 导航')).toBeInTheDocument();});expect(screen.queryByRole('heading', { name: 'OpenCreator' })).not.toBeInTheDocument();}@@ -216,7 +216,7 @@ describe('App', () => {expect(screen.queryByLabelText('Base URL')).not.toBeInTheDocument();expect(screen.queryByLabelText('API Key')).not.toBeInTheDocument();await user.click(screen.getByRole('button', { name: '登录 OpenCreator' }));- await waitFor(() => expect(screen.getByLabelText('OpenCreator navigation')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByLabelText('OpenCreator 导航')).toBeInTheDocument());expect(screen.queryByRole('region', { name: '开始使用 Agent' })).not.toBeInTheDocument();expect(screen.queryByText('Agent 尚未配置,暂时无法发送任务。')).not.toBeInTheDocument();if (activationState === 'ready') {@@ -269,13 +269,13 @@ describe('App', () => {render(<App hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);await user.click(await screen.findByRole('button', { name: '本地模式' }));expect(await screen.findByText('已找到本机 Codex')).toBeInTheDocument();- expect(screen.queryByLabelText('OpenCreator navigation')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('OpenCreator 导航')).not.toBeInTheDocument();await user.click(screen.getByRole('button', { name: '使用本机 Codex,继续' }));await waitFor(() => expect(screen.queryByRole('heading', { name: 'OpenCreator' })).not.toBeInTheDocument());cleanup();render(<App hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);- await waitFor(() => expect(screen.getByLabelText('OpenCreator navigation')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByLabelText('OpenCreator 导航')).toBeInTheDocument());expect(screen.queryByRole('heading', { name: 'OpenCreator' })).not.toBeInTheDocument();cleanup();@@ -307,7 +307,7 @@ describe('App', () => {diagnostics: []})).toEqual(expect.arrayContaining([expect.objectContaining({ category: 'skill', insertText: '$brainstorming ' }),- expect.objectContaining({ category: 'mcp', insertText: 'Use MCP: github ' })+ expect.objectContaining({ category: 'mcp', insertText: '使用 MCP:github ' })]));});@@ -316,7 +316,7 @@ describe('App', () => {Date.parse('2026-07-21T07:00:30.000Z'));- expect(formatRelativeTime('2026-07-21 07:00:00')).toBe('Just now');+ expect(formatRelativeTime('2026-07-21 07:00:00')).toBe('刚刚');now.mockRestore();});@@ -721,12 +721,12 @@ describe('App', () => {/>);- expect(await screen.findByRole('heading', { name: 'Task center' })).toBeInTheDocument();+ expect(await screen.findByRole('heading', { name: '任务中心' })).toBeInTheDocument();expect(window.location.hash).toBe('#/tasks');await user.click(await within(screen.getByRole('list')).findByRole('button', { name: /后台整理任务/ }));- expect(await screen.findByRole('heading', { name: 'Run details' })).toBeInTheDocument();+ expect(await screen.findByRole('heading', { name: '运行详情' })).toBeInTheDocument();expect(screen.getByText('run_task')).toBeInTheDocument();expect(window.location.hash).toBe('#/thread/thread_task');});@@ -815,7 +815,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('heading', { name: 'Task center' })).toBeInTheDocument();+ expect(await screen.findByRole('heading', { name: '任务中心' })).toBeInTheDocument();await user.click(await within(await screen.findByRole('list')).findByRole('button', {name: /每日总结/}));@@ -825,7 +825,7 @@ describe('App', () => {});expect(document.querySelector('[data-search-target="true"]')).toContainElement(approvalRegion);- expect(screen.queryByRole('heading', { name: 'Run details' })).not.toBeInTheDocument();+ expect(screen.queryByRole('heading', { name: '运行详情' })).not.toBeInTheDocument();expect(window.location.hash).toBe('#/thread/thread_approval_task?runId=run_approval_task&approvalId=approval_task');@@ -836,7 +836,7 @@ describe('App', () => {render(<App fileService={createFileService()} />);- expect(await screen.findByRole('button', { name: 'Close file workspace' })).toBeInTheDocument();+ expect(await screen.findByRole('button', { name: '关闭文件工作区' })).toBeInTheDocument();expect(window.location.hash).toBe('#/files?path=docs%2Fatoms.md');});@@ -844,14 +844,14 @@ describe('App', () => {const user = userEvent.setup();render(<App />);- const navigation = await screen.findByLabelText('OpenCreator navigation');- await user.click(screen.getByRole('button', { name: 'Open navigation' }));+ const navigation = await screen.findByLabelText('OpenCreator 导航');+ await user.click(screen.getByRole('button', { name: '打开导航' }));expect(navigation).toHaveAttribute('data-mobile-open', 'true');await user.click(screen.getByRole('button', { name: '工作台' }));expect(navigation).toHaveAttribute('data-mobile-open', 'false');- await user.click(screen.getByRole('button', { name: 'Open navigation' }));+ await user.click(screen.getByRole('button', { name: '打开导航' }));expect(navigation).toHaveAttribute('data-mobile-open', 'true');act(() => window.dispatchEvent(new PopStateEvent('popstate')));@@ -875,16 +875,16 @@ describe('App', () => {render(<App />);- await user.click(await screen.findByRole('button', { name: 'Open navigation' }));+ await user.click(await screen.findByRole('button', { name: '打开导航' }));expect(pushState).toHaveBeenCalledWith(expect.objectContaining({ opencreatorMobileNavigation: true }),'');- await user.click(screen.getByRole('button', { name: 'Close navigation' }));+ await user.click(screen.getByRole('button', { name: '关闭导航' }));expect(back).toHaveBeenCalledTimes(1);- expect(screen.getByLabelText('OpenCreator navigation')).toHaveAttribute('data-mobile-open', 'false');+ expect(screen.getByLabelText('OpenCreator 导航')).toHaveAttribute('data-mobile-open', 'false');});it('replaces the temporary mobile drawer entry when navigating from the drawer', async () => {@@ -903,13 +903,13 @@ describe('App', () => {render(<App />);- await user.click(await screen.findByRole('button', { name: 'Open navigation' }));+ await user.click(await screen.findByRole('button', { name: '打开导航' }));await user.click(screen.getByRole('button', { name: '工作台' }));await waitFor(() => expect(window.location.hash).toBe('#/dashboard'));expect(back).not.toHaveBeenCalled();expect(window.history.state?.opencreatorMobileNavigation).not.toBe(true);- expect(screen.getByLabelText('OpenCreator navigation')).toHaveAttribute('data-mobile-open', 'false');+ expect(screen.getByLabelText('OpenCreator 导航')).toHaveAttribute('data-mobile-open', 'false');});afterEach(() => {@@ -976,7 +976,7 @@ describe('App', () => {await user.click(screen.getByRole('button', { name: /^视频翻译/ }));expect(await screen.findByRole('heading', { name: '视频翻译配音' })).toBeInTheDocument();- expect(screen.queryByLabelText('OpenCreator navigation')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('OpenCreator 导航')).not.toBeInTheDocument();const agentInput = screen.getByRole('textbox', { name: '告诉 Agent 你的要求' });expect(agentInput).toHaveAttribute('placeholder',@@ -986,7 +986,7 @@ describe('App', () => {await user.click(within(screen.getByRole('region', { name: '视频翻译操作区' })).getByRole('button', { name: '返回' }));- expect(await screen.findByLabelText('OpenCreator navigation')).toBeInTheDocument();+ expect(await screen.findByLabelText('OpenCreator 导航')).toBeInTheDocument();await waitFor(() => expect(window.location.hash).toBe('#/workbench'));});@@ -1365,7 +1365,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /hello/ }));const mainTitlebar = document.querySelector<HTMLElement>('.opencreator-main-titlebar');@@ -1374,10 +1374,10 @@ describe('App', () => {expect(document.querySelector('.conversation-page > .conversation-header')).not.toBeInTheDocument();expect(screen.getAllByRole('heading', { name: 'hello' })).toHaveLength(1);- await user.click(within(mainTitlebar!).getByRole('button', { name: 'Files' }));+ await user.click(within(mainTitlebar!).getByRole('button', { name: '文件' }));- expect(await screen.findByLabelText('Conversation and file workspace')).toBeInTheDocument();- expect(within(mainTitlebar!).getByRole('button', { name: 'Files' }))+ expect(await screen.findByLabelText('会话和文件工作区')).toBeInTheDocument();+ expect(within(mainTitlebar!).getByRole('button', { name: '文件' })).toHaveAttribute('aria-pressed', 'true');});@@ -1570,7 +1570,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /浏览器会话标题/ }));const conversationPage = document.querySelector<HTMLElement>('.conversation-page');@@ -1692,19 +1692,19 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '定时任务' }));expect(await screen.findByRole('heading', { name: '每日总结' })).toBeInTheDocument();expect(screen.queryByRole('heading', { name: 'OpenCreator:已安排' })).not.toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'View last run' }));+ await user.click(screen.getByRole('button', { name: '查看上次运行' }));expect(await screen.findByRole('heading', { name: '每日总结' })).toBeInTheDocument();expect(window.location.hash).toBe('#/thread/thread-schedule-1?runId=run_schedule');- expect(screen.queryByRole('heading', { name: 'Run details' })).not.toBeInTheDocument();+ expect(screen.queryByRole('heading', { name: '运行详情' })).not.toBeInTheDocument();expect(screen.getByRole('textbox', { name: '输入任务' })).toBeInTheDocument();- expect(screen.getByText('Scheduled run')).toBeInTheDocument();+ expect(screen.getByText('定时执行')).toBeInTheDocument();expect(screen.getByText('生成每日项目摘要')).toBeInTheDocument();});@@ -1771,20 +1771,20 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();- expect(screen.queryByLabelText('Task management')).not.toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();+ expect(screen.queryByLabelText('任务管理')).not.toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /^每日总结/ }));- expect(await screen.findByLabelText('Task management')).toBeInTheDocument();+ expect(await screen.findByLabelText('任务管理')).toBeInTheDocument();expect(document.querySelector('.opencreator-main-titlebar')).toHaveTextContent('每日总结');expect(document.querySelector('.conversation-task-strip--standalone'))- .toContainElement(screen.getByLabelText('Task management'));+ .toContainElement(screen.getByLabelText('任务管理'));expect(document.querySelector('.conversation-page > .conversation-header')).not.toBeInTheDocument();expect(screen.queryByText('需要帮你做点什么')).not.toBeInTheDocument();- expect(screen.getByRole('button', { name: 'Run task now' })).toBeInTheDocument();- expect(screen.getByRole('button', { name: 'Pause task' })).toBeInTheDocument();- expect(screen.getByRole('button', { name: 'Edit task' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: '立即运行任务' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: '暂停任务' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: '编辑任务' })).toBeInTheDocument();});it.each([@@ -1809,7 +1809,7 @@ describe('App', () => {skipped: false,queued: true},- expectedMessage: 'This run is queued and will start after the active task finishes.'+ expectedMessage: '本次运行已排队,会在当前任务结束后执行'},{label: 'skips',@@ -1819,7 +1819,7 @@ describe('App', () => {skipped: true,queued: false},- expectedMessage: 'A task is already running. This run was skipped.'+ expectedMessage: '已有任务在运行,本次已跳过'}])('$label a schedule from its task thread', async ({ response, expectedMessage }) => {const user = userEvent.setup();@@ -1879,7 +1879,7 @@ describe('App', () => {);await user.click(await screen.findByRole('button', { name: '定时任务' }));- await user.click(await screen.findByRole('button', { name: 'Run now 每日总结' }));+ await user.click(await screen.findByRole('button', { name: '立即运行每日总结' }));expect(window.location.hash).toBe('#/thread/thread-schedule-1');runNow.resolve(jsonResponse(response));@@ -1958,12 +1958,12 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '定时任务' }));- expect(await screen.findByRole('heading', { name: 'Scheduled tasks' })).toBeInTheDocument();+ expect(await screen.findByRole('heading', { name: '定时任务' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: /^Create$/ }));- expect(screen.getByRole('dialog', { name: 'Create scheduled task' })).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: /^创建$/ }));+ expect(screen.getByRole('dialog', { name: '创建定时任务' })).toBeInTheDocument();expect(screen.queryByRole('menu')).not.toBeInTheDocument();expect(screen.queryByText('使用 OpenCreator 创建')).not.toBeInTheDocument();expect(findPostCall(fetchCalls, '/threads')).toBeUndefined();@@ -2068,17 +2068,17 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '定时任务' }));- await user.click(await screen.findByRole('button', { name: /^Create$/ }));- expect(screen.getByRole('dialog', { name: 'Create scheduled task' })).toBeInTheDocument();- expect(screen.getByLabelText('Scheduled task title')).toBeInTheDocument();- expect(screen.getByLabelText('Task instructions')).toBeInTheDocument();+ await user.click(await screen.findByRole('button', { name: /^创建$/ }));+ expect(screen.getByRole('dialog', { name: '创建定时任务' })).toBeInTheDocument();+ expect(screen.getByLabelText('定时任务标题')).toBeInTheDocument();+ expect(screen.getByLabelText('任务内容')).toBeInTheDocument();expect(findPostCall(fetchCalls, '/threads')).toBeUndefined();expect(findPostCall(fetchCalls, '/runs')).toBeUndefined();expect(findPostCall(fetchCalls, '/schedules')).toBeUndefined();expect(scheduleListCalls).toBeGreaterThanOrEqual(1);- expect(screen.queryByLabelText('Task management')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('任务管理')).not.toBeInTheDocument();});it('keeps the current project selected while editing a new schedule', async () => {@@ -2146,19 +2146,19 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await waitFor(() => {expect(screen.getByRole('button', { name: 'customer-agent' })).toHaveAttribute('data-current-project', 'true');});await user.click(screen.getByRole('button', { name: '定时任务' }));- await user.click(await screen.findByRole('button', { name: /^Create$/ }));- expect(screen.getByRole('dialog', { name: 'Create scheduled task' })).toBeInTheDocument();+ await user.click(await screen.findByRole('button', { name: /^创建$/ }));+ expect(screen.getByRole('dialog', { name: '创建定时任务' })).toBeInTheDocument();expect(screen.getByRole('button', { name: 'customer-agent' })).toHaveAttribute('data-current-project', 'true');- expect(screen.getByRole('heading', { name: 'Select access permissions' })).toBeInTheDocument();+ expect(screen.getByRole('heading', { name: '请选择访问权限' })).toBeInTheDocument();expect(findPostCall(fetchCalls, '/threads')).toBeUndefined();- expect(within(screen.getByLabelText('customer-agent conversations')).queryByText('Task draft'))+ expect(within(screen.getByLabelText('customer-agent 对话')).queryByText('Task draft')).not.toBeInTheDocument();});@@ -2246,12 +2246,12 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '定时任务' }));- await user.click(await screen.findByRole('button', { name: /^Create$/ }));- expect(screen.getByRole('dialog', { name: 'Create scheduled task' })).toBeInTheDocument();+ await user.click(await screen.findByRole('button', { name: /^创建$/ }));+ expect(screen.getByRole('dialog', { name: '创建定时任务' })).toBeInTheDocument();expect(screen.getByRole('heading', { name: '每日文稿' })).toBeInTheDocument();- expect(screen.queryByLabelText('Task management')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('任务管理')).not.toBeInTheDocument();expect(scheduleListCalls).toBeGreaterThanOrEqual(2);});@@ -2311,7 +2311,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(runRequests).toEqual([]);await user.click(await screen.findByRole('button', { name: /会话 A/ }));@@ -2319,7 +2319,7 @@ describe('App', () => {expect(await screen.findByRole('button', { name: '停止任务' })).toBeInTheDocument();expect(screen.getByRole('textbox', { name: '输入任务' })).toBeEnabled();expect(screen.queryByRole('button', { name: '排队发送' })).not.toBeInTheDocument();- expect(screen.getByLabelText('Running')).toBeInTheDocument();+ expect(screen.getByLabelText('正在运行')).toBeInTheDocument();expect(runRequests).toEqual(['thread_a']);await user.click(await screen.findByRole('button', { name: /会话 B/ }));@@ -2408,7 +2408,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /队列会话/ }));const textbox = screen.getByRole('textbox', { name: '输入任务' });@@ -2507,7 +2507,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /会话 A/ }));await waitFor(() => {expect(screen.getByRole('textbox', { name: '输入任务' })).toBeEnabled();@@ -2526,7 +2526,7 @@ describe('App', () => {});expect(activeSubscription?.signal?.aborted).toBe(false);expect(screen.queryByText('切换前的实时进度')).not.toBeInTheDocument();- expect(screen.getByRole('button', { name: /会话 A.*Running/ })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: /会话 A.*正在运行/ })).toBeInTheDocument();await act(async () => {activeSubscription?.onEvent(@@ -2554,7 +2554,7 @@ describe('App', () => {});await waitFor(() => {- expect(screen.getByRole('button', { name: /会话 A/ })).not.toHaveAccessibleName(/Running/);+ expect(screen.getByRole('button', { name: /会话 A/ })).not.toHaveAccessibleName(/正在运行/);});expect(screen.queryByText('后台完成后的内容')).not.toBeInTheDocument();@@ -2624,7 +2624,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /会话 A/ }));await user.click(await screen.findByRole('button', { name: '停止任务' }));await user.click(screen.getByRole('button', { name: /会话 B/ }));@@ -2696,7 +2696,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /会话 A/ }));await user.click(await screen.findByRole('button', { name: '停止任务' }));@@ -2857,7 +2857,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /断线恢复会话/ }));await waitFor(() => expect(subscriptions).toHaveLength(2), { timeout: 2_000 });@@ -2920,7 +2920,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /会话 A/ }));await waitFor(() => {expect(screen.getByRole('textbox', { name: '输入任务' })).toBeEnabled();@@ -3029,7 +3029,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), '/');expect(await screen.findByRole('listbox', { name: '能力菜单' })).toBeInTheDocument();@@ -3112,7 +3112,7 @@ describe('App', () => {/>);- expect(await screen.findByLabelText('OpenCreator navigation')).toBeInTheDocument();+ expect(await screen.findByLabelText('OpenCreator 导航')).toBeInTheDocument();expect(screen.queryByText('登录即可享受云端协作')).not.toBeInTheDocument();expect(screen.queryByRole('button', { name: 'Sign in to' })).not.toBeInTheDocument();}@@ -3191,7 +3191,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await waitFor(() => expect(skillRequests).toBe(1));navigateToTestRoute('#/plugins');@@ -3304,7 +3304,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), '/');expect(await screen.findByRole('option', { name: /frontend-slides/ })).toBeInTheDocument();expect(screen.queryByRole('option', { name: /github/ })).not.toBeInTheDocument();@@ -3313,7 +3313,7 @@ describe('App', () => {navigateToTestRoute('#/plugins');await waitFor(() => expect(screen.getAllByTestId('skill-market-card')).toHaveLength(12));await showSkillMarketCard(user, 'frontend-slides');- const marketIssue = await findIssueByDescription('Could not load the skill marketplace. Try again.');+ const marketIssue = await findIssueByDescription('无法加载技能市场,请重试。');expect(marketIssue).not.toHaveTextContent(/诊断编号:OC-/);const card = getSkillMarketCard('frontend-slides');expect(within(card).queryByText('Unknown version')).not.toBeInTheDocument();@@ -3353,11 +3353,11 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await waitFor(() => expect(screen.getAllByTestId('skill-market-card')).toHaveLength(12));await showSkillMarketCard(user, 'frontend-slides');- const marketIssue = await findIssueByDescription('Could not load the skill marketplace. Try again.');+ const marketIssue = await findIssueByDescription('无法加载技能市场,请重试。');expect(marketIssue).not.toHaveTextContent(/诊断编号:OC-/);const action = within(getSkillMarketCard('frontend-slides')).getByRole('button', {name: '状态未知'@@ -3404,7 +3404,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');await waitFor(() => expect(within(getSkillMarketCard('frontend-slides')).getByRole('button', { name: '使用' })).toBeEnabled());@@ -3416,8 +3416,8 @@ describe('App', () => {await user.click(within(dialog).getByRole('button', { name: '使用' }));await user.click(screen.getByRole('button', { name: '在 content-design' }));- const useIssue = await findIssueByDescription('Could not use this skill. Try again.');- expect(useIssue).toHaveTextContent('Could not use this skill. Try again.');+ const useIssue = await findIssueByDescription('无法使用该技能,请重试。');+ expect(useIssue).toHaveTextContent('无法使用该技能,请重试。');expect(useIssue).not.toHaveTextContent(/诊断编号:OC-/);expect(screen.queryByText(/Create对话失败/)).not.toBeInTheDocument();await user.click(@@ -3479,7 +3479,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');await waitFor(() => expect(within(getSkillMarketCard('frontend-slides')).getByRole('button', { name: '使用' })).toBeEnabled());@@ -3585,7 +3585,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');await waitFor(() => expect(within(getSkillMarketCard('frontend-slides')).getByRole('button', { name: '安装' })).toBeEnabled());@@ -3666,7 +3666,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await waitFor(() => expect(skillRequests).toBe(1));navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');@@ -3724,12 +3724,12 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');await user.click(await within(getSkillMarketCard('frontend-slides')).findByRole('button', { name: '安装' }));- expect(await findIssueByDescription('Could not load the skill marketplace. Try again.')).not.toHaveTextContent(/诊断编号:OC-/);+ expect(await findIssueByDescription('无法加载技能市场,请重试。')).not.toHaveTextContent(/诊断编号:OC-/);expect(within(getSkillMarketCard('frontend-slides')).queryByText('Unknown version')).not.toBeInTheDocument();expect(within(getSkillMarketCard('frontend-slides')).getByRole('button', { name: '使用' })).toBeEnabled();expect(screen.queryByText('Installation failed. Try again.')).not.toBeInTheDocument();@@ -3788,12 +3788,12 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();navigateToTestRoute('#/plugins');await showSkillMarketCard(user, 'frontend-slides');await user.click(await within(getSkillMarketCard('frontend-slides')).findByRole('button', { name: '更新' }));- expect(await findIssueByDescription('Could not load the skill marketplace. Try again.')).not.toHaveTextContent(/诊断编号:OC-/);+ expect(await findIssueByDescription('无法加载技能市场,请重试。')).not.toHaveTextContent(/诊断编号:OC-/);const action = within(getSkillMarketCard('frontend-slides')).getByRole('button', {name: '状态未知'});@@ -3874,7 +3874,7 @@ describe('App', () => {</StrictMode>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(screen.queryByText('codex-cli test')).not.toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);@@ -4004,13 +4004,13 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));- expect(await screen.findByText('Allow OpenCreator to run this command?')).toBeInTheDocument();+ expect(await screen.findByText('允许 OpenCreator 执行这条命令?')).toBeInTheDocument();expect(document.querySelector('.composer-approval-overlay')).toBeInTheDocument();- await user.click(screen.getByText('View operation details'));+ await user.click(screen.getByText('查看操作详情'));expect(screen.getByText('rm -rf build')).toBeInTheDocument();const timelineScroller = screen.getByTestId('virtuoso-scroller');const composerWrap = document.querySelector<HTMLElement>('.composer-wrap');@@ -4029,11 +4029,11 @@ describe('App', () => {fireEvent.wheel(composerInput, { deltaY: 80 });expect(timelineScroller.scrollTop).toBe(160);- await user.click(screen.getByRole('button', { name: 'Allow once' }));+ await user.click(screen.getByRole('button', { name: '允许一次' }));await waitFor(() => {expect(screen.queryByText('rm -rf build')).not.toBeInTheDocument();- expect(screen.queryByRole('button', { name: 'Allow once' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: '允许一次' })).not.toBeInTheDocument();});expect(fetchCalls.some(call => (call.url.endsWith('/approvals/approval_1/approve')@@ -4089,7 +4089,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -4103,7 +4103,7 @@ describe('App', () => {await user.click(screen.getByText(/^(?:已完成|已处理 .+)$/));- expect(screen.queryByText('Run details')).not.toBeInTheDocument();+ expect(screen.queryByText('运行详情')).not.toBeInTheDocument();expect(screen.queryByText('queued')).not.toBeInTheDocument();expect(screen.queryByText('running')).not.toBeInTheDocument();expect(screen.queryByText('finalizing')).not.toBeInTheDocument();@@ -4161,7 +4161,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -4231,7 +4231,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -4273,7 +4273,7 @@ describe('App', () => {await Promise.resolve();});- expect(await screen.findByText('Run canceled: Canceled by user')).toBeInTheDocument();+ expect(await screen.findByText('运行已取消:用户已取消')).toBeInTheDocument();expect(screen.getByRole('textbox', { name: '输入任务' })).toBeEnabled();expect(screen.queryByRole('button', { name: '停止任务' })).not.toBeInTheDocument();});@@ -4358,7 +4358,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -4371,7 +4371,7 @@ describe('App', () => {expect(screen.getByText('我会先确认当前目录,再读取必要文件。')).toBeInTheDocument();expect(screen.queryByText('Running: Read project files')).not.toBeInTheDocument();expect(screen.queryByText('pwd')).not.toBeInTheDocument();- expect(screen.getByText('Read files')).toBeInTheDocument();+ expect(screen.getByText('已读取文件')).toBeInTheDocument();expect(screen.queryByText('工具完成 call_1')).not.toBeInTheDocument();expect(screen.getByText('当前目录是 /repo,检查已完成。')).toBeInTheDocument();expect(container.querySelectorAll('.timeline-assistant_message')).toHaveLength(1);@@ -4428,9 +4428,9 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: '整理本周项目进展 4d ago' }));+ await user.click(screen.getByRole('button', { name: '整理本周项目进展 4天' }));expect(await screen.findByRole('heading', { name: '整理本周项目进展' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);@@ -4439,7 +4439,7 @@ describe('App', () => {expect(await findTimelineUserMessage(prompt)).toBeInTheDocument();expect(await screen.findByText('周报已整理。')).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'New conversation in content-design' }));+ await user.click(screen.getByRole('button', { name: '在 content-design 中新建会话' }));expect(screen.queryByRole('heading', { name: 'New conversation' })).not.toBeInTheDocument();expect(screen.getByText('需要帮你做点什么')).toBeInTheDocument();@@ -4547,7 +4547,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: '默认项目' })).toHaveAttribute('data-current-project', 'true');await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);@@ -4600,7 +4600,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(screen.getByRole('button', { name: /Playground 历史会话/ })).toBeInTheDocument();expect(screen.queryByRole('button', { name: 'playground' })).not.toBeInTheDocument();@@ -4660,7 +4660,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', {name: new RegExp(`^${hostKind} 归档会话 `)}));@@ -4668,9 +4668,9 @@ describe('App', () => {const conversation = screen.getByRole('group', {name: `${hostKind} 归档会话`});- await user.click(within(conversation).getByRole('button', { name: 'Archive' }));- const archiveDialog = screen.getByRole('alertdialog', { name: 'Archive conversation' });- await user.click(within(archiveDialog).getByRole('button', { name: 'Archive' }));+ await user.click(within(conversation).getByRole('button', { name: '归档' }));+ const archiveDialog = screen.getByRole('alertdialog', { name: '归档对话' });+ await user.click(within(archiveDialog).getByRole('button', { name: '归档' }));await waitFor(() => {expect(screen.queryByRole('button', {@@ -4717,9 +4717,9 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: 'legacy-project' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Manage projects' }));+ await user.click(screen.getByRole('button', { name: '管理项目' }));await user.click(await screen.findByRole('button', { name: '使用现有文件夹' }));expect(hostBridge.selectProjectDirectory).toHaveBeenCalledTimes(1);await waitFor(() => {@@ -4733,9 +4733,9 @@ describe('App', () => {expect(findPostCall(fetchCalls, '/projects')).toBeDefined();expect(window.localStorage.getItem(PROJECTS_STORAGE_KEY)).toBe(legacyProjects);- await user.click(screen.getByRole('button', { name: 'Project actions 官网资料' }));- await user.click(screen.getByRole('menuitem', { name: 'Remove project 官网资料' }));- await user.click(screen.getByRole('button', { name: 'Remove project' }));+ await user.click(screen.getByRole('button', { name: '项目操作 官网资料' }));+ await user.click(screen.getByRole('menuitem', { name: '移除项目 官网资料' }));+ await user.click(screen.getByRole('button', { name: '移除项目' }));await waitFor(() => {expect(screen.queryByRole('button', { name: '官网资料' })).not.toBeInTheDocument();@@ -4776,10 +4776,10 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();- await user.click(await screen.findByRole('button', { name: 'Create project' }));+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();+ await user.click(await screen.findByRole('button', { name: '创建项目' }));- expect(screen.queryByRole('dialog', { name: 'Create project' })).not.toBeInTheDocument();+ expect(screen.queryByRole('dialog', { name: '创建项目' })).not.toBeInTheDocument();expect(await screen.findByRole('button', { name: '项目' })).toBeInTheDocument();const createCall = findPostCall(fetchCalls, '/projects/managed');@@ -4821,7 +4821,7 @@ describe('App', () => {expect(await screen.findByRole('heading', { name: '我的项目' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '新建项目' }));expect(screen.getByRole('menu', { name: '项目类型' })).toBeInTheDocument();- expect(screen.queryByRole('dialog', { name: 'Create project' })).not.toBeInTheDocument();+ expect(screen.queryByRole('dialog', { name: '创建项目' })).not.toBeInTheDocument();await user.click(screen.getByRole('menuitem', { name: /图像生成/ }));expect(await screen.findByRole(@@ -4866,21 +4866,21 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();const dropRoot = document.querySelector<HTMLElement>('[data-project-drop-root="true"]');if (dropRoot === null) throw new Error('Expected project drop root');const folder = new File([], 'dropped-project');const dataTransfer = createDirectoryDataTransfer(folder);fireEvent.dragEnter(dropRoot, { dataTransfer });- expect(screen.getByText('Drop to add a project folder')).toBeInTheDocument();+ expect(screen.getByText('松开以添加项目文件夹')).toBeInTheDocument();fireEvent.drop(dropRoot, { dataTransfer });expect(hostBridge.resolveDroppedFilePath).toHaveBeenCalledWith(folder);expect(await screen.findByRole('button', { name: 'dropped-project' })).toBeInTheDocument();expect(findPostCall(fetchCalls, '/projects')).toBeDefined();- expect(screen.queryByText('Drop to add a project folder')).not.toBeInTheDocument();+ expect(screen.queryByText('松开以添加项目文件夹')).not.toBeInTheDocument();});it('opens only one project directory picker while the previous request is pending', async () => {@@ -4917,8 +4917,8 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Manage projects' }));+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: '管理项目' }));await user.click(await screen.findByRole('button', { name: '使用现有文件夹' }));await user.click(screen.getByRole('button', { name: '使用现有文件夹' }));@@ -4964,9 +4964,9 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();- await user.click(await screen.findByRole('button', { name: 'Create project' }));- expect(screen.queryByRole('dialog', { name: 'Create project' })).not.toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();+ await user.click(await screen.findByRole('button', { name: '创建项目' }));+ expect(screen.queryByRole('dialog', { name: '创建项目' })).not.toBeInTheDocument();await waitFor(() => {expect(fetchCalls.map(call => [call.url, call.init?.method])).toContainEqual([@@ -4979,7 +4979,7 @@ describe('App', () => {expect(await screen.findByRole('button', { name: '项目' })).toHaveAttribute('data-current-project', 'true');- await user.click(screen.getByRole('button', { name: 'Manage projects' }));+ await user.click(screen.getByRole('button', { name: '管理项目' }));await user.click(await screen.findByRole('button', { name: '使用现有文件夹' }));expect(hostBridge.selectProjectDirectory).toHaveBeenCalledTimes(1);@@ -5038,7 +5038,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: /Playground 历史会话/ })).toBeInTheDocument();expect(screen.queryByRole('button', { name: 'thread_RwiAbzbZ8p' })).not.toBeInTheDocument();expect(screen.queryByRole('button', { name: 'thread_1Qm6X_K0eo' })).not.toBeInTheDocument();@@ -5120,7 +5120,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -5128,7 +5128,7 @@ describe('App', () => {expect(await findTimelineUserMessage(prompt)).toBeInTheDocument();expect(await screen.findByText('周报已整理。')).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'New conversation in secondary' }));+ await user.click(screen.getByRole('button', { name: '在 secondary 中新建会话' }));expect(screen.queryByRole('heading', { name: 'New conversation' })).not.toBeInTheDocument();expect(screen.getByText('需要帮你做点什么')).toBeInTheDocument();@@ -5246,13 +5246,13 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), '旧任务');await user.click(screen.getByRole('button', { name: '发送' }));await waitFor(() => expect(subscriptionSequence).toBe(1));- await user.click(screen.getByRole('button', { name: 'New conversation in secondary' }));+ await user.click(screen.getByRole('button', { name: '在 secondary 中新建会话' }));await user.type(screen.getByRole('textbox', { name: '输入任务' }), '新任务');await user.click(screen.getByRole('button', { name: '发送' }));await waitFor(() => expect(subscriptionSequence).toBe(2));@@ -5347,7 +5347,7 @@ describe('App', () => {const firstRender = render(<App {...appProps} />);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: 'bili' }));await user.click(await screen.findByRole('button', { name: /bili 历史/ }));expect(await findTimelineUserMessage('刷新后仍然打开这条对话')).toBeInTheDocument();@@ -5470,9 +5470,9 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: /真实 Codex 历史会话/ })).toBeInTheDocument();- expect(screen.queryByRole('button', { name: '整理本周项目进展 4d ago' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: '整理本周项目进展 4天' })).not.toBeInTheDocument();});it('loads task summaries without preloading task history or listing task threads as conversations', async () => {@@ -5542,11 +5542,11 @@ describe('App', () => {/>);- const conversationList = await screen.findByLabelText('content-design conversations');- const taskList = await screen.findByLabelText('Task conversations');+ const conversationList = await screen.findByLabelText('content-design 对话');+ const taskList = await screen.findByLabelText('任务会话');expect(within(conversationList).getByRole('button', { name: /普通会话/ })).toBeInTheDocument();- expect(within(taskList).getByRole('button', { name: /任务草稿.*Draft/ }))+ expect(within(taskList).getByRole('button', { name: /任务草稿.*草稿/ })).toHaveClass('sidebar-task-row');expect(within(conversationList).queryByText('Task draft')).not.toBeInTheDocument();@@ -5653,8 +5653,8 @@ describe('App', () => {/>);- const conversationList = await screen.findByLabelText('content-design conversations');- const taskList = await screen.findByLabelText('Task conversations');+ const conversationList = await screen.findByLabelText('content-design 对话');+ const taskList = await screen.findByLabelText('任务会话');await user.click(within(conversationList).getByRole('button', { name: /普通会话/ }));expect(await screen.findByText('旧会话内容')).toBeInTheDocument();@@ -5736,7 +5736,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /真实 Codex 历史会话/ }));expect(await findTimelineUserMessage('分析这个 skill 是干什么的')).toBeInTheDocument();@@ -5748,7 +5748,7 @@ describe('App', () => {expect(screen.getByText('先读取 skill 说明。')).toBeInTheDocument();expect(screen.getByText('这个 skill 用于分析选品资料。')).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Edit message' }));+ await user.click(screen.getByRole('button', { name: '编辑消息' }));expect(screen.getByRole('textbox', { name: '输入任务' })).toHaveValue('分析这个 skill 是干什么的');@@ -5837,7 +5837,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /分页历史会话/ }));expect(await screen.findByText('最新一页内容')).toBeInTheDocument();@@ -5847,7 +5847,7 @@ describe('App', () => {'http://127.0.0.1:60764/threads/thread_paged_history/history?limit=50']);- await user.click(screen.getByRole('button', { name: 'Load earlier history' }));+ await user.click(screen.getByRole('button', { name: '加载更早记录' }));expect(await findTimelineUserMessage('更早的一页内容')).toBeInTheDocument();expect(document.querySelectorAll('.timeline-user_message')).toHaveLength(2);@@ -5968,13 +5968,13 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /无 Turn ID 的分页会话/ }));await user.click(await screen.findByText(/^(?:已完成|已处理 .+)$/));expect(screen.getByText('当前任务的处理过程')).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Load earlier history' }));+ await user.click(screen.getByRole('button', { name: '加载更早记录' }));expect(await findTimelineUserMessage('更早的任务')).toBeInTheDocument();expect(screen.getByText('当前任务的处理过程')).toBeInTheDocument();@@ -6037,7 +6037,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /刚生成的内容/ }));expect(await findTimelineUserMessage('帮我生成视频脚本')).toBeInTheDocument();@@ -6135,7 +6135,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(await screen.findByRole('searchbox', { name: '搜索会话' }), 'App.tsx');const result = await screen.findByTestId('search-result-title');await user.click(within(result).getByRole('button'));@@ -6207,7 +6207,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();const conversationButton = await screen.findByRole('button', { name: /当前打开的历史/ });await user.click(conversationButton);@@ -6294,7 +6294,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /content-design 历史/ }));expect(await findTimelineUserMessage('上一条会话内容保持可见')).toBeInTheDocument();@@ -6422,20 +6422,20 @@ describe('App', () => {);await user.click(await screen.findByRole('button', { name: /真实文件会话/ }));- await user.click(screen.getByRole('button', { name: 'Files' }));+ await user.click(screen.getByRole('button', { name: '文件' }));- expect(await screen.findByLabelText('Conversation and file workspace')).toBeInTheDocument();- expect(screen.getByRole('button', { name: 'Files' })).toHaveAttribute('aria-pressed', 'true');+ expect(await screen.findByLabelText('会话和文件工作区')).toBeInTheDocument();+ expect(screen.getByRole('button', { name: '文件' })).toHaveAttribute('aria-pressed', 'true');expect(screen.getByRole('heading', { name: '真实文件会话' })).toBeInTheDocument();expect(await screen.findByRole('heading', { name: 'Workspace' })).toBeInTheDocument();expect(screen.queryByText('Open file')).not.toBeInTheDocument();expect(screen.queryByRole('button', { name: '返回对话' })).not.toBeInTheDocument();expect(screen.queryByText('No preview available')).not.toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Files' }));+ await user.click(screen.getByRole('button', { name: '文件' }));- expect(screen.queryByLabelText('Conversation and file workspace')).not.toBeInTheDocument();- expect(screen.getByRole('button', { name: 'Files' })).toHaveAttribute('aria-pressed', 'false');+ expect(screen.queryByLabelText('会话和文件工作区')).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: '文件' })).toHaveAttribute('aria-pressed', 'false');});it('点击聊天回复中的成果卡片会直接打开对应文件', async () => {@@ -6574,10 +6574,10 @@ describe('App', () => {);await user.click(await screen.findByRole('button', { name: /真实文件会话/ }));- await user.click(await screen.findByRole('button', { name: `Open output ${absoluteChangedPath}` }));+ await user.click(await screen.findByRole('button', { name: `打开成果 ${absoluteChangedPath}` }));- expect(await screen.findByLabelText('Conversation and file workspace')).toBeInTheDocument();- expect(await screen.findByTitle('xiaodoujia-apple-aso-audit.html HTML preview')).toBeInTheDocument();+ expect(await screen.findByLabelText('会话和文件工作区')).toBeInTheDocument();+ expect(await screen.findByTitle('xiaodoujia-apple-aso-audit.html HTML 预览')).toBeInTheDocument();expect(screen.queryByText('Select a file')).not.toBeInTheDocument();expect(screen.queryByText('Edited docs/atoms.md')).not.toBeInTheDocument();expect(@@ -6697,16 +6697,16 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();- const navigation = screen.getByLabelText('OpenCreator navigation');+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();+ const navigation = screen.getByLabelText('OpenCreator 导航');expect(navigation).toHaveAttribute('data-collapsed', 'false');await user.click(await screen.findByRole('button', { name: /真实文件会话/ }));- await user.click(screen.getByRole('button', { name: 'Files' }));+ await user.click(screen.getByRole('button', { name: '文件' }));await screen.findByRole('heading', { name: 'Workspace' });expect(navigation).toHaveAttribute('data-collapsed', 'true');expect(screen.getByRole('button', { name: '侧栏已自动收起' })).toBeInTheDocument();- const layout = screen.getByLabelText('Conversation and file workspace');+ const layout = screen.getByLabelText('会话和文件工作区');vi.spyOn(layout, 'getBoundingClientRect').mockReturnValue({x: 0,y: 0,@@ -6719,7 +6719,7 @@ describe('App', () => {toJSON: () => undefined});- const separator = screen.getByRole('separator', { name: 'Resize the conversation and file areas' });+ const separator = screen.getByRole('separator', { name: '调整会话和文件区域宽度' });fireEvent.mouseDown(separator, { button: 0, clientX: 420 });expect(document.querySelector('.pane-resize-shield')).not.toBeNull();fireEvent.mouseMove(window, { clientX: 520 });@@ -6734,7 +6734,7 @@ describe('App', () => {expect(layout).toHaveStyle({ '--conversation-pane-width': '914px' });- await user.click(screen.getByRole('button', { name: 'Close file workspace' }));+ await user.click(screen.getByRole('button', { name: '关闭文件工作区' }));expect(navigation).toHaveAttribute('data-collapsed', 'false');});@@ -6861,22 +6861,22 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /文件会话 A/ }));- await user.click(screen.getByRole('button', { name: 'Files' }));+ await user.click(screen.getByRole('button', { name: '文件' }));expect(await screen.findByRole('heading', { name: 'A.md' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: /文件会话 B/ }));- expect(screen.getByLabelText('Conversation and file workspace')).toBeInTheDocument();+ expect(screen.getByLabelText('会话和文件工作区')).toBeInTheDocument();expect(await screen.findByRole('heading', { name: 'B.md' })).toBeInTheDocument();await user.click(screen.getByRole('button', { name: /空文件会话/ }));await waitFor(() => {- expect(screen.queryByLabelText('Conversation and file workspace')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('会话和文件工作区')).not.toBeInTheDocument();});await user.click(screen.getByRole('button', { name: /文件会话 A/ }));- expect(screen.queryByLabelText('Conversation and file workspace')).not.toBeInTheDocument();+ expect(screen.queryByLabelText('会话和文件工作区')).not.toBeInTheDocument();});@@ -7000,13 +7000,13 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /只读文件会话/ }));- await user.click(screen.getByRole('button', { name: 'Files' }));+ await user.click(screen.getByRole('button', { name: '文件' }));- expect(await screen.findByText('This conversation is read-only. Files cannot be saved.')).toBeInTheDocument();+ expect(await screen.findByText('当前会话为只读模式,不能保存文件')).toBeInTheDocument();expect(await screen.findByRole('heading', { name: 'Workspace' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Edit' }));+ await user.click(screen.getByRole('button', { name: '编辑' }));expect(await screen.findByRole('textbox', { name: 'README.md editor' })).toHaveAttribute('aria-readonly', 'true');await user.click(screen.getByRole('button', { name: '选择访问权限 请求批准' }));@@ -7016,9 +7016,9 @@ describe('App', () => {await waitFor(() => {expect(findPatchCall(fetchCalls, '/threads/thread_files')).toBeDefined();});- expect(screen.queryByText('This conversation is read-only. Files cannot be saved.')).not.toBeInTheDocument();+ expect(screen.queryByText('当前会话为只读模式,不能保存文件')).not.toBeInTheDocument();expect(await screen.findByRole('heading', { name: 'Workspace' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Edit' }));+ await user.click(screen.getByRole('button', { name: '编辑' }));expect(await screen.findByRole('textbox', { name: 'README.md editor' })).toHaveAttribute('aria-readonly', 'false');});@@ -7121,7 +7121,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /真实文件会话/ }));expect(screen.queryByRole('button', { name: 'details' })).not.toBeInTheDocument();@@ -7131,8 +7131,8 @@ describe('App', () => {expect(screen.queryByText('No preview available')).not.toBeInTheDocument();expect(screen.queryByText('Open file')).not.toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Files' }));- expect(screen.getByLabelText('Conversation and file workspace')).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: '文件' }));+ expect(screen.getByLabelText('会话和文件工作区')).toBeInTheDocument();expect(screen.getByRole('heading', { name: '真实文件会话' })).toBeInTheDocument();expect(await screen.findByRole('heading', { name: 'Workspace' })).toBeInTheDocument();expect(screen.queryByText('Open file')).not.toBeInTheDocument();@@ -7193,7 +7193,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: 'content-design' })).toHaveAttribute('data-current-project', 'true');expect(screen.queryByRole('button', { name: '本机目录' })).not.toBeInTheDocument();expect(screen.queryByRole('button', { name: 'opencreator-agent' })).not.toBeInTheDocument();@@ -7238,7 +7238,7 @@ describe('App', () => {expect(screen.getByRole('button', { name: '选择模型 Cached GPT' })).toBeInTheDocument();- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' }))+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();modelResponse.resolve(jsonResponse(liveCatalog));@@ -7280,14 +7280,14 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' }))+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();const modelButton = await screen.findByRole('button', {name: '选择模型 Cached GPT'});await user.click(modelButton);- expect(await screen.findByText('Could not refresh the model catalog. Using the local cache.'))+ expect(await screen.findByText('模型目录刷新失败,当前使用本地缓存')).toBeInTheDocument();expect(screen.queryByText('暂无可用模型')).not.toBeInTheDocument();});@@ -7329,7 +7329,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' }))+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', {name: '选择模型 默认模型'@@ -7387,7 +7387,7 @@ describe('App', () => {expect(composer).toBeDisabled();await waitFor(() => expect(composer).toBeEnabled(), { timeout: 4_000 });expect(threadListCalls).toBe(2);- expect(screen.getByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(screen.getByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(screen.queryByRole('button', { name: '重试连接' })).not.toBeInTheDocument();});@@ -7420,7 +7420,7 @@ describe('App', () => {render(<App fileService={createFileService()} hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);await waitFor(() => expect(migrationCalls).toBe(1));- await screen.findByRole('status', { name: 'The local Runtime is ready' }, { timeout: 4_000 });+ await screen.findByRole('status', { name: '本地运行内核正常' }, { timeout: 4_000 });expect(migrationCalls).toBe(2);expect(screen.getByRole('textbox', { name: '输入任务' })).toBeEnabled();});@@ -7497,7 +7497,7 @@ describe('App', () => {};render(<App fileService={createFileService()} hostBridge={hostBridge} runtimeFetch={runtimeFetch} />);- await screen.findByRole('status', { name: 'The local Runtime is ready' });+ await screen.findByRole('status', { name: '本地运行内核正常' });const conversation = await screen.findByRole('button', { name: /保留的会话/ });fireEvent.click(conversation);const composer = await screen.findByRole('textbox', { name: '输入任务' });@@ -7511,7 +7511,7 @@ describe('App', () => {await waitFor(() => expect(failedHealthChecks).toBeGreaterThan(0));available = true;- await waitFor(() => expect(screen.getByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument(), {+ await waitFor(() => expect(screen.getByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument(), {timeout: 4_000});expect(screen.getByRole('textbox', { name: '输入任务' })).toHaveValue('恢复后继续这段草稿');@@ -7551,7 +7551,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' }))+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(await screen.findByRole('button', { name: '选择模型 GPT-5.5' })).toBeInTheDocument();@@ -7658,7 +7658,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.type(screen.getByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));@@ -7749,7 +7749,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();expect(screen.queryByRole('button', { name: /Profile/ })).not.toBeInTheDocument();await user.click(screen.getByRole('button', { name: '选择访问权限 请求批准' }));@@ -7834,7 +7834,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /已有会话/ }));await user.click(await screen.findByRole('button', {name: '选择模型 GPT-5.6 Sol'@@ -8033,7 +8033,7 @@ describe('App', () => {};const firstRender = render(<App {...appProps} />);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: 'secondary' }));expect(screen.getByRole('button', { name: '选择访问权限 完全访问权限' })).toBeInTheDocument();@@ -8210,7 +8210,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /运行中的权限会话/ }));const permissionButton = await screen.findByRole('button', {@@ -8274,7 +8274,7 @@ describe('App', () => {/>);- expect(await screen.findByRole('status', { name: 'The local Runtime is ready' })).toBeInTheDocument();+ expect(await screen.findByRole('status', { name: '本地运行内核正常' })).toBeInTheDocument();await user.click(await screen.findByRole('button', { name: /权限切换竞争/ }));await user.click(await screen.findByRole('button', {name: '选择访问权限 请求批准'@@ -8282,8 +8282,8 @@ describe('App', () => {await user.click(screen.getByRole('menuitemradio', { name: /完全访问权限/ }));await user.click(screen.getByRole('button', { name: '开启' }));- const permissionIssue = await findIssueByDescription('Conversation settings were not updated. Try again.');- expect(permissionIssue).toHaveTextContent('Conversation settings were not updated. Try again.');+ const permissionIssue = await findIssueByDescription('会话配置未更新,请重试。');+ expect(permissionIssue).toHaveTextContent('会话配置未更新,请重试。');expect(permissionIssue).not.toHaveTextContent(/诊断编号:OC-/);expect(permissionIssue).not.toHaveTextContent('Thread has active run');expect(screen.getByRole('button', { name: '选择访问权限 请求批准' }))@@ -8431,14 +8431,14 @@ describe('App', () => {await user.click(screen.getByRole('button', { name: '设置' }));await user.click(await screen.findByRole('button', { name: '记忆' }));expect(await screen.findByText('提交前运行全部测试')).toBeInTheDocument();- expect(screen.getByText('Version 1')).toBeInTheDocument();+ expect(screen.getByText('版本 1')).toBeInTheDocument();await user.click(screen.getByRole('button', { name: '返回应用' }));const prompt = '以后默认运行全量测试';await user.type(await screen.findByRole('textbox', { name: '输入任务' }), prompt);await user.click(screen.getByRole('button', { name: '发送' }));- expect(await screen.findByRole('region', { name: 'Memory suggestion' })).toBeInTheDocument();- await user.click(screen.getByRole('button', { name: 'Dismiss memory suggestion' }));+ expect(await screen.findByRole('region', { name: '记忆建议' })).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: '忽略记忆建议' }));expect(fetchCalls.some(call => (call.url.endsWith('/memories') && call.init?.method === 'POST'))).toBe(false);@@ -9241,13 +9241,17 @@ async function findTimelineUserMessage(text: string) {}async function findIssueByDescription(description: string | RegExp): Promise<HTMLElement> {- const message = await screen.findByText((content, element) => (- element !== null- && element.closest('[data-issue-id]') !== null- && (typeof description === 'string'- ? content.includes(description)- : description.test(content))- ));+ const message = await waitFor(() => {+ const trigger = screen.queryByRole('button', { name: '打开 Agent 诊断' });+ if (trigger !== null) fireEvent.click(trigger);+ return screen.getByText((content, element) => (+ element !== null+ && element.closest('[data-issue-id]') !== null+ && (typeof description === 'string'+ ? content.includes(description)+ : description.test(content))+ ));+ });const issue = message.closest<HTMLElement>('[data-issue-id]');if (issue === null) throw new Error(`Expected issue for description: ${String(description)}`);return issue;diff --git a/apps/web/src/app/use-runtime-dependencies.test.tsx b/apps/web/src/app/use-runtime-dependencies.test.tsxindex 9891a199..8c2eb0b7 100644--- a/apps/web/src/app/use-runtime-dependencies.test.tsx+++ b/apps/web/src/app/use-runtime-dependencies.test.tsx@@ -113,7 +113,7 @@ describe('useRuntimeDependencies', () => {expect(result.current.issues?.[0]).toMatchObject({code: 'creator_yt_dlp_update_download_failed',operation: 'runtime.update-yt-dlp',- fallbackMessage: '运行组件更新失败,请检查网络和磁盘空间后重试。'+ fallbackMessage: 'Runtime component update failed. Check the network and disk space before retrying.'});expect(result.current.issues?.[0]?.diagnosticId).toMatch(/^OC-/);});diff --git a/apps/web/src/features/dashboard/DashboardPage.test.tsx b/apps/web/src/features/dashboard/DashboardPage.test.tsxindex ed8d2859..84e90b56 100644--- a/apps/web/src/features/dashboard/DashboardPage.test.tsx+++ b/apps/web/src/features/dashboard/DashboardPage.test.tsx@@ -9,7 +9,7 @@ import {type CreatorResultSnapshot} from '@opencreator/protocol';import type { ComponentProps } from 'react';-import { describe, expect, it, vi } from 'vitest';+import { afterEach, describe, expect, it, vi } from 'vitest';import { LanguageProvider } from '../../i18n/LanguageProvider.js';import { ApiClientError } from '../../runtime/errors.js';import type { CreatorServicesSettingsService } from '../../services/creator-services-service.js';@@ -34,6 +34,22 @@ function openBlankWorkspace(moduleName: string, _blankName: string) {}));}+afterEach(() => vi.unstubAllGlobals());++function createSubtitlePreviewService() {+ class PreviewURL extends URL {+ static createObjectURL = vi.fn(() => 'blob:subtitle-preview');+ static revokeObjectURL = vi.fn();+ }+ vi.stubGlobal('URL', PreviewURL);+ return {+ ...createInMemoryCreatorService(),+ openSubtitlePreview: vi.fn(async () => new Response(new Blob(['png'], { type: 'image/png' }), {+ headers: { 'content-type': 'image/png' }+ }))+ };+}+describe('Creator initial session recovery', () => {it('automatically opens an existing project after the first snapshot fails', async () => {const service = createInMemoryCreatorService();@@ -976,9 +992,11 @@ describe('DashboardPage', () => {it('opens the video translation workspace and keeps its result in place', async () => {const onSelectPrompt = vi.fn();+ const creatorService = createSubtitlePreviewService();render(<DashboardPageonSelectPrompt={onSelectPrompt}+ creatorService={creatorService}videoMetadataService={{getVideoMetadata: vi.fn(async () => ({platform: 'youtube' as const,@@ -1024,10 +1042,14 @@ describe('DashboardPage', () => {fireEvent.click(screen.getByRole('button', { name: '#FFE45C' }));fireEvent.keyDown(screen.getByRole('button', { name: '#FFE45C' }), { key: 'Escape' });const subtitlePreview = screen.getByRole('region', { name: '字幕样式预览' });- expect(subtitlePreview).toHaveTextContent('这是一段译文字幕');- expect(subtitlePreview).toHaveTextContent('这是一段原文字幕');- expect(subtitlePreview.querySelectorAll('[data-subtitle-kind]')[0]).toHaveAttribute('data-subtitle-kind', 'translation');- expect(subtitlePreview.querySelector(':scope > div')).toHaveStyle({ '--subtitle-preview-font-size': '18px' });+ expect(await within(subtitlePreview).findByRole('img', { name: '字幕样式预览' })).toHaveAttribute('src', 'blob:subtitle-preview');+ expect(creatorService.openSubtitlePreview).toHaveBeenLastCalledWith(expect.objectContaining({+ bilingual: true,+ subtitlePosition: 'top',+ translationText: '这是一段译文字幕',+ originalText: '这是一段原文字幕',+ subtitleStyle: expect.objectContaining({ fontPreset: 'rounded', fontSize: 'large', primaryColor: '#FFE45C' })+ }), { signal: expect.any(AbortSignal) });expect(screen.getByLabelText('任务摘要')).toHaveTextContent('English → 简体中文');expect(screen.getByLabelText('任务摘要')).toHaveTextContent('圆体 · 粗体 · 大 · #FFE45C');expect(screen.getByLabelText('任务摘要')).toHaveClass('video-translation-summary', 'creator-task-summary');@@ -1049,12 +1071,13 @@ describe('DashboardPage', () => {expect(screen.queryByRole('button', { name: '生成新版本' })).not.toBeInTheDocument();});- it('shows the translation steps and reopens completed steps', () => {- render(<DashboardPage onSelectPrompt={vi.fn()} />);+ it('shows the translation steps and reopens completed steps', async () => {+ const creatorService = createSubtitlePreviewService();+ render(<DashboardPage onSelectPrompt={vi.fn()} creatorService={creatorService} />);openBlankWorkspace('视频翻译', '空白视频翻译');const steps = screen.getByRole('navigation', { name: '翻译流程' });- expect(within(steps).getByRole('button', { name: '1 添加视频' })).toHaveAttribute('aria-current', 'step');+ expect(within(steps).getByRole('button', { name: '1 添加素材' })).toHaveAttribute('aria-current', 'step');expect(within(steps).getByRole('button', { name: '2 翻译设置' })).toBeDisabled();expect(within(steps).getByRole('button', { name: '3 视频与字幕' })).toBeDisabled();expect(within(steps).getAllByRole('button')).toHaveLength(3);@@ -1071,16 +1094,20 @@ describe('DashboardPage', () => {expect(within(screen.getByRole('region', { name: '视频翻译操作区' })).getByRole('button', { name: '开始翻译' })).toBeInTheDocument();fireEvent.click(screen.getByRole('switch', { name: '合成字幕视频' }));const bottomTranslationPreview = screen.getByRole('region', { name: '字幕样式预览' });- expect(bottomTranslationPreview.querySelectorAll('[data-subtitle-kind]')[0]).toHaveAttribute('data-subtitle-kind', 'original');- expect(bottomTranslationPreview.querySelectorAll('[data-subtitle-kind]')[1]).toHaveAttribute('data-subtitle-kind', 'translation');+ expect(await within(bottomTranslationPreview).findByRole('img', { name: '字幕样式预览' })).toBeVisible();+ expect(creatorService.openSubtitlePreview).toHaveBeenLastCalledWith(expect.objectContaining({+ bilingual: true, subtitlePosition: 'bottom'+ }), { signal: expect.any(AbortSignal) });expect(screen.getByRole('button', { name: '选择原文颜色' })).toBeInTheDocument();fireEvent.click(within(steps).getByRole('button', { name: /翻译设置$/ }));fireEvent.click(screen.getByRole('switch', { name: '双语字幕' }));fireEvent.click(within(steps).getByRole('button', { name: /视频与字幕$/ }));const translationOnlyPreview = screen.getByRole('region', { name: '字幕样式预览' });- expect(translationOnlyPreview.querySelector('[data-subtitle-kind="original"]')).not.toBeInTheDocument();- expect(translationOnlyPreview.querySelector('[data-subtitle-kind="translation"]')).toBeInTheDocument();+ expect(await within(translationOnlyPreview).findByRole('img', { name: '字幕样式预览' })).toBeVisible();+ expect(creatorService.openSubtitlePreview).toHaveBeenLastCalledWith(expect.objectContaining({+ bilingual: false, subtitlePosition: 'bottom'+ }), { signal: expect.any(AbortSignal) });expect(screen.queryByRole('button', { name: '选择原文颜色' })).not.toBeInTheDocument();expect(screen.getByRole('button', { name: '选择译文颜色' })).toBeInTheDocument();expect(screen.getByLabelText('任务摘要')).toBeInTheDocument();@@ -1157,7 +1184,7 @@ describe('DashboardPage', () => {fireEvent.change(screen.getByRole('textbox', { name: '视频链接' }), {target: { value: 'https://www.youtube.com/watch?v=download-test' }});- fireEvent.click(screen.getByRole('button', { name: '添加并解析' }));+ fireEvent.click(screen.getByRole('button', { name: '获取' }));await waitFor(() => expect(applyAction).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({action: 'run-stage', input: { stageId: 'probe' }@@ -1464,7 +1491,7 @@ describe('DashboardPage', () => {fireEvent.change(screen.getByRole('combobox', { name: '翻译为' }), {target: { value: 'ja' }});- fireEvent.click(screen.getByRole('button', { name: '添加视频' }));+ fireEvent.click(screen.getByRole('button', { name: '添加素材' }));fireEvent.click(screen.getByRole('button', { name: '清除当前视频来源' }));fireEvent.change(screen.getByRole('textbox', { name: '视频链接' }), {target: { value: 'https://www.youtube.com/watch?v=draft-source' }@@ -1479,7 +1506,7 @@ describe('DashboardPage', () => {fireEvent.click(screen.getByRole('tab', { name: '任务设置' }));fireEvent.click(screen.getByRole('button', { name: '调整设置' }));expect(screen.getByRole('combobox', { name: '翻译为' })).toHaveValue('ja');- fireEvent.click(screen.getByRole('button', { name: '添加视频' }));+ fireEvent.click(screen.getByRole('button', { name: '添加素材' }));expect(screen.getByRole('img', { name: 'YouTube 视频缩略图' })).toHaveAttribute('src','https://i.ytimg.com/vi/draft-source/hqdefault.jpg'@@ -1580,7 +1607,7 @@ describe('DashboardPage', () => {fireEvent.click(screen.getByRole('tab', { name: '任务设置' }));fireEvent.click(screen.getByRole('button', { name: '调整设置' }));- fireEvent.click(screen.getByRole('button', { name: '添加视频' }));+ fireEvent.click(screen.getByRole('button', { name: '添加素材' }));fireEvent.click(screen.getByRole('button', { name: '清除当前视频来源' }));fireEvent.change(screen.getByRole('textbox', { name: '视频链接' }), {target: { value: 'https://www.youtube.com/watch?v=source-v2' }diff --git a/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx b/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsxindex ca8a194e..587c1579 100644--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx@@ -356,7 +356,7 @@ describe('VideoTranslationWorkspace task controls', () => {fireEvent.click(screen.getByRole('button', { name: 'sv-SE' }));expect(screen.getByText('Det gick inte att starta förberedelsen av originalvideon. Kontrollera diagnostiken och försök igen.')).toBeVisible();expect(screen.getByRole('button', { name: 'Försök ladda ned originalvideon igen' })).toBeEnabled();- expect(screen.getByRole('textbox', { name: /subtitles 1$/ })).toHaveValue('保留未保存字幕');+ expect(screen.getByRole('textbox', { name: /undertexter 1$/ })).toHaveValue('保留未保存字幕');expect(screen.getByRole('button', { name: /V1/ })).toBeInTheDocument();expect(screen.getByText(raw)).not.toBeVisible();expect(applyAction).toHaveBeenCalledTimes(requestsBeforeSwitch);@@ -536,7 +536,7 @@ describe('VideoTranslationWorkspace task controls', () => {} })));expect(within(screen.getByRole('group', { name: '导入已有字幕' })).queryByRole('alert')).not.toBeInTheDocument();expect(screen.queryByText('Invalid UTF-8 SRT: timeline 2')).not.toBeInTheDocument();- expect(await screen.findByText(/操作未完成,请在 Agent 区域查看诊断。/)).toBeInTheDocument();+ expect(await screen.findByText(/操作未完成 错误码:CLIENT_OPERATION_FAILED/)).toBeVisible();expect(screen.queryByText(/诊断编号:OC-/)).not.toBeInTheDocument();expect(screen.getByLabelText('UTF-8 SRT 文件')).not.toBeDisabled();});diff --git a/apps/web/src/features/dashboard/dashboard-css.test.ts b/apps/web/src/features/dashboard/dashboard-css.test.tsindex 8c556869..9c0fa57b 100644--- a/apps/web/src/features/dashboard/dashboard-css.test.ts+++ b/apps/web/src/features/dashboard/dashboard-css.test.ts@@ -168,7 +168,8 @@ describe('dashboard CSS contracts', () => {});it('matches video download settings width to translation and centers labeled platforms', () => {- expect(cssBlocks('.video-download-workspace-page .creator-tool-stack')[0]).toContain('width: min(960px, 100%);');+ expect(cssBlocks('.creator-tool-stack')[0]).toContain('width: min(1120px, 100%);');+ expect(cssBlocks('.video-download-workspace-page .creator-workspace-layout')[0]).toContain('--creator-workspace-pane-width: calc(80% - 3.5px);');expect(cssBlocks('.video-download-platforms')[0]).toContain('justify-content: center;');expect(cssBlocks('.video-download-platforms')[0]).toContain('flex-wrap: wrap;');expect(cssBlocks('.video-download-platforms img')[0]).toContain('width: 32px;');diff --git a/apps/web/src/features/issues/page-issue-state.test.tsx b/apps/web/src/features/issues/page-issue-state.test.tsxindex 5c6a9476..23a9fa32 100644--- a/apps/web/src/features/issues/page-issue-state.test.tsx+++ b/apps/web/src/features/issues/page-issue-state.test.tsx@@ -31,7 +31,7 @@ describe('usePageIssueState', () => {}),'无法创建创作任务。');- expect(issue.fallbackMessage).toContain('模板版本 1 不受本地服务支持');+ expect(issue.fallbackMessage).toContain('does not support version 1 of the stickman-video template');expect(issue.code).toBe('creator_template_version_mismatch');expect(issue.fallbackMessage).not.toContain('Unknown creator template');});