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
Merge remote-tracking branch 'origin/feat-jx-dashboard' into develop
Leggett595e54201004
diff --cc apps/desktop/e2e/creator-packaged-app.spec.tsindex d426cda3,6fa87046..6d5cc14a--- a/apps/desktop/e2e/creator-packaged-app.spec.ts+++ b/apps/desktop/e2e/creator-packaged-app.spec.ts@@@ -37,7 -36,398 +37,398 @@@ const OVERSIZED_WAVE_PCM_BYTES = 10 * 1const OVERSIZED_WAVE_FILE_BYTES = OVERSIZED_WAVE_PCM_BYTES + 44;test.describe.configure({ mode: 'serial' });+ test('工作台与滚动中的项目页保持相同内容边界', async () => {+ const fixture = await launchCreatorDesktop({ width: 1273, height: 985 });+ try {+ await waitForWorkspace(fixture.app.page);+ const workbench = await fixture.app.page.locator('.creator-tools-page').evaluate(scroller => ({+ right: Math.round(scroller.querySelector('.creator-tools-page-inner')!.getBoundingClientRect().right),+ scrollable: scroller.scrollHeight > scroller.clientHeight,+ gutter: scroller.offsetWidth - scroller.clientWidth+ }));+ expect(workbench.scrollable).toBe(false);+ await fixture.app.page.getByRole('button', { name: '我的项目', exact: true }).click();+ await expect(fixture.app.page.locator('.projects-page-inner')).toBeVisible();+ const projects = await fixture.app.page.locator('.projects-page').evaluate(scroller => {+ const filler = document.createElement('div');+ filler.style.height = '1600px';+ scroller.querySelector('.projects-page-inner')!.append(filler);+ return {+ right: Math.round(scroller.querySelector('.projects-page-inner')!.getBoundingClientRect().right),+ scrollable: scroller.scrollHeight > scroller.clientHeight,+ gutter: scroller.offsetWidth - scroller.clientWidth+ };+ });+ expect(projects.scrollable).toBe(true);+ expect(projects.gutter).toBe(workbench.gutter);+ expect(projects.right).toBe(workbench.right);+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 的每个设置 Tab 与主页面保持相同右侧留白', async ({}, testInfo) => {+ const fixture = await launchCreatorDesktop({ width: 1181, height: 985 });+ try {+ await waitForWorkspace(fixture.app.page);+ await fixture.app.page.getByRole('button', { name: '设置', exact: true }).click();+ const nav = fixture.app.page.locator('.settings-nav > button');+ await expect(nav).toHaveCount(9);+ const boundsByTab = [];+ for (let index = 0; index < 9; index += 1) {+ await nav.nth(index).click();+ const section = fixture.app.page.locator('.settings-content > .settings-section');+ await expect(section).toBeVisible();+ const bounds = await section.evaluate(element => {+ const content = element.parentElement!;+ const sectionBox = element.getBoundingClientRect();+ const contentBox = content.getBoundingClientRect();+ return {+ left: Math.round(sectionBox.left - contentBox.left),+ right: Math.round(contentBox.right - sectionBox.right),+ gutter: content.offsetWidth - content.clientWidth,+ width: Math.round(sectionBox.width)+ };+ });+ expect(bounds.left, `Tab ${index + 1}`).toBe(24);+ expect(bounds.right - bounds.gutter, `Tab ${index + 1}`).toBe(24);+ boundsByTab.push(bounds);+ if (index < 2) {+ await fixture.app.page.screenshot({+ path: testInfo.outputPath(`settings-layout-${index + 1}.png`),+ animations: 'disabled'+ });+ }+ }+ expect(boundsByTab.every(bounds => JSON.stringify(bounds) === JSON.stringify(boundsByTab[0]))).toBe(true);+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 的浅色窗口按钮区域与设置侧栏连续且保留标题栏拖拽', async ({}, testInfo) => {+ test.skip(process.platform !== 'darwin', '仅 macOS 使用集成原生标题栏');+ const fixture = await launchCreatorDesktop({ width: 980, height: 800 });+ try {+ await waitForWorkspace(fixture.app.page);+ expect(await fixture.app.page.evaluate(() => (+ typeof window.opencreatorDesktop?.setWindowColorMode+ ))).toBe('function');+ await expect(fixture.app.page.getByRole('group', { name: '窗口控制' }).getByRole('button')).toHaveCount(3);+ for (const action of ['close', 'minimize', 'zoom']) {+ const background = await fixture.app.page.locator(`.desktop-window-control-${action}`).evaluate(element =>+ getComputedStyle(element).backgroundColor+ );+ expect(background).not.toBe('rgba(0, 0, 0, 0)');+ }+ await expect.poll(() => fixture.app.page.evaluate(() => {+ const brand = document.querySelector('.sidebar-logo-lockup')!.getBoundingClientRect();+ const title = document.querySelector('.creator-tools-page-header h1')!.getBoundingClientRect();+ return Math.round((brand.top + brand.bottom - title.top - title.bottom) / 2);+ })).toBeGreaterThanOrEqual(-3);+ expect(await fixture.app.page.evaluate(() => {+ const brand = document.querySelector('.sidebar-logo-lockup')!.getBoundingClientRect();+ const title = document.querySelector('.creator-tools-page-header h1')!.getBoundingClientRect();+ return Math.round((brand.top + brand.bottom - title.top - title.bottom) / 2);+ })).toBeLessThanOrEqual(3);+ await fixture.app.page.getByRole('button', { name: '缩放窗口' }).click();+ await expect.poll(() => fixture.app.page.evaluate(() => window.innerWidth)).toBeGreaterThan(980);+ await fixture.app.page.getByRole('button', { name: '缩放窗口' }).click();+ await expect.poll(() => fixture.app.page.evaluate(() => window.innerWidth)).toBe(980);+ await fixture.app.page.getByRole('button', { name: '我的项目', exact: true }).click();+ await expect(fixture.app.page.getByRole('heading', { name: '我的项目' })).toBeVisible();+ await expect.poll(() => fixture.app.page.evaluate(() => {+ const brand = document.querySelector('.sidebar-logo-lockup')!.getBoundingClientRect();+ const title = document.querySelector('.projects-page-header h1')!.getBoundingClientRect();+ return Math.abs(Math.round((brand.top + brand.bottom - title.top - title.bottom) / 2));+ })).toBeLessThanOrEqual(3);+ await fixture.app.page.screenshot({+ path: testInfo.outputPath('projects-titlebar.png'),+ animations: 'disabled'+ });+ await fixture.app.page.getByRole('button', { name: '设置', exact: true }).click();+ await expect(fixture.app.page.getByRole('button', { name: '返回应用' })).toBeVisible();++ for (const [theme, label] of [['light', '浅色'], ['dark', '深色']] as const) {+ await fixture.app.page.getByRole('button', { name: label, exact: true }).click();+ await expect(fixture.app.page.locator('html')).toHaveAttribute('data-theme', theme);+ expect(await fixture.app.page.evaluate(() => {+ const pane = document.querySelector('.opencreator-main-pane')!;+ const settings = document.querySelector('.settings-page')!;+ const sidebar = document.querySelector('.settings-sidebar')!;+ const back = document.querySelector('.settings-back')!;+ const drag = document.querySelector('.desktop-titlebar-drag-region')!;+ return {+ panePaddingTop: getComputedStyle(pane).paddingTop,+ sidebarTop: Math.round(sidebar.getBoundingClientRect().top - settings.getBoundingClientRect().top),+ sidebarPaddingTop: getComputedStyle(sidebar).paddingTop,+ backTop: Math.round(back.getBoundingClientRect().top - settings.getBoundingClientRect().top),+ dragHeight: Math.round(drag.getBoundingClientRect().height)+ };+ })).toEqual({+ panePaddingTop: '0px',+ sidebarTop: 0,+ sidebarPaddingTop: '51px',+ backTop: 51,+ dragHeight: 38+ });+ await fixture.app.page.screenshot({+ path: testInfo.outputPath(`settings-titlebar-${theme}.png`),+ animations: 'disabled'+ });+ }+ await fixture.app.page.getByRole('button', { name: '返回应用' }).click();+ await expect(fixture.app.page.getByRole('button', { name: '工作台' })).toBeVisible();+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 的黑白基准色固定且灰色不随强调色变化', async ({}, testInfo) => {+ const fixture = await launchCreatorDesktop({ width: 1280, height: 800 });+ try {+ await waitForWorkspace(fixture.app.page);+ for (const theme of ['dark', 'light'] as const) {+ const colors = [];+ for (const accent of ['red', 'blue', 'custom'] as const) {+ const values = await fixture.app.page.evaluate(({ theme, accent }) => {+ const root = document.documentElement;+ root.dataset.theme = theme;+ root.dataset.accent = accent;+ root.style.setProperty('--custom-accent-value', '#3b82f6');+ const surface = document.createElement('div');+ surface.style.backgroundColor = 'var(--surface-2)';+ document.body.append(surface);+ const result = {+ page: getComputedStyle(document.body).backgroundColor,+ text: getComputedStyle(document.body).color,+ sidebar: getComputedStyle(document.querySelector('.opencreator-sidebar-pane')!).backgroundColor,+ surface: getComputedStyle(surface).backgroundColor+ };+ surface.remove();+ return result;+ }, { theme, accent });+ expect(values.page).toBe(theme === 'dark' ? 'rgb(10, 10, 10)' : 'rgb(229, 229, 229)');+ expect(values.text).toBe(theme === 'dark' ? 'rgb(229, 229, 229)' : 'rgb(10, 10, 10)');+ colors.push(values);+ if (accent === 'red') {+ await fixture.app.page.screenshot({+ path: testInfo.outputPath(`accent-red-${theme}.png`),+ animations: 'disabled'+ });+ }+ }+ expect(colors[0]!.sidebar).toBe(colors[1]!.sidebar);+ expect(colors[0]!.surface).toBe(colors[1]!.surface);+ expect(colors[1]!.surface).toBe(colors[2]!.surface);+ }+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 导航和文章模板图标只保留外层容器', async ({}, testInfo) => {+ const fixture = await launchCreatorDesktop({ width: 1440, height: 900 });+ try {+ await waitForWorkspace(fixture.app.page);+ const sidebar = fixture.app.page.locator('.opencreator-sidebar');+ for (const collapsed of [false, true]) {+ if (collapsed) await sidebar.locator('.sidebar-collapse-button').click();+ await expect(sidebar).toHaveAttribute('data-collapsed', String(collapsed));+ for (const label of ['工作台', '我的项目', '设置']) {+ const button = sidebar.getByRole('button', { name: label, exact: true });+ await button.click();+ await expect(button).toHaveAttribute('aria-current', 'page');+ await button.hover();+ expect(await button.locator('.sidebar-nav-icon').evaluate(icon => {+ const style = getComputedStyle(icon);+ return { background: style.backgroundColor, border: style.borderTopWidth, shadow: style.boxShadow };+ })).toEqual({ background: 'rgba(0, 0, 0, 0)', border: '0px', shadow: 'none' });+ }+ await fixture.app.page.screenshot({ path: testInfo.outputPath(`single-nav-container-${collapsed}.png`) });+ }+ const projects = await runtimeRequest<{ projects: Array<{ id: string }> }>(fixture.app.page, 'GET', '/projects');+ const created = await runtimeRequest<{ job: { id: string } }>(fixture.app.page, 'POST', '/creator/jobs', {+ projectId: projects.body.projects[0]!.id,+ templateId: 'wechat-article',+ state: { currentStep: 1, furthestStep: 1 }+ });+ expect(created.status).toBe(201);+ await fixture.app.page.evaluate(jobId => {+ window.location.hash = `#/workbench?tool=wechat-article&jobId=${jobId}`;+ }, created.body.job.id);+ await expect(fixture.app.page.locator('.wechat-template-inline-list > button').first()).toBeVisible();+ await fixture.app.page.getByRole('button', { name: '查看全部模板', exact: true }).click();+ await expect(fixture.app.page.getByRole('dialog', { name: '文章模板库' })).toBeVisible();+ await fixture.app.page.locator('.wechat-template-grid > button').first().click();+ const icons = fixture.app.page.locator('.wechat-template-grid > button > span');+ expect(await icons.count()).toBeGreaterThan(0);+ for (const style of await icons.evaluateAll(icons => icons.map(icon => {+ const style = getComputedStyle(icon);+ return { background: style.backgroundColor, border: style.borderTopWidth, shadow: style.boxShadow };+ }))) {+ expect(style).toEqual({ background: 'rgba(0, 0, 0, 0)', border: '0px', shadow: 'none' });+ }+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 的 Creator 设置页保留组件间距和下拉箭头内边距', async ({}, testInfo) => {+ const fixture = await launchCreatorDesktop({ width: 980, height: 1014 });+ try {+ await waitForWorkspace(fixture.app.page);+ await expect.poll(async () => (+ await runtimeRequest<{ projects: Array<{ id: string }> }>(fixture.app.page, 'GET', '/projects')+ ).body.projects.length).toBeGreaterThan(0);+ const projects = await runtimeRequest<{ projects: Array<{ id: string }> }>(fixture.app.page, 'GET', '/projects');+ const created = await runtimeRequest<{ job: { id: string } }>(fixture.app.page, 'POST', '/creator/jobs', {+ projectId: projects.body.projects[0]!.id,+ templateId: 'stickman-video',+ state: { sourceType: 'url' }+ });+ expect(created.status).toBe(201);+ await fixture.app.page.evaluate(jobId => {+ window.location.hash = `#/workbench?tool=stickman-video&jobId=${jobId}`;+ }, created.body.job.id);+ await expect(fixture.app.page.locator('.stickman-style-summary')).toBeVisible();+ await expect.poll(() => fixture.app.page.locator('.stickman-story-panel').evaluate(panel => {+ const source = panel.querySelector(':scope > .creator-tool-field')!.getBoundingClientRect();+ const characters = panel.querySelector('.stickman-character-picker')!.getBoundingClientRect();+ const style = panel.querySelector('#stickman-visual-style')!.getBoundingClientRect();+ const duration = panel.querySelector('.stickman-duration-control select')!.getBoundingClientRect();+ return {+ sourceCharacterGap: Math.round(characters.top - source.bottom),+ selectTopDelta: Math.round(duration.top - style.top),+ arrowInsets: Array.from(panel.querySelectorAll('.native-select select')).map(select => (+ Math.round(select.getBoundingClientRect().right - select.parentElement!.querySelector('svg')!.getBoundingClientRect().right)+ )),+ textInsets: Array.from(panel.querySelectorAll('.native-select select')).map(select => getComputedStyle(select).paddingInlineEnd)+ };+ })).toEqual({ sourceCharacterGap: 16, selectTopDelta: 0, arrowInsets: [12, 12], textInsets: ['40px', '40px'] });+ await fixture.app.page.getByRole('combobox', { name: '目标时长' }).selectOption('60');+ await expect(fixture.app.page.getByRole('combobox', { name: '目标时长' })).toHaveValue('60');+ await fixture.app.page.locator('.creator-tool-form-row').scrollIntoViewIfNeeded();+ await fixture.app.page.screenshot({ path: testInfo.outputPath('creator-settings-spacing-980.png') });+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });++ test('打包 App 在最小窗口宽度下保持 Creator 对话输入区贴底', async ({}, testInfo) => {+ test.setTimeout(90_000);+ for (const height of [1014, 680]) {+ const fixture = await launchCreatorDesktop({ width: 980, height });+ try {+ await waitForWorkspace(fixture.app.page);+ await expect.poll(async () => (+ await runtimeRequest<{ projects: Array<{ id: string }> }>(+ fixture.app.page, 'GET', '/projects'+ )+ ).body.projects.length).toBeGreaterThan(0);+ const projects = await runtimeRequest<{ projects: Array<{ id: string }> }>(+ fixture.app.page, 'GET', '/projects'+ );+ expect(projects.status).toBe(200);+ expect(projects.body.projects.length).toBeGreaterThan(0);+ const created = await runtimeRequest<{ job: { id: string } }>(+ fixture.app.page, 'POST', '/creator/jobs', {+ projectId: projects.body.projects[0]!.id,+ templateId: 'stickman-video',+ state: { sourceType: 'text' }+ }+ );+ expect(created.status).toBe(201);+ await fixture.app.page.evaluate(jobId => {+ window.location.hash = `#/workbench?tool=stickman-video&jobId=${jobId}`;+ }, created.body.job.id);+ await expect(fixture.app.page.getByRole('heading', { name: '火柴人动画' })).toBeVisible();+ await expect(fixture.app.page.getByRole('textbox', { name: '告诉 Agent 你的要求' })).toBeVisible();+ await fixture.app.page.locator('.stickman-step-scroll').evaluate(element => {+ element.scrollTop = element.scrollHeight;+ });+ await expect.poll(() => fixture.app.page.evaluate(() => {+ const workspace = document.querySelector('.creator-workspace-layout')!.getBoundingClientRect();+ const main = document.querySelector('.creator-workspace-main')!.getBoundingClientRect();+ const panel = document.querySelector('.creator-collaboration-panel')!.getBoundingClientRect();+ const composer = document.querySelector('.creator-collaboration-panel .tool-agent-composer')!;+ return {+ width: window.innerWidth,+ panelRightOfMain: panel.left >= main.right - 1,+ panelVisible: panel.right <= window.innerWidth + 1,+ panelBottomDelta: Math.round(panel.bottom - window.innerHeight),+ panelHeightDelta: Math.round(panel.height - workspace.height),+ composerBottomDelta: Math.round(+ composer.getBoundingClientRect().bottom+ + parseFloat(getComputedStyle(composer).marginBottom) - panel.bottom+ )+ };+ })).toEqual({ width: 980, panelRightOfMain: true, panelVisible: true, panelBottomDelta: 0, panelHeightDelta: 0, composerBottomDelta: 0 });+ await fixture.app.page.screenshot({+ path: testInfo.outputPath(`creator-min-width-980-${height}.png`)+ });+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ }+ });++ test('打包 App 在窄窗口下各 Creator 内页保持对话栏在右侧', async ({}, testInfo) => {+ test.setTimeout(120_000);+ const fixture = await launchCreatorDesktop({ width: 980, height: 680 });+ try {+ await waitForWorkspace(fixture.app.page);+ await expect.poll(async () => (+ await runtimeRequest<{ projects: Array<{ id: string }> }>(fixture.app.page, 'GET', '/projects')+ ).body.projects.length).toBeGreaterThan(0);+ const projects = await runtimeRequest<{ projects: Array<{ id: string }> }>(+ fixture.app.page, 'GET', '/projects'+ );++ for (const [tool, templateId] of [+ ['video-translation', 'video-translation'],+ ['image-generation', 'image-generation'],+ ['cover-generator', 'cover'],+ ['video-generation', 'video-generation'],+ ['short-video-script', 'short-video-script']+ ] as const) {+ const created = await runtimeRequest<{ job: { id: string } }>(+ fixture.app.page, 'POST', '/creator/jobs', {+ projectId: projects.body.projects[0]!.id,+ templateId,+ state: {}+ }+ );+ expect(created.status).toBe(201);+ await fixture.app.page.evaluate(({ tool, jobId }) => {+ window.location.hash = `#/workbench?tool=${tool}&jobId=${jobId}`;+ }, { tool, jobId: created.body.job.id });+ await expect(fixture.app.page.locator('.creator-collaboration-panel')).toBeVisible();+ await expect.poll(() => fixture.app.page.evaluate(() => {+ const main = document.querySelector('.creator-workspace-main, .video-translation-wizard-main')!.getBoundingClientRect();+ const panel = document.querySelector('.creator-collaboration-panel')!.getBoundingClientRect();+ return {+ beside: panel.left >= main.right - 1,+ visible: panel.right <= window.innerWidth + 1,+ fullHeight: Math.abs(panel.bottom - window.innerHeight) <= 1+ };+ })).toEqual({ beside: true, visible: true, fullHeight: true });+ await fixture.app.page.screenshot({ path: testInfo.outputPath(`creator-right-panel-${tool}.png`) });+ }+ } finally {+ await closePackagedApp(fixture.app).catch(() => undefined);+ rmSync(fixture.root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });+ }+ });+-test('实际 Desktop 包创建并重启恢复 Creator Job,且使用内嵌 Runtime', async () => {+test('@package-smoke 实际 Desktop 包创建并重启恢复 Creator Job,且使用内嵌 Runtime', async () => {test.setTimeout(180_000);const fixture = await launchCreatorDesktop();let currentApp: PackagedApp = fixture.app;@@@ -366,14 -694,24 +757,32 @@@await clipWorkspace.getByRole('combobox', { name: '目标时长' }).selectOption('30-60');await clipWorkspace.getByRole('spinbutton', { name: '切片数量' }).fill('8');await clipWorkspace.getByRole('combobox', { name: '输出画幅' }).selectOption('9:16');+ await expect(clipWorkspace.getByRole('combobox', { name: '内容重点' }))+ .toHaveValue('knowledge');+ await expect(clipWorkspace.getByRole('combobox', { name: '目标时长' }))+ .toHaveValue('30-60');+ await expect(clipWorkspace.getByRole('spinbutton', { name: '切片数量' }))+ .toHaveValue('8');+ await expect(clipWorkspace.getByRole('combobox', { name: '输出画幅' }))+ .toHaveValue('9:16');+ await expect.poll(() => new URL(currentApp.page.url()).hash.match(/jobId=([^&]+)/)?.[1]).toBeTruthy();+ const clipJobId = new URL(currentApp.page.url()).hash.match(/jobId=([^&]+)/)?.[1];+ expect(clipJobId).toBeTruthy();+ await expect.poll(async () => (+ await runtimeRequest<{+ job: { state: Record<string, unknown> };+ }>(+ currentApp.page,+ 'GET',+ `/creator/jobs/${decodeURIComponent(clipJobId!)}`+ )+ ).body.job.state).toMatchObject({+ sourceUrl: 'https://example.com/watch/packaged-auto-clip',+ focus: 'knowledge',+ duration: '30-60',+ clipCount: 8,+ aspectRatio: '9:16'+ });const createdJob = await runtimeRequest<{job: { id: string; revision: number; state: Record<string, unknown> };diff --cc apps/web/e2e/support/fake-stickman-daemon.tsindex 6383f197,6383f197..d7ee5653--- a/apps/web/e2e/support/fake-stickman-daemon.ts+++ b/apps/web/e2e/support/fake-stickman-daemon.ts@@@ -151,6 -151,6 +151,14 @@@ export class FakeStickmanDaemon}]});}++ if (method === 'GET' && pathWithoutQuery === '/creator/presets') {++ const locale = url.searchParams.get('locale') === 'en-US' ? 'en-US' : 'zh-CN';++ return json(route, {++ locale,++ catalogHash: '0'.repeat(64),++ presets: []++ });++ }if (method === 'GET' && pathWithoutQuery === '/creator/visual-assets') {return json(route, { assets: fakeVisualAssets() });}diff --cc apps/web/e2e/web-desktop-parity.spec.tsindex 36d96438,94b49136..e1322b1d--- a/apps/web/e2e/web-desktop-parity.spec.ts+++ b/apps/web/e2e/web-desktop-parity.spec.ts@@@ -1,53 -1,567 +1,597 @@@-import type { CreatorYtDlpStatusResponse } from '@opencreator/protocol';+import type { CreatorServicesCapabilitiesResponse, CreatorYtDlpStatusResponse } from '@opencreator/protocol';import { test, expect } from './fixtures/runtime.js';-test('浅深色基准色与中性灰表面不随强调色变化且 Browser/Desktop 一致', async ({- browser,- runtime-}, testInfo) => {+test('Agent 面板在 Browser/Desktop Bridge 下均不显示产物版本详情', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '内部使用相同内容视口');+ const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId, templateId: 'image-generation', state: { prompt: 'Agent 面板验收', currentStep: 1, furthestStep: 1 }+ });+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1, reducedMotion: 'reduce' });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ try {+ await runtime.openApp(page);+ await page.goto(`${runtime.origin}/#/workbench?tool=image-generation&jobId=${created.job.id}`);+ await expect(page.getByText('当前任务', { exact: true })).toBeVisible();+ await expect(page.getByText('产物版本与来源', { exact: true })).toHaveCount(0);+ } finally { await context.close(); }+ }+});++test('本地字幕导入在 Browser/Desktop Bridge 下保持相同命令和界面', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop');+ const results: unknown[] = [];+ for (const platform of ['browser', 'desktop']) {+ const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId, templateId: 'video-translation',+ state: { sourceUrl: 'https://www.youtube.com/watch?v=import', currentStep: 1, furthestStep: 1 }+ });+ const context = await browser.newContext({ viewport: { width: 1280, height: 800 }, reducedMotion: 'reduce' });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ try {+ await runtime.openApp(page);+ await page.goto(`${runtime.origin}/#/workbench?tool=video-translation&jobId=${created.job.id}`);+ const group = page.getByRole('group', { name: '导入已有字幕' });+ await group.getByRole('switch', { name: '导入已有字幕' }).click();+ await group.getByRole('combobox', { name: '字幕类型' }).selectOption('target_subtitle');+ const request = page.waitForRequest(request => request.url().endsWith('/actions') && request.postDataJSON()?.action === 'import-subtitle');+ await group.getByLabel('UTF-8 SRT 文件').setInputFiles({ name: 'local.srt', mimeType: 'application/x-subrip', buffer: Buffer.from('1\n00:00:00,000 --> 00:00:01,000\nHello\n') });+ const action = (await request).postDataJSON();+ await expect(group.getByText(/本地导入 · local.srt/)).toBeVisible();+ await expect(page.getByRole('heading', { name: '设置翻译语言' })).toBeVisible();+ const stored = await runtime.api<{ job: { artifacts: Array<{ kind: string; metadata: unknown }> } }>('GET', `/creator/jobs/${created.job.id}`);+ results.push({ text: await group.innerText(), box: await group.boundingBox(), input: action.input, artifacts: stored.job.artifacts.map(a => ({ kind: a.kind, metadata: a.metadata })) });+ } finally { await context.close(); }+ }+ expect(results[1]).toEqual(results[0]);+});+++test('浅深色基准色与中性灰表面不随强调色变化且 Browser/Desktop 一致', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ const results = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1280, height: 800 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ try {+ await runtime.openApp(page);+ const colors = [];+ for (const theme of ['dark', 'light'] as const) {+ for (const accent of ['red', 'blue', 'custom'] as const) {+ const values = await page.evaluate(({ theme, accent }) => {+ const root = document.documentElement;+ root.dataset.theme = theme;+ root.dataset.accent = accent;+ root.style.setProperty('--custom-accent-value', '#3b82f6');+ const surface = document.createElement('div');+ surface.style.backgroundColor = 'var(--surface-2)';+ document.body.append(surface);- const result = {- theme,- accent,- page: getComputedStyle(document.body).backgroundColor,- text: getComputedStyle(document.body).color,- sidebar: getComputedStyle(document.querySelector('.opencreator-sidebar-pane')!).backgroundColor,- surface: getComputedStyle(surface).backgroundColor- };++ const result = { theme, accent, page: getComputedStyle(document.body).backgroundColor, text: getComputedStyle(document.body).color, sidebar: getComputedStyle(document.querySelector('.opencreator-sidebar-pane')!).backgroundColor, surface: getComputedStyle(surface).backgroundColor };+ surface.remove();+ return result;+ }, { theme, accent });+ expect(values.page).toBe(theme === 'dark' ? 'rgb(10, 10, 10)' : 'rgb(229, 229, 229)');+ expect(values.text).toBe(theme === 'dark' ? 'rgb(229, 229, 229)' : 'rgb(10, 10, 10)');+ colors.push(values);- if (platform === 'browser' && accent === 'red') {- await testInfo.attach(`theme-${theme}-red.png`, {- body: await page.screenshot({ animations: 'disabled' }),- contentType: 'image/png'- });- }++ if (platform === 'browser' && accent === 'red') await testInfo.attach(`theme-${theme}-red.png`, { body: await page.screenshot({ animations: 'disabled' }), contentType: 'image/png' });+ }+ expect(colors.at(-3)!.sidebar).toBe(colors.at(-2)!.sidebar);+ expect(colors.at(-3)!.surface).toBe(colors.at(-2)!.surface);+ expect(colors.at(-2)!.surface).toBe(colors.at(-1)!.surface);+ }+ results.push(colors);- } finally {- await context.close();- }++ } finally { await context.close(); }+ }+ expect(results[1]).toEqual(results[0]);+ });++ test('窄视口 Creator 设置区与右侧对话栏在 Browser/Desktop 下并排一致', async ({+ browser,+ runtime+ }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ test.setTimeout(120_000);+ for (const [tool, templateId] of [+ ['video-generation', 'video-generation'],+ ['video-translation', 'video-translation']+ ] as const) {+ const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId,+ templateId,+ state: {}+ });+ const layouts = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 980, height: 680 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ try {+ await runtime.openApp(page);+ await page.goto(`${runtime.origin}/#/workbench?tool=${tool}&jobId=${created.job.id}`);+ await expect(page.locator('.creator-collaboration-panel')).toBeVisible();+ const layout = await page.evaluate(() => {+ const main = document.querySelector('.creator-workspace-main, .video-translation-wizard-main')!.getBoundingClientRect();+ const panel = document.querySelector('.creator-collaboration-panel')!.getBoundingClientRect();+ return {+ mainRight: Math.round(main.right),+ panelLeft: Math.round(panel.left),+ panelRight: Math.round(panel.right),+ panelBottom: Math.round(panel.bottom)+ };+ });+ expect(layout.panelLeft).toBeGreaterThanOrEqual(layout.mainRight - 1);+ expect(layout.panelRight).toBeLessThanOrEqual(980);+ expect(layout.panelBottom).toBe(680);+ layouts.push(layout);+ } finally {+ await context.close();+ }+ }+ expect(layouts[1]).toEqual(layouts[0]);+ }+ });++ test('设置页各项标题在 Browser/Desktop 下与左侧返回行对齐', async ({+ browser,+ runtime+ }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ const offsets = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1280, height: 800 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ await page.getByRole('button', { name: '设置', exact: true }).click();+ const headings = [];+ for (const tab of ['常规', 'AI 服务']) {+ await page.locator('.settings-nav').getByRole('button', { name: new RegExp(tab) }).click();+ const title = page.locator('.settings-content h1');+ await expect(title).toBeVisible();+ const offset = await page.evaluate(() => {+ const back = document.querySelector('.settings-back')!.getBoundingClientRect();+ const heading = document.querySelector('.settings-content h1')!.getBoundingClientRect();+ return Math.round((heading.top + heading.bottom - back.top - back.bottom) / 2);+ });+ expect(Math.abs(offset)).toBeLessThanOrEqual(2);+ headings.push(offset);+ }+ offsets.push(headings);+ } finally {+ await context.close();+ }+ }+ expect(offsets[1]).toEqual(offsets[0]);+ });++ test('所有设置 Tab 在 Browser/Desktop 下使用相同的页面留白', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ test.setTimeout(120_000);+ const platforms = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1181, height: 985 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ await page.getByRole('button', { name: '设置', exact: true }).click();+ const nav = page.locator('.settings-nav > button');+ await expect(nav).toHaveCount(9);+ const tabs = [];+ for (let index = 0; index < 9; index += 1) {+ await nav.nth(index).click();+ const section = page.locator('.settings-content > .settings-section');+ await expect(section).toBeVisible();+ const bounds = await section.evaluate(element => {+ const content = element.parentElement!;+ const sectionBox = element.getBoundingClientRect();+ const contentBox = content.getBoundingClientRect();+ return {+ left: Math.round(sectionBox.left - contentBox.left),+ right: Math.round(contentBox.right - sectionBox.right),+ gutter: content.offsetWidth - content.clientWidth,+ width: Math.round(sectionBox.width)+ };+ });+ expect(bounds.left, `${platform}: Tab ${index + 1}`).toBe(24);+ expect(bounds.right - bounds.gutter, `${platform}: Tab ${index + 1}`).toBe(24);+ tabs.push(bounds);+ }+ expect(tabs.every(bounds => JSON.stringify(bounds) === JSON.stringify(tabs[0]))).toBe(true);+ platforms.push(tabs);+ } finally {+ await context.close();+ }+ }+ expect(platforms[1]).toEqual(platforms[0]);+ });++ test('各主页面标题行在 Browser/Desktop 下与左侧品牌行同轴', async ({+ browser,+ runtime+ }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ test.setTimeout(180_000);+ const videoGeneration = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId,+ templateId: 'video-generation',+ state: {}+ });+ const videoTranslation = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId,+ templateId: 'video-translation',+ state: {}+ });+ const pages: Array<{ route: string; selector: string; height?: number }> = [+ { route: '/workbench', selector: '.creator-tools-page-header', height: 42 },+ { route: '/projects', selector: '.projects-page-header h1', height: 42 },+ { route: '/settings', selector: '.settings-content h1', height: 42 },+ { route: '/settings?tab=ai-services', selector: '.settings-content h1', height: 42 },+ { route: '/tasks', selector: '.task-center__header h1', height: 42 },+ { route: '/schedules', selector: '.schedules-view__header h1', height: 42 },+ { route: '/search', selector: '.search-view__input', height: 42 },+ { route: '/plugins', selector: '.plugin-center-header', height: 68 },+ { route: `/workbench?tool=video-generation&jobId=${videoGeneration.job.id}`, selector: '.creator-workspace-header', height: 68 },+ { route: `/workbench?tool=video-translation&jobId=${videoTranslation.job.id}`, selector: '.video-translation-header' }+ ];+ const results = [];++ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1280, height: 800 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ const measurements = [];+ for (const { route, selector, height } of pages) {+ await page.evaluate(route => { window.location.hash = route; }, route);+ await expect(page.locator(selector).first()).toBeVisible();+ const measured = await page.evaluate(selector => {+ const brand = document.querySelector('.sidebar-brand')?.getBoundingClientRect();+ const main = document.querySelector('.opencreator-main-pane')!;+ const mainBox = main.getBoundingClientRect();+ const referenceCenter = brand && brand.height > 0+ ? (brand.top + brand.bottom) / 2+ : mainBox.top + Number.parseFloat(getComputedStyle(main).paddingTop) + 34;+ const title = document.querySelector(selector)!.getBoundingClientRect();+ return {+ centerOffset: Math.round((title.top + title.bottom) / 2 - referenceCenter),+ height: Math.round(title.height)+ };+ }, selector);+ expect(Math.abs(measured.centerOffset), `${platform}: ${route}`).toBeLessThanOrEqual(1);+ if (height !== undefined) expect(measured.height, `${platform}: ${route}`).toBe(height);+ measurements.push(measured);+ if (route === '/projects') {+ await testInfo.attach(`projects-title-${platform}.png`, {+ body: await page.screenshot({ animations: 'disabled' }), contentType: 'image/png'+ });+ }+ }+ await page.evaluate(() => { window.location.hash = '/projects'; });+ await expect(page.locator('.projects-page-header h1')).toBeVisible();+ await page.locator('.sidebar-collapse-button').click();+ await expect(page.locator('.opencreator-sidebar')).toHaveAttribute('data-collapsed', 'true');+ const collapsedOffset = await page.evaluate(() => {+ const brand = document.querySelector('.sidebar-brand')!.getBoundingClientRect();+ const heading = document.querySelector('.projects-page-header h1')!.getBoundingClientRect();+ return Math.round((heading.top + heading.bottom - brand.top - brand.bottom) / 2);+ });+ expect(Math.abs(collapsedOffset), `${platform}: collapsed projects`).toBeLessThanOrEqual(1);+ measurements.push({ centerOffset: collapsedOffset, height: 42 });+ results.push(measurements);+ } finally {+ await context.close();+ }+ }+ expect(results[1]).toEqual(results[0]);+ });++ test('工作台与我的项目在相同视口下共用内容容器边界', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '比较固定内容视口');+ test.setTimeout(120_000);+ const results = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1440, height: 800 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ const widths = [];+ for (const width of [1440, 1200, 760, 390]) {+ await page.setViewportSize({ width, height: 800 });+ const measurements = [];+ for (const [route, selector] of [+ ['/workbench', '.creator-tools-page-inner'],+ ['/projects', '.projects-page-inner']+ ] as const) {+ await page.evaluate(route => { window.location.hash = route; }, route);+ await expect(page.locator(selector)).toBeVisible();+ const bounds = await page.locator(selector).evaluate(content => {+ const box = content.getBoundingClientRect();+ const parent = content.parentElement!.getBoundingClientRect();+ const scroller = content.parentElement!;+ const style = getComputedStyle(content);+ return {+ left: Math.round(box.left - parent.left),+ right: Math.round(parent.right - box.right),+ gutter: scroller.offsetWidth - scroller.clientWidth,+ width: Math.round(box.width),+ paddingTop: style.paddingTop,+ paddingBottom: style.paddingBottom+ };+ });+ expect(Math.abs(bounds.left + bounds.gutter - bounds.right), `${platform}: ${route} at ${width}px`)+ .toBeLessThanOrEqual(1);+ measurements.push(bounds);+ }+ expect(measurements[1], `${platform}: ${width}px`).toEqual(measurements[0]);+ widths.push(measurements[0]);+ }+ results.push(widths);+ } finally {+ await context.close();+ }+ }+ expect(results[1]).toEqual(results[0]);+ });++ test('项目页滚动而工作台未滚动时内容边界仍一致', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 1273, height: 985 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ await page.evaluate(() => { window.location.hash = '/workbench'; });+ await expect(page.locator('.creator-tools-page-inner')).toBeVisible();+ const workbench = await page.locator('.creator-tools-page').evaluate(scroller => ({+ right: Math.round(scroller.querySelector('.creator-tools-page-inner')!.getBoundingClientRect().right),+ scrollable: scroller.scrollHeight > scroller.clientHeight,+ gutter: scroller.offsetWidth - scroller.clientWidth+ }));+ expect(workbench.scrollable, `${platform}: workbench`).toBe(false);++ await page.evaluate(() => { window.location.hash = '/projects'; });+ await expect(page.locator('.projects-page-inner')).toBeVisible();+ const projects = await page.locator('.projects-page').evaluate(scroller => {+ const filler = document.createElement('div');+ filler.style.height = '1600px';+ scroller.querySelector('.projects-page-inner')!.append(filler);+ return {+ right: Math.round(scroller.querySelector('.projects-page-inner')!.getBoundingClientRect().right),+ scrollable: scroller.scrollHeight > scroller.clientHeight,+ gutter: scroller.offsetWidth - scroller.clientWidth+ };+ });+ expect(projects.scrollable, `${platform}: projects`).toBe(true);+ expect(projects.gutter, `${platform}: scrollbar width`).toBe(workbench.gutter);+ expect(projects.right, `${platform}: page right edge`).toBe(workbench.right);+ } finally {+ await context.close();+ }+ }+ });++ test('我的项目和产出中心分类在 Browser/Desktop 下保持单行', async ({+ browser,+ runtime+ }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ const results = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({ viewport: { width: 980, height: 680 } });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page, true);+ try {+ await runtime.openApp(page);+ await page.getByRole('button', { name: '我的项目', exact: true }).click();+ const measurements = [];+ for (const [view, count] of [['项目', 4], ['产出中心', 6]] as const) {+ const primary = page.getByRole('tablist', { name: '内容维度' });+ await primary.getByRole('tab', { name: view }).click();+ await expect(primary.getByRole('tab', { name: view })).toHaveAttribute('aria-selected', 'true');+ const tabs = page.locator('.projects-category-tabs');+ await expect(tabs.getByRole('tab')).toHaveCount(count);+ const positions = await tabs.getByRole('tab').evaluateAll(elements => elements.map(element => {+ const rect = element.getBoundingClientRect();+ return { top: Math.round(rect.top), left: Math.round(rect.left) };+ }));+ expect(new Set(positions.map(position => position.top)).size).toBe(1);+ expect(positions.every((position, index) => index === 0 || position.left > positions[index - 1]!.left)).toBe(true);+ const styles = await page.evaluate(() => {+ const row = document.querySelector('.projects-primary-row')!;+ const primary = document.querySelector('.projects-dimension-tabs')!;+ const secondary = document.querySelector('.projects-category-tabs')!;+ const search = row.querySelector('.projects-search')!;+ const activePrimary = primary.querySelector('button[aria-selected="true"]')!;+ const activeSecondary = secondary.querySelector('button[aria-selected="true"]')!;+ const rowBox = row.getBoundingClientRect();+ const primaryBox = primary.getBoundingClientRect();+ const searchBox = search.getBoundingClientRect();+ return {+ primaryFontSize: getComputedStyle(activePrimary).fontSize,+ secondaryFontSize: getComputedStyle(activeSecondary).fontSize,+ primaryRule: getComputedStyle(row).borderBottomWidth,+ primaryIndicator: getComputedStyle(activePrimary, '::after').height,+ secondaryBackground: getComputedStyle(secondary).backgroundColor,+ secondaryBorder: getComputedStyle(secondary).borderTopWidth,+ activeSecondaryBackground: getComputedStyle(activeSecondary).backgroundColor,+ rowGap: Math.round(secondary.getBoundingClientRect().top - rowBox.bottom),+ searchGap: Math.round(searchBox.left - primaryBox.right),+ searchRight: Math.round(searchBox.right - rowBox.right),+ searchCenterOffset: Math.round((searchBox.top + searchBox.bottom - primaryBox.top - primaryBox.bottom) / 2)+ };+ });+ expect(styles.primaryFontSize).toBe('14px');+ expect(styles.secondaryFontSize).toBe('12px');+ expect(styles.primaryRule).toBe('1px');+ expect(styles.primaryIndicator).toBe('2px');+ expect(styles.secondaryBackground).toBe('rgba(0, 0, 0, 0)');+ expect(styles.secondaryBorder).toBe('0px');+ expect(styles.activeSecondaryBackground).not.toBe('rgba(0, 0, 0, 0)');+ expect(styles.rowGap).toBe(12);+ expect(styles.searchGap).toBeGreaterThanOrEqual(16);+ expect(styles.searchRight).toBe(0);+ expect(Math.abs(styles.searchCenterOffset)).toBeLessThanOrEqual(1);+ await expect(page.locator('.projects-primary-row').getByRole('searchbox', {+ name: view === '项目' ? '搜索项目' : '搜索产出'+ })).toBeVisible();+ measurements.push(styles);+ await testInfo.attach(`projects-hierarchy-${platform}-${view}.png`, {+ body: await page.screenshot({ animations: 'disabled' }), contentType: 'image/png'+ });+ await tabs.getByRole('tab', { name: view === '项目' ? '视频创作' : '视频', exact: true }).click();+ await expect(tabs.getByRole('tab', { name: view === '项目' ? '视频创作' : '视频', exact: true }))+ .toHaveAttribute('aria-selected', 'true');+ }+ results.push(measurements);+ } finally {+ await context.close();+ }+ }+ expect(results[1]).toEqual(results[0]);+ });++ test('窄屏产出分类保持单行且末项可选', async ({ browser, runtime }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-mobile', '窄屏布局');+ const context = await browser.newContext({ viewport: { width: 390, height: 844 } });+ const page = await context.newPage();+ try {+ await runtime.openApp(page);+ await page.evaluate(() => { window.location.hash = '/projects'; });+ await page.getByRole('tablist', { name: '内容维度' }).getByRole('tab', { name: '产出中心' }).click();+ const tabs = page.getByRole('tablist', { name: '产出分类' });+ await expect(tabs.getByRole('tab')).toHaveCount(6);+ const tops = await tabs.getByRole('tab').evaluateAll(elements =>+ elements.map(element => Math.round(element.getBoundingClientRect().top))+ );+ expect(new Set(tops).size).toBe(1);+ await tabs.getByRole('tab', { name: '文档' }).click();+ await expect(tabs.getByRole('tab', { name: '文档' })).toHaveAttribute('aria-selected', 'true');+ expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(390);+ const primaryRow = await page.evaluate(() => {+ const content = document.querySelector('.projects-page-inner')!.getBoundingClientRect();+ const tabs = document.querySelector('.projects-dimension-tabs')!.getBoundingClientRect();+ const search = document.querySelector('.projects-search')!.getBoundingClientRect();+ return {+ tabsRight: tabs.right,+ searchLeft: search.left,+ searchRight: search.right,+ contentRight: content.right,+ centerOffset: (search.top + search.bottom - tabs.top - tabs.bottom) / 2+ };+ });+ expect(primaryRow.searchLeft).toBeGreaterThanOrEqual(primaryRow.tabsRight + 10);+ expect(primaryRow.searchRight).toBeLessThanOrEqual(primaryRow.contentRight + 1);+ expect(Math.abs(primaryRow.centerOffset)).toBeLessThanOrEqual(1);+ await page.setViewportSize({ width: 320, height: 844 });+ expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(320);+ await testInfo.attach('projects-hierarchy-mobile.png', {+ body: await page.screenshot({ animations: 'disabled' }), contentType: 'image/png'+ });+ } finally {+ await context.close();+ }+ });++ test('导航与文章模板图标在 Browser/Desktop 下只保留外层容器', async ({+ browser,+ runtime+ }, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '固定桌面内容视口');+ test.setTimeout(120_000);+ for (const theme of ['dark', 'light'] as const) {+ const results = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({+ viewport: { width: 1440, height: 900 },+ colorScheme: theme,+ reducedMotion: 'reduce',+ deviceScaleFactor: 1+ });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ try {+ await runtime.openApp(page);+ await page.evaluate(theme => { document.documentElement.dataset.theme = theme; }, theme);+ const sidebar = page.locator('.opencreator-sidebar');+ const measurements = [];+ for (const collapsed of [false, true]) {+ if (collapsed) await sidebar.locator('.sidebar-collapse-button').click();+ await expect(sidebar).toHaveAttribute('data-collapsed', String(collapsed));+ for (const label of ['工作台', '我的项目', '设置']) {+ const button = sidebar.getByRole('button', { name: label, exact: true });+ await button.click();+ await expect(button).toHaveAttribute('aria-current', 'page');+ for (const hovered of [false, true]) {+ if (hovered) await button.hover();+ else await page.mouse.move(700, 0);+ await button.evaluate(button => Promise.all(+ button.getAnimations({ subtree: true }).map(animation => animation.finished.catch(() => undefined))+ ));+ const styles = await button.evaluate(button => {+ const icon = button.querySelector('.sidebar-nav-icon')!;+ const style = getComputedStyle(icon);+ const box = icon.getBoundingClientRect();+ return {+ iconBackground: style.backgroundColor,+ iconBorder: style.borderTopWidth,+ iconShadow: style.boxShadow,+ iconColor: style.color,+ rowBackground: getComputedStyle(button).backgroundColor,+ width: box.width,+ height: box.height+ };+ });+ expect(styles.iconBackground).toBe('rgba(0, 0, 0, 0)');+ expect(styles.iconBorder).toBe('0px');+ expect(styles.iconShadow).toBe('none');+ expect(styles.rowBackground).not.toBe('rgba(0, 0, 0, 0)');+ measurements.push({ label, collapsed, hovered, ...styles });+ }+ }+ await testInfo.attach(`single-nav-container-${platform}-${theme}-${collapsed}.png`, {+ body: await sidebar.screenshot({ animations: 'disabled' }), contentType: 'image/png'+ });+ }+ const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {+ projectId: runtime.projectId,+ templateId: 'wechat-article',+ state: { currentStep: 1, furthestStep: 1 }+ });+ await page.goto(`${runtime.origin}/#/workbench?tool=wechat-article&jobId=${created.job.id}`);+ await expect(page.locator('.wechat-template-inline-list > button').first()).toBeVisible();+ await expectUnframedTemplateIcons(page, '.wechat-template-inline-list > button > span');+ await page.getByRole('button', { name: '查看全部模板', exact: true }).click();+ await expect(page.getByRole('dialog', { name: '文章模板库' })).toBeVisible();+ await page.locator('.wechat-template-grid > button').first().click();+ await expectUnframedTemplateIcons(page, '.wechat-template-grid > button > span');+ results.push(measurements);+ } finally {+ await context.close();+ }+ }+ expect(results[1]).toEqual(results[0]);+ }+ });++ async function expectUnframedTemplateIcons(page: import('@playwright/test').Page, selector: string): Promise<void> {+ const icons = page.locator(selector);+ expect(await icons.count()).toBeGreaterThan(0);+ const styles = await icons.evaluateAll(icons => icons.map(icon => {+ const style = getComputedStyle(icon);+ return { background: style.backgroundColor, border: style.borderTopWidth, shadow: style.boxShadow };+ }));+ for (const style of styles) {+ expect(style).toEqual({ background: 'rgba(0, 0, 0, 0)', border: '0px', shadow: 'none' });+ }+ }+test('通用界面设置在 Browser/Desktop Bridge 下读取并写入相同 Runtime 配置', async ({browser,runtime@@@ -1177,166 -1606,11 +1721,167 @@@ test('封面生成在桌面和移动视await expect(page.getByRole('radio', { name: '9:16', exact: true })).toBeChecked();});+test('Creator Preset 在 Browser/Desktop Bridge 下创建相同工作台状态', async ({+ browser,+ runtime+}, testInfo) => {+ test.skip(+ testInfo.project.name !== 'chromium-desktop',+ '一致性规格内部固定创建 Browser/Desktop Chromium 上下文'+ );++ const results: Array<{+ home: {+ text: string;+ boxes: Record<string, { width: number; height: number }>;+ };+ request: Record<string, unknown>;+ route: string;+ text: string;+ job: {+ templateId: string;+ templateVersion: number;+ status: string;+ state: Record<string, unknown>;+ presetOrigin: Record<string, unknown> | null;+ stages: unknown[];+ };+ }> = [];++ for (const platform of ['browser', 'desktop'] as const) {+ const context = await browser.newContext({+ viewport: { width: 1280, height: 800 },+ deviceScaleFactor: 1,+ colorScheme: 'dark',+ reducedMotion: 'reduce'+ });+ const page = await context.newPage();+ if (platform === 'desktop') await installDesktopBridge(page);+ let createRequest: Record<string, unknown> | undefined;+ page.on('request', request => {+ const url = new URL(request.url());+ if (+ request.method() === 'POST'+ && url.pathname.endsWith('/creator/jobs')+ ) {+ createRequest = request.postDataJSON() as Record<string, unknown>;+ }+ });++ try {+ await runtime.openApp(page);+ await page.goto(`${runtime.origin}/#/new`);+ await expect(page.getByRole('heading', { name: '精选模板' })).toBeVisible();+ await expect(page.getByText('需要帮你做点什么')).toHaveCount(0);+ await expect(page.getByRole('textbox', { name: '输入任务' })).toHaveCount(0);+ await expect(page.getByRole('tab', { name: '推荐' }))+ .toHaveAttribute('aria-selected', 'true');+ await expect(page.getByRole('tab', { name: '视频创作' })).toBeVisible();+ await expect(page.getByRole('tab', { name: '图像设计' })).toBeVisible();+ await page.getByRole('tab', { name: '图像设计' }).click();+ const presetButton = page.getByRole('button', {+ name: '查看食物爆炸拆解信息图模板详情'+ });+ await expect(presetButton).toHaveText('食物爆炸拆解信息图');+ await presetButton.scrollIntoViewIfNeeded();+ const cover = presetButton.locator('img');+ await expect.poll(async () => cover.evaluate(image => ({+ complete: image.complete,+ width: image.naturalWidth+ }))).toEqual({ complete: true, width: 1280 });+ const home = page.locator('.creator-dashboard');+ const boxes: Record<string, { width: number; height: number }> = {};+ for (const [name, locator] of [+ ['categories', page.getByRole('tablist', { name: '创作模板分类' })],+ ['first-template', presetButton]+ ] as const) {+ const box = await locator.boundingBox();+ expect(box).not.toBeNull();+ boxes[name] = {+ width: Math.round(box!.width),+ height: Math.round(box!.height)+ };+ }+ const homeSnapshot = {+ text: normalizeParityText(await home.innerText()),+ boxes+ };++ await presetButton.click();+ await page.getByRole('button', { name: '使用此模板', exact: true }).click();+ await expect(page).toHaveURL(/#\/workbench\?tool=image-generation&jobId=/);+ const route = new URL(page.url()).hash.slice(1);+ const jobId = new URL(route, runtime.origin).searchParams.get('jobId');+ expect(jobId).not.toBeNull();+ await expect.poll(() => createRequest).toBeDefined();+ const response = await runtime.api<{+ job: {+ templateId: string;+ templateVersion: number;+ status: string;+ state: Record<string, unknown>;+ presetOrigin: Record<string, unknown> | null;+ stages: unknown[];+ };+ }>('GET', `/creator/jobs/${encodeURIComponent(jobId!)}`);+ const workspace = page.getByRole('region', { name: /图像生成\s*操作区/ });+ const panel = page.getByRole('complementary', { name: 'OpenCreator' });+ await expect(workspace).toBeVisible();+ await expect(panel).toBeVisible();++ results.push({+ home: homeSnapshot,+ request: {+ ...createRequest!,+ creationKey: '{creationKey}'+ },+ route: route.replace(jobId!, '{jobId}'),+ text: normalizeParityText(+ `${await workspace.innerText()}\n${await panel.innerText()}`+ ),+ job: {+ templateId: response.job.templateId,+ templateVersion: response.job.templateVersion,+ status: response.job.status,+ state: response.job.state,+ presetOrigin: response.job.presetOrigin,+ stages: response.job.stages+ }+ });+ } finally {+ await context.close();+ }+ }++ expect(results[1]!.home).toEqual(results[0]!.home);+ expect(results[1]!.request).toEqual(results[0]!.request);+ expect(results[1]!.route).toBe(results[0]!.route);+ expect(results[1]!.text).toBe(results[0]!.text);+ expect(results[1]!.job).toEqual(results[0]!.job);+ expect(results[0]!.job).toMatchObject({+ templateId: 'image-generation',+ templateVersion: 2,+ status: 'draft',+ presetOrigin: {+ module: 'image-generation',+ id: 'exploded-food-infographic',+ version: 1,+ locale: 'zh-CN',+ title: '食物爆炸拆解信息图'+ },+ state: {+ prompt: expect.stringContaining('创建超写实的塔可'),+ size: '1024x1024'+ },+ stages: []+ });+});+async function installDesktopBridge(- page: import('@playwright/test').Page+ page: import('@playwright/test').Page,+ integratedTitleBar = false): Promise<void> {- await page.addInitScript(() => {+ await page.addInitScript((integratedTitleBar) => {const success = { ok: true as const };Object.defineProperty(window, 'opencreatorDesktop', {configurable: true,diff --cc apps/web/src/app/AppController.tsxindex a9678adc,084f9437..5a075e6b--- a/apps/web/src/app/AppController.tsx+++ b/apps/web/src/app/AppController.tsx@@@ -4212,95 -4088,6 +4237,95 @@@ export function AppController(props: Apconst pendingComposerApproval = [...timelineItems].reverse().find(item => (item.kind === 'approval' && item.approval.status === 'pending'));+ const creatorDashboard = (+ <CreatorDashboard+ presets={creatorPresets}+ loading={creatorPresetsLoading}+ error={creatorPresetsError}+ onRetry={() => setCreatorPresetsReloadKey(value => value + 1)}+ onSelectPreset={applyDashboardPreset}+ onSelectSkill={applyDashboardSkill}+ />+ );+ const conversationComposer = (+ <Composer+ key={composerAttachmentScope}+ projectId={currentProject?.id ?? ''}+ projectName={currentProjectName}+ projects={projects}+ showProjectSelector={false}+ permission={effectiveComposerConfig.permission}+ profile={effectiveComposerConfig.profile}+ model={effectiveComposerConfig.model}+ reasoning={effectiveComposerConfig.reasoning}+ models={codexModels?.models}+ modelsLoading={codexModelsLoading}+ modelsError={codexModelsLoadError}+ modelsNotice={codexModelsNotice}+ disabled={composerDisabled}+ disabledReason={composerDisabledReason}+ promptHint={showConversationEmptyState ? homeSkillPromptHint : undefined}+ running={currentRunBusy}+ canceling={currentRunCanceling}+ permissionChangeDisabled={selectedThread !== undefined && currentRunBusy}+ slashCommands={slashCommands}+ slashCommandsLoading={capabilitiesLoading}+ slashCommandsError={capabilitiesLoadError}+ showConnectors={false}+ queuedItems={composerQueuedItems}+ imageInputSupported={imageInputSupported}+ imageInputUnsupportedReason={+ imageInputSupported+ ? undefined+ : '当前 Codex 版本不支持图片输入,请更新 Codex'+ }+ draftRequest={+ pendingComposerDraft !== undefined && pendingComposerDraft.threadId === state.selectedThreadId+ ? pendingComposerDraft.request+ : undefined+ }+ focusRequestId={pendingComposerFocusRequestId}+ onSelectProject={selectProject}+ onCreateBlankProject={+ projectService === null+ ? undefined- : createBlankProject++ : () => createProject()+ }+ onAddProjectDirectory={+ projectService === null || hostBridge.selectProjectDirectory === undefined+ ? undefined+ : addProjectDirectory+ }+ onPermissionChange={handleComposerPermissionChange}+ onModelConfigChange={handleComposerModelConfigChange}+ onDraftApplied={handleComposerDraftApplied}+ onFocusRequestApplied={handleComposerFocusRequestApplied}+ onManageSkills={() => navigateToRoute({ view: 'plugins' })}+ onManageConnectors={() => navigateToRoute({+ view: 'plugins',+ tab: 'connections'+ })}+ onCancel={() => void cancelActiveRun()}+ onCancelQueuedRun={(runId) => void cancelQueuedRun(runId)}+ onSteerQueuedRun={(runId) => void steerQueuedRun(runId)}+ onUploadAttachment={async file => {+ if (attachmentService === null) throw new Error('附件服务暂不可用');+ const response = await attachmentService.upload({+ file,+ draftId: composerAttachmentDraftId+ });+ return response.attachment;+ }}+ onDeleteAttachment={async attachment => {+ if (attachmentService === null || attachment.draftId === undefined) return;+ await attachmentService.delete({+ id: attachment.id,+ draftId: attachment.draftId+ });+ }}+ onSubmit={submitPrompt}+ />+ );const conversationPage = (<sectionclassName={[diff --cc apps/web/src/components/tts/TtsVoicePicker.tsxindex 6bd6cc91,88cd21e4..a6ba350f--- a/apps/web/src/components/tts/TtsVoicePicker.tsx+++ b/apps/web/src/components/tts/TtsVoicePicker.tsx@@@ -8,9 -8,10 +8,10 @@@ importPlay,RefreshCw} from 'lucide-react';-import { useEffect, useMemo, useRef, useState } from 'react';+import { Fragment, useEffect, useMemo, useRef, useState } from 'react';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';import type { CreatorServicesSettingsService } from '../../services/creator-services-service.js';+ import NativeSelect from '../forms/NativeSelect.js';import './tts-voice-picker.css';export function TtsVoicePicker(props: {@@@ -164,30 -142,18 +165,30 @@@}}>{options.length === 0 ? (- <option value="">+ <option value={props.value}>{loading? l('正在加载音色', 'Loading voices')- : l('暂无可用音色', 'No voices available')}+ : allowCustomVoice+ ? l('请填写下方 Speaker ID', 'Enter a speaker ID below')+ : l('暂无可用音色', 'No voices available')}</option>) : null}- {options.map(voice => (- <option key={voice.id} value={voice.id}>- {voiceLabel(voice, l)}- </option>- ))}+ {groupedOptions.map(group => {+ const items = group.voices.map(voice => (+ <option key={voice.id} value={voice.id}>+ {voiceLabel(voice, l)}+ </option>+ ));+ if (!group.label) {+ return <Fragment key="ungrouped">{items}</Fragment>;+ }+ return (+ <optgroup key={group.label} label={group.label}>+ {items}+ </optgroup>+ );+ })}- </select>+ </NativeSelect></label><div className="tts-voice-picker-actions"><buttondiff --cc apps/web/src/features/dashboard/DashboardPage.test.tsxindex 4796ebcc,9396fa35..0b69160f--- a/apps/web/src/features/dashboard/DashboardPage.test.tsx+++ b/apps/web/src/features/dashboard/DashboardPage.test.tsx@@@ -1522,10 -1518,10 +1546,10 @@@ describe('DashboardPage', () =>it('resizes the immersive operation and Agent panes', () => {render(<DashboardPage onSelectPrompt={vi.fn()} />);- fireEvent.click(screen.getByRole('button', { name: /^视频翻译/ }));+ openBlankWorkspace('视频翻译', '空白视频翻译');const separator = screen.getByRole('separator', { name: '调整操作区和对话区宽度' });-- expect(separator).toHaveAttribute('aria-valuemin', '780');++ expect(separator).toHaveAttribute('aria-valuemin', '390');const layout = separator.parentElement as HTMLDivElement;vi.spyOn(layout, 'getBoundingClientRect').mockReturnValue({bottom: 800,@@@ -1542,14 -1538,14 +1566,14 @@@fireEvent.mouseDown(separator, { button: 0, clientX: 800 });fireEvent.mouseMove(window, { clientX: 720 });fireEvent.mouseUp(window);-- expect(layout).toHaveStyle({ '--video-translation-pane-width': '780px' });++ expect(layout).toHaveStyle({ '--video-translation-pane-width': '720px' });fireEvent.keyDown(separator, { key: 'ArrowLeft' });-- expect(layout).toHaveStyle({ '--video-translation-pane-width': '780px' });++ expect(layout).toHaveStyle({ '--video-translation-pane-width': '688px' });fireEvent.keyDown(separator, { key: 'ArrowRight' });-- expect(layout).toHaveStyle({ '--video-translation-pane-width': '812px' });++ expect(layout).toHaveStyle({ '--video-translation-pane-width': '720px' });fireEvent.keyDown(separator, { key: 'ArrowLeft' });-- expect(layout).toHaveStyle({ '--video-translation-pane-width': '780px' });++ expect(layout).toHaveStyle({ '--video-translation-pane-width': '688px' });fireEvent.doubleClick(separator);expect(layout.style.getPropertyValue('--video-translation-pane-width')).toBe('');});diff --cc apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsxindex 9b135b45,03a9e5f0..3313c023--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx@@@ -630,9 -426,9 +630,9 @@@ describe('VideoTranslationWorkspace tas);expect(await screen.findByRole('heading', { name: '视频翻译项目' })).toBeInTheDocument();- expect(screen.getByRole('button', { name: '项目 V2' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: '项目 V1' })).toBeInTheDocument();- expect(screen.getByRole('tab', { name: '生成物' })).toHaveAttribute('aria-selected', 'true');+ expect(screen.getByRole('tab', { name: '作品' })).toHaveAttribute('aria-selected', 'true');- expect(screen.getByText('target-subtitle-v2.srt')).toBeInTheDocument();+ expect(screen.getByText('target-subtitle-v1.srt')).toBeInTheDocument();expect(screen.queryByText('正在基于 V1 调整')).not.toBeInTheDocument();fireEvent.click(screen.getByRole('tab', { name: '配音' }));diff --cc apps/web/src/features/dashboard/VideoTranslationWorkspace.tsxindex eb93b909,390f3c0a..7be8a03c--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx@@@ -145,23 -116,8 +145,23 @@@ type LanguageOption =const steps = ['添加视频', '翻译设置', '字幕样式', '配音与输出'] as const;const subtitleColors = ['#FFFFFF', '#FFE45C', '#7EE7FF', '#A7F3D0'] as const;+const defaultSubtitleStyle: SubtitleStyleSettings = {+ subtitleFont: 'sans',+ subtitleWeight: 'bold',+ subtitleSize: 'medium',+ subtitleColor: '#FFFFFF',+ subtitleSecondaryColor: '#D1D5DB',+ subtitleOutlineColor: '#000000',+ subtitleOutlineWidth: 2.5,+ subtitleShadowEnabled: true,+ subtitleShadowColor: '#000000',+ subtitleShadowOpacity: 0.6,+ subtitleShadowOffsetX: 1.5,+ subtitleShadowOffsetY: 1.5,+ subtitleShadowBlur: 0.5+};- const WORKSPACE_MIN_WIDTH = 780;- const AGENT_MIN_WIDTH = 320;+ const WORKSPACE_MIN_WIDTH = 390;+ const AGENT_MIN_WIDTH = 280;const WORKSPACE_RESIZE_HANDLE_WIDTH = 7;const WORKSPACE_RESIZE_KEY_STEP = 32;diff --cc apps/web/src/features/projects/ProjectsPage.tsxindex 77e90423,0e5a7cfb..c7c27b90--- a/apps/web/src/features/projects/ProjectsPage.tsx+++ b/apps/web/src/features/projects/ProjectsPage.tsx@@@ -1,10 -1,15 +1,17 @@@- import type { CreatorJob } from '@opencreator/protocol';+ import type { CreatorArtifact, CreatorJob } from '@opencreator/protocol';import {+ Captions,+ CirclePlay,+ FileText,FolderKanban,+ Image as ImageIcon,+ ListChecks,+ Music2,+ PackageOpen,Search,Trash2,- Video++ Video,+ X} from 'lucide-react';import { useEffect, useMemo, useState } from 'react';import { ConfirmDialog } from '../../components/dialogs/ConfirmDialog.js';@@@ -51,16 -100,16 +100,20 @@@ export default function ProjectsPage(pr}) {const { language } = useAppLanguage();const l = useLocalizedCopy();+ const [view, setView] = useState<ProjectsView>('projects');const [query, setQuery] = useState('');const [category, setCategory] = useState<ProjectCategory>('全部');+ const [outputCategory, setOutputCategory] = useState<OutputCategory>('全部');const [projectPendingDeletion, setProjectPendingDeletion] = useState<CreatorProject>();+ const [batchMode, setBatchMode] = useState(false);+ const [selectedProjectIds, setSelectedProjectIds] = useState<Set<string>>(() => new Set());+ const [batchPendingDeletion, setBatchPendingDeletion] = useState(false);const [deleteProjectFiles, setDeleteProjectFiles] = useState(false);const [deletingProjectId, setDeletingProjectId] = useState<string>();+ const [batchDeleting, setBatchDeleting] = useState(false);const [deleteError, setDeleteError] = useState<string>();+ const [downloadingOutputId, setDownloadingOutputId] = useState<string>();+ const [downloadError, setDownloadError] = useState<string>();const normalizedQuery = query.trim().toLocaleLowerCase();const projects = useMemo(() => props.jobs@@@ -79,41 -128,49 +132,80 @@@].join(' ').toLocaleLowerCase().includes(normalizedQuery)).sort((left, right) => right.job.updatedAt.localeCompare(left.job.updatedAt)),[category, normalizedQuery, projects]);+ const outputs = useMemo(+ () => projects.flatMap(project => createProjectOutputs(project, l)),+ [l, projects]+ );+ const visibleOutputs = useMemo(() => outputs+ .filter(output => outputCategory === '全部' || output.kind === outputCategory)+ .filter(output => normalizedQuery.length === 0 || `${output.name} ${output.projectName} ${output.format}`+ .toLocaleLowerCase()+ .includes(normalizedQuery))+ .sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)),+ [normalizedQuery, outputCategory, outputs]);+ const selectedProjectCount = selectedProjectIds.size;+ const allVisibleProjectsSelected = visibleProjects.length > 0+ && visibleProjects.every(project => selectedProjectIds.has(project.job.id));+ const deleting = deletingProjectId !== undefined || batchDeleting;+ function selectView(nextView: ProjectsView) {+ setView(nextView);+ setQuery('');+ }++ useEffect(() => {+ const availableProjectIds = new Set(projects.map(project => project.job.id));+ setSelectedProjectIds(current => {+ const next = new Set([...current].filter(projectId => availableProjectIds.has(projectId)));+ return next.size === current.size ? current : next;+ });+ }, [projects]);++ const toggleProjectSelection = (projectId: string) => {+ if (batchDeleting) return;+ setSelectedProjectIds(current => {+ const next = new Set(current);+ if (next.has(projectId)) next.delete(projectId);+ else next.add(projectId);+ return next;+ });+ };++ const leaveBatchMode = () => {+ if (batchDeleting) return;+ setBatchMode(false);+ setBatchPendingDeletion(false);+ setSelectedProjectIds(new Set());+ setDeleteProjectFiles(false);+ setDeleteError(undefined);+ };++ async function downloadOutput(output: ProjectOutput) {+ if (props.service?.openArtifact === undefined || downloadingOutputId !== undefined) return;+ setDownloadingOutputId(output.id);+ setDownloadError(undefined);+ try {+ const response = await props.service.openArtifact(output.job.id, output.id);+ if (!response.ok) throw new Error('Artifact download failed');+ const blob = await response.blob();+ const objectUrl = URL.createObjectURL(blob);+ const link = document.createElement('a');+ link.href = objectUrl;+ link.download = output.name;+ document.body.append(link);+ link.click();+ link.remove();+ URL.revokeObjectURL(objectUrl);+ } catch {+ setDownloadError(l('文件下载失败,请重试', 'Unable to download the file. Please try again.'));+ } finally {+ setDownloadingOutputId(undefined);+ }+ }+return (- <main className="projects-page">- <div className="projects-page-inner">+ <main className="opencreator-scroll-page projects-page">+ <div className="opencreator-page-content projects-page-inner"><header className="projects-page-header"><div><h1>{l('我的项目', 'My Projects')}</h1>@@@ -145,78 -229,20 +264,85 @@@))}</div>- <section className="projects-library" aria-label={l('项目列表', 'Project list')}>- <section className="projects-library" aria-labelledby="projects-library-title">++ <section className="projects-library" aria-label={view === 'projects' ? l('项目列表', 'Project list') : l('产出列表', 'Output list')}><div className="projects-library-heading">- <h2 id="projects-library-title">- {view === 'projects'- ? category === '全部' ? l('最近项目', 'Recent projects') : localizeProjectCategory(category, l)- : outputCategory === '全部' ? l('全部产出', 'All outputs') : localizeOutputCategory(outputCategory, l)}- </h2>- <span>{view === 'projects'- ? `${visibleProjects.length} ${l('个项目', 'projects')}`- : `${visibleOutputs.length} ${l('个产出', 'outputs')}`}</span>+ <div className="projects-library-summary">- {category === '全部' ? null : (- <h2>{localizeProjectCategory(category, l)}</h2>++ {(view === 'projects' ? category : outputCategory) === '全部' ? null : (++ <h2>{view === 'projects'++ ? localizeProjectCategory(category, l)++ : localizeOutputCategory(outputCategory, l)}</h2>+ )}- <span>{`${visibleProjects.length} ${l('个项目', 'projects')}`}</span>++ <span>{view === 'projects'++ ? `${visibleProjects.length} ${l('个项目', 'projects')}`++ : `${visibleOutputs.length} ${l('个产出', 'outputs')}`}</span>+ </div>- {props.onDeleteJob !== undefined && projects.length > 0 ? (++ {view === 'projects' && props.onDeleteJob !== undefined && projects.length > 0 ? (+ batchMode ? (+ <div className="projects-batch-actions">+ <span className="projects-selected-count">+ {l(`已选择 ${selectedProjectCount} 个`, `${selectedProjectCount} selected`)}+ </span>+ <button+ type="button"+ className="projects-batch-button"+ disabled={visibleProjects.length === 0 || batchDeleting}+ onClick={() => {+ setSelectedProjectIds(current => {+ const next = new Set(current);+ visibleProjects.forEach(project => {+ if (allVisibleProjectsSelected) next.delete(project.job.id);+ else next.add(project.job.id);+ });+ return next;+ });+ }}+ >+ <ListChecks size={15} strokeWidth={1.8} aria-hidden="true" />+ {allVisibleProjectsSelected+ ? l('取消选择当前结果', 'Deselect results')+ : l('全选当前结果', 'Select all results')}+ </button>+ <button+ type="button"+ className="projects-batch-button"+ disabled={batchDeleting}+ onClick={leaveBatchMode}+ >+ <X size={15} strokeWidth={1.8} aria-hidden="true" />+ {l('取消', 'Cancel')}+ </button>+ <button+ type="button"+ className="projects-batch-button is-destructive"+ disabled={selectedProjectCount === 0 || batchDeleting}+ onClick={() => {+ setDeleteError(undefined);+ setDeleteProjectFiles(false);+ setBatchPendingDeletion(true);+ }}+ >+ <Trash2 size={15} strokeWidth={1.8} aria-hidden="true" />+ {l(`删除已选 (${selectedProjectCount})`, `Delete selected (${selectedProjectCount})`)}+ </button>+ </div>+ ) : (+ <button+ type="button"+ className="projects-batch-button"+ onClick={() => {+ setDeleteError(undefined);+ setBatchMode(true);+ }}+ >+ <ListChecks size={15} strokeWidth={1.8} aria-hidden="true" />+ {l('批量管理', 'Batch manage')}+ </button>+ )+ ) : null}</div>+ {view === 'outputs' && downloadError !== undefined ? (+ <p className="projects-download-error" role="alert">{downloadError}</p>+ ) : null}{props.error !== undefined ? (<div className="projects-empty" role="alert">@@@ -229,16 -255,10 +355,16 @@@<FolderKanban size={28} strokeWidth={1.5} aria-hidden="true" /><strong>{l('正在加载最近项目', 'Loading recent projects')}</strong></div>- ) : visibleProjects.length > 0 ? (+ ) : view === 'projects' ? visibleProjects.length > 0 ? (<div className="projects-card-grid" role="list" aria-label={l('项目列表', 'Project list')}>- {visibleProjects.map(project => (- <article className="project-card" role="listitem" key={project.job.id}>+ {visibleProjects.map(project => {+ const selected = selectedProjectIds.has(project.job.id);+ return (+ <article+ className={`project-card${batchMode ? ' is-managing' : ''}${selected ? ' is-selected' : ''}`}+ role="listitem"+ key={project.job.id}+ ><buttontype="button"className="project-card-open"@@@ -711,6 -723,85 +894,86 @@@ function localizeJobStatus(status: Creareturn l('草稿', 'Draft');}+ function outputKindIcon(kind: ProjectOutputKind, size: number) {+ if (kind === '视频') return <Video size={size} strokeWidth={1.8} aria-hidden="true" />;+ if (kind === '图片') return <ImageIcon size={size} strokeWidth={1.8} aria-hidden="true" />;+ if (kind === '音频') return <Music2 size={size} strokeWidth={1.8} aria-hidden="true" />;+ if (kind === '字幕') return <Captions size={size} strokeWidth={1.8} aria-hidden="true" />;+ return <FileText size={size} strokeWidth={1.8} aria-hidden="true" />;+ }++ function createProjectOutputs(project: CreatorProject, l: LocalizeCopy): ProjectOutput[] {+ return project.job.artifacts+ .filter(artifact => (+ artifact.path !== null+ && artifact.status !== 'stale'+ && projectArtifactKinds.has(artifact.kind)+ ))+ .map(artifact => ({+ id: artifact.id,+ job: project.job,+ projectName: project.title,+ name: artifactName(artifact, l),+ kind: artifactKind(artifact.kind),+ format: artifactFormat(artifact),+ detail: artifact.status === 'technical_preview'+ ? l(`技术预览 · V${artifact.version}`, `Technical preview · V${artifact.version}`)+ : `V${artifact.version}`,+ cover: project.cover,+ youtubeCovers: project.youtubeCovers,+ updatedAt: artifact.createdAt+ }));+ }++ function artifactName(artifact: CreatorArtifact, l: LocalizeCopy): string {+ const fileName = artifact.metadata.fileName;+ if (typeof fileName === 'string' && fileName.trim().length > 0) return fileName;+ const pathName = artifact.path?.split(/[\\/]/).at(-1);+ if (pathName !== undefined && pathName.length > 0) return pathName;+ const labels: Record<string, string> = {+ source_video: l('原始视频', 'Source video'),+ target_subtitle: l('目标语言字幕', 'Translated subtitles'),+ source_subtitle: l('原文字幕', 'Source subtitles'),+ bilingual_subtitle: l('双语字幕', 'Bilingual subtitles'),+ dubbed_audio: l('配音音轨', 'Dubbed audio'),+ horizontal_video: l('横屏成片', 'Landscape video'),+ vertical_video: l('竖屏成片', 'Portrait video'),+ auto_clip_video: l('剪辑成片', 'Edited video'),+ cover_image: l('封面图片', 'Thumbnail'),+ generated_image: l('生成图片', 'Generated image'),+ clean_video: l('火柴人纯净视频', 'Stickman clean video'),+ bilingual_video: l('火柴人双语视频', 'Stickman bilingual video'),+ publish_copy: l('发布文案', 'Publish copy'),+ shot_image: l('火柴人镜头画面', 'Stickman shot visual')+ };+ return labels[artifact.kind] ?? artifact.kind;+ }++ function artifactKind(kind: string): ProjectOutputKind {+ if (/video/i.test(kind)) return '视频';+ if (/image|cover|storyboard/i.test(kind)) return '图片';+ if (/audio|narration|voice/i.test(kind)) return '音频';+ if (/subtitle|caption/i.test(kind)) return '字幕';+ return '文档';+ }++ function artifactFormat(artifact: CreatorArtifact): string {+ const fileName = typeof artifact.metadata.fileName === 'string'+ ? artifact.metadata.fileName+ : artifact.path?.split(/[\\/]/).at(-1);+ const extension = fileName?.split('.').at(-1);+ return extension === undefined || extension === fileName ? 'FILE' : extension.toUpperCase();+ }++ function localizeOutputCategory(category: OutputCategory, l: LocalizeCopy): string {+ if (category === '全部') return l(category, 'All');+ if (category === '视频') return l(category, 'Videos');+ if (category === '图片') return l(category, 'Images');+ if (category === '音频') return l(category, 'Audio');+ if (category === '字幕') return l(category, 'Subtitles');+ return l(category, 'Documents');+ }++function projectCover(templateId: string): string {if (templateId === 'video-translation') {return '/dashboard/templates/video-translation-project-cover.png';diff --cc apps/web/src/features/projects/projects-page.cssindex 631aa2d7,831cc927..a8dcc343--- a/apps/web/src/features/projects/projects-page.css+++ b/apps/web/src/features/projects/projects-page.css@@@ -56,9 -113,8 +113,9 @@@padding: 0 12px;border-radius: 6px;color: var(--muted);- font-size: 13px;- font-weight: 560;- text-overflow: ellipsis;+ font-size: 12px;+ font-weight: 500;++ transition: color 180ms ease;white-space: nowrap;}@@@ -396,31 -490,17 +573,29 @@@}@media (max-width: 760px) {- .projects-page-inner {- width: calc(100% - 28px);- padding-top: 24px;- }-- .projects-card-grid {+ .projects-card-grid,+ .project-output-grid {grid-template-columns: repeat(2, minmax(0, 1fr));}+ }- .projects-category-tabs {- grid-template-columns: repeat(3, minmax(112px, 1fr));- overflow-x: auto;+ @media (max-width: 460px) {+ .projects-card-grid,+ .project-output-grid {+ grid-template-columns: 1fr;}++ .projects-library-heading {+ align-items: flex-start;+ flex-direction: column;+ gap: 10px;+ }++ .projects-batch-actions {+ width: 100%;+ justify-content: flex-start;+ flex-wrap: wrap;+ }}@media (max-width: 620px) {diff --cc apps/web/src/styles/app-css.test.tsindex 5a38dca8,39285493..da717eea--- a/apps/web/src/styles/app-css.test.ts+++ b/apps/web/src/styles/app-css.test.ts@@@ -36,20 -38,41 +38,55 @@@ function hexChannels(value: string): nu}describe('app CSS visual contracts', () => {+ it('keeps the video template marker centered, subdued and non-interactive', () => {+ const marker = cssBlock('.creator-template-play-marker');+ expect(marker).toContain('--creator-template-play-size: 40px;');+ expect(marker).toContain('--creator-template-play-background-opacity: 0.28;');+ expect(marker).toContain('--creator-template-play-icon-opacity: 0.5;');+ expect(marker).toContain('position: absolute;');+ expect(marker).toContain('top: 50%;');+ expect(marker).toContain('left: 50%;');+ expect(marker).toContain('transform: translate(-50%, -50%);');+ expect(marker).toContain('pointer-events: none;');+ expect(marker).not.toMatch(/box-shadow:|border:|transition:|animation:/);+ expect(cssBlock('.creator-template-play-marker svg')).toContain('width: 40%;');+ });++ it('uses one content frame for the workbench and projects pages', () => {+ expect(cssBlock('.opencreator-page-content')).toContain('width: min(1160px, calc(100% - 48px));');+ expect(cssBlock('.opencreator-page-content')).toContain('margin: 0 auto;');+ expect(cssBlock('.opencreator-page-content')).toContain('padding: var(--page-title-inset) 0 56px;');+ expect(cssBlock('.opencreator-scroll-page')).toContain('scrollbar-gutter: stable;');+ expect(appCss).toMatch(/@media \(max-width: 760px\)\s*\{\s*\.opencreator-page-content\s*\{\s*width: calc\(100% - 28px\);\s*padding: 24px 0 40px;/);+ expect(dashboardPageTsx).toContain('className="opencreator-scroll-page creator-tools-page"');+ expect(projectsPageTsx).toContain('className="opencreator-scroll-page projects-page"');+ expect(dashboardPageTsx).toContain('className="opencreator-page-content creator-tools-page-inner"');+ expect(projectsPageTsx).toContain('className="opencreator-page-content projects-page-inner"');+ });++ it('spaces primary navigation rows without changing the project tree spacing', () => {+ expect(cssBlock('.sidebar-primary')).toContain('gap: 6px;');+ expect(cssBlock('.sidebar-project-tree')).not.toContain('gap: 6px;');+ expect(cssBlock('.sidebar-primary .sidebar-row')).toContain('height: var(--control-compact-lg);');+ });++ it('keeps navigation icons unframed while the selected row owns the highlight', () => {+ const icon = cssBlock('.sidebar-nav-icon');+ const selectedRow = cssBlock('.sidebar-primary .sidebar-row[aria-current="page"]');+ const selectedIcon = cssBlock('.sidebar-primary .sidebar-row[aria-current="page"] .sidebar-nav-icon');+ const hoveredIcon = cssBlock('.sidebar-primary .sidebar-row:hover .sidebar-nav-icon');++ expect(icon).toContain('background: transparent;');+ expect(icon).toContain('border: 0;');+ expect(icon).not.toContain('border-radius:');+ expect(selectedRow).toContain('background:');+ expect(selectedRow).toContain('border-color:');+ expect(selectedIcon).toContain('color: var(--accent-strong);');+ for (const state of [selectedIcon, hoveredIcon]) {+ expect(state).not.toMatch(/background|border|box-shadow/);+ }+ });+it('keeps body copy readable and navigation or status text at 12px or larger', () => {const productCss = [appCss, skillMarketCss, schedulesCss, settingsCss, taskCenterCss].join('\n');@@@ -709,18 -780,19 +794,18 @@@expect(emptyComposer).toContain('overflow-y: auto;');expect(emptyComposer).toContain('padding: clamp(72px, 13vh, 128px) var(--conversation-gutter) 56px;');expect(cssBlock('.conversation-page.is-empty .composer-stack')).toContain('width: min(760px, 100%);');+ expect(cssBlock('.creator-home-wrap')).toContain('overflow-y: auto;');+ expect(cssBlock('.creator-home-wrap .creator-dashboard')).toContain('margin: 0 auto;');+ expect(cssBlock('.creator-template-tabs')).toContain('grid-template-columns: repeat(4, minmax(0, 1fr));');expect(cssBlock('.creator-template-tabs')).toContain('width: min(760px, 100%);');- expect(cssBlock('.creator-template-tabs')).toContain('grid-template-columns: repeat(3, minmax(max-content, 1fr));');- expect(cssBlock('.creator-tool-grid')).toContain('grid-template-columns: repeat(3, minmax(0, 1fr));');- expect(cssBlock('.creator-template-grid')).toContain('grid-template-columns: repeat(5, minmax(0, 1fr));');- expect(cssBlock('.creator-template-grid')).toContain('gap: 12px;');- expect(cssBlock('.creator-template-copy')).toContain('padding: 9px 10px 11px;');- expect(appCss).toMatch(- /@media \(max-width: 1100px\) and \(min-width: 921px\)\s*\{[\s\S]*?\.creator-template-grid\s*\{[^}]*grid-template-columns:\s*repeat\(3, minmax\(0, 1fr\)\);/- );+ expect(cssBlock('.creator-template-grid')).toContain('grid-template-columns: repeat(4, minmax(0, 1fr));');+ expect(cssBlock('.creator-template-grid')).toContain('gap: 10px;');+ expect(cssBlock('.creator-template-copy')).toContain('min-height: 40px;');+ expect(cssBlock('.creator-template-copy')).toContain('padding: 9px 10px;');expect(appCss).toMatch(/\.conversation-page\.is-empty \.opencreator-composer textarea\s*\{[^}]*min-height:\s*72px;/);expect(appCss).not.toContain('translateY(clamp(-150px, -14vh, -108px))');- expect(tokensCss).toContain('--border-hairline: rgba(245, 245, 246, 0.08);');- expect(tokensCss).toContain('--border-hairline: rgba(24, 24, 27, 0.07);');+ expect(tokensCss).toContain('--border-hairline: rgba(229, 229, 229, 0.08);');+ expect(tokensCss).toContain('--border-hairline: rgba(10, 10, 10, 0.07);');expect(cssBlock('.opencreator-composer')).toContain('border: 1px solid var(--composer-border);');expect(cssBlock('.opencreator-composer.without-project-selector')).toContain('background: var(--composer-input-background);'