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
feat: refine dashboard layout and desktop experience
米饭二两54dadaf2ec81
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.ymlindex e6de0381..fb3fba61 100644--- a/.github/workflows/desktop-release.yml+++ b/.github/workflows/desktop-release.yml@@ -122,6 +122,11 @@ jobs:exit 1fi- uses: actions/checkout@v4+ - name: 选择支持自适应图标的 Xcode+ if: matrix.platform == 'darwin'+ uses: maxim-lobanov/setup-xcode@v1+ with:+ xcode-version: latest-stable- uses: pnpm/action-setup@v4- uses: actions/setup-node@v4with:diff --git a/apps/desktop/e2e/creator-packaged-app.spec.ts b/apps/desktop/e2e/creator-packaged-app.spec.tsindex 1f201932..6fa87046 100644--- a/apps/desktop/e2e/creator-packaged-app.spec.ts+++ b/apps/desktop/e2e/creator-packaged-app.spec.ts@@ -36,6 +36,397 @@ const OVERSIZED_WAVE_PCM_BYTES = 10 * 1024 * 1024 + 4096;const 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.setTimeout(180_000);const fixture = await launchCreatorDesktop();@@ -291,7 +682,7 @@ test('实际 Desktop 包创建并重启恢复 Creator Job,且使用内嵌 Runtawait expect(currentApp.page.getByRole('heading', { name: '图像生成' })).toBeVisible();await expect(currentApp.page.getByRole('textbox', { name: '提示词' })).toBeVisible();- await currentApp.page.getByRole('button', { name: '工作台' }).click();+ await currentApp.page.locator('.creator-workspace-header').getByRole('button', { name: '返回' }).click();await expect(currentApp.page.getByRole('heading', { name: '工作台' })).toBeVisible();await currentApp.page.getByRole('button', { name: /^视频切片/ }).click();const clipWorkspace = currentApp.page.getByRole('region', { name: '视频切片 操作区' });@@ -301,8 +692,9 @@ test('实际 Desktop 包创建并重启恢复 Creator Job,且使用内嵌 Runtawait clipWorkspace.getByRole('button', { name: '下一步:切片设置' }).click();await clipWorkspace.getByRole('combobox', { name: '内容重点' }).selectOption('knowledge');await clipWorkspace.getByRole('combobox', { name: '目标时长' }).selectOption('30-60');- await clipWorkspace.getByRole('spinbutton', { name: '候选数量' }).fill('8');+ await clipWorkspace.getByRole('spinbutton', { name: '切片数量' }).fill('8');await clipWorkspace.getByRole('combobox', { name: '输出画幅' }).selectOption('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 () => (@@ -718,7 +1110,7 @@ function hasWhisperKitDependency(root: string): boolean {));}-async function launchCreatorDesktop(): Promise<{+async function launchCreatorDesktop(windowBounds?: { width: number; height: number }): Promise<{app: PackagedApp;root: string;ytDlpBin: string;@@ -730,7 +1122,7 @@ async function launchCreatorDesktop(): Promise<{const userData = join(root, 'user-data');const codexBin = writeCodexShim(binDir);const ytDlpBin = writeYtDlpShim(binDir);- writeOpenCreatorConfig(join(root, '.opencreator'), codexBin);+ writeOpenCreatorConfig(join(root, '.opencreator'), codexBin, windowBounds);const app = await launchPackagedApp({executablePath: packagedExecutable(desktopDir),@@ -1005,7 +1397,11 @@ function writeYtDlpShim(binDir: string): string {return scriptPath;}-function writeOpenCreatorConfig(productHome: string, codexBin: string): void {+function writeOpenCreatorConfig(+ productHome: string,+ codexBin: string,+ windowBounds?: { width: number; height: number }+): void {mkdirSync(productHome, { recursive: true });writeFileSync(join(productHome, 'config.toml'),@@ -1016,6 +1412,12 @@ function writeOpenCreatorConfig(productHome: string, codexBin: string): void {'close_behavior = "quit"','notifications_enabled = false','',+ ...(windowBounds === undefined ? [] : [+ '[desktop.window]',+ `width = ${windowBounds.width}`,+ `height = ${windowBounds.height}`,+ ''+ ]),'[runtime]','codex_mode = "external"',`external_codex_bin = ${JSON.stringify(codexBin)}`,diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.ymlindex d83186a2..7be9a9d5 100644--- a/apps/desktop/electron-builder.yml+++ b/apps/desktop/electron-builder.yml@@ -68,6 +68,7 @@ afterSign: ./scripts/notarize-after-sign.mjsmac:category: public.app-category.developer-toolsextendInfo:+ CFBundleIconName: OpenCreatorCFBundleDevelopmentRegion: zh_CNCFBundleLocalizations:- zh_CNdiff --git a/apps/desktop/resources/OpenCreator.icon/Assets/mark.svg b/apps/desktop/resources/OpenCreator.icon/Assets/mark.svgnew file mode 100644index 00000000..c31142bf--- /dev/null+++ b/apps/desktop/resources/OpenCreator.icon/Assets/mark.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 460 460">+ <polygon points="308,125 292,126 278,135 270,150 272,169 278,178 289,186 296,188 319,186 329,190 337,200 339,213 331,228 217,342 209,360 208,384 214,401 228,419 399,250 405,238 404,217 392,202 381,198 352,199 337,188 331,175 333,151 330,141 319,129" fill="#111113"/>+ <polygon points="230,39 59,208 53,220 54,241 59,250 72,259 96,259 115,246 125,246 137,255 139,270 128,287 125,307 129,319 139,329 150,333 162,333 175,328 261,242 267,231 268,218 264,207 258,199 244,191 227,191 219,195 171,240 155,238 145,225 147,211 234,124 246,106 251,85 249,69 242,53" fill="#111113"/>+</svg>diff --git a/apps/desktop/resources/OpenCreator.icon/icon.json b/apps/desktop/resources/OpenCreator.icon/icon.jsonnew file mode 100644index 00000000..1f7c7efa--- /dev/null+++ b/apps/desktop/resources/OpenCreator.icon/icon.json@@ -0,0 +1,25 @@+{+ "fill-specializations": [+ { "value": { "solid": "srgb:1.00000,1.00000,1.00000,1.00000" } },+ { "appearance": "dark", "value": { "solid": "srgb:0.06667,0.06667,0.07451,1.00000" } }+ ],+ "groups": [+ {+ "layers": [+ {+ "name": "OpenCreator",+ "image-name": "mark.svg",+ "glass": false,+ "fill-specializations": [+ { "value": { "solid": "srgb:0.06667,0.06667,0.07451,1.00000" } },+ { "appearance": "dark", "value": { "solid": "srgb:1.00000,1.00000,1.00000,1.00000" } }+ ]+ }+ ],+ "shadow": { "kind": "neutral", "opacity": 0 },+ "specular": false,+ "translucency": { "enabled": false, "value": 0 }+ }+ ],+ "supported-platforms": { "squares": ["macOS"] }+}diff --git a/apps/desktop/scripts/mac-app-icon.mjs b/apps/desktop/scripts/mac-app-icon.mjsnew file mode 100644index 00000000..e4b8ea3e--- /dev/null+++ b/apps/desktop/scripts/mac-app-icon.mjs@@ -0,0 +1,87 @@+import { execFileSync } from 'node:child_process';+import { copyFileSync, existsSync, mkdirSync, mkdtempSync, rmSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';++export function assertMacAppIconRenditions(entries) {+ for (const appearance of ['NSAppearanceNameAqua', 'NSAppearanceNameDarkAqua']) {+ const stack = entries.find(entry => (+ entry.AssetType === 'IconImageStack'+ && entry.Name === 'OpenCreator'+ && entry.Appearance === appearance+ ));+ const group = entries.find(entry => (+ entry.AssetType === 'IconGroup'+ && entry.Name === 'OpenCreator/Group'+ && entry.Appearance === appearance+ ));+ if (stack === undefined || group?.Layers?.length !== 1) {+ throw new Error(`macOS app icon catalog is missing the ${appearance} rendition.`);+ }+ if (appearance === 'NSAppearanceNameDarkAqua') {+ const color = entries.find(entry => (+ entry.AssetType === 'Color'+ && entry.Name === group.Layers[0].LayerGradientColorName+ ));+ if (color?.['Color components']?.some(component => component !== 1)+ || color?.['Color components']?.length !== 4) {+ throw new Error('macOS dark app icon must use an opaque white brand mark.');+ }+ }+ }+}++export function verifyMacAppIconCatalog(path, options = {}) {+ const run = options.execFileSync ?? execFileSync;+ const entries = JSON.parse(run('xcrun', ['assetutil', '--info', path], {+ encoding: 'utf8', timeout: 30_000+ }));+ assertMacAppIconRenditions(entries);+}++export function prepareMacAppIcon(context, options = {}) {+ if (context.electronPlatformName !== 'darwin') return;++ const run = options.execFileSync ?? execFileSync;+ const version = run('xcrun', [+ 'actool', '--version', '--output-format', 'human-readable-text'+ ], { encoding: 'utf8', timeout: 30_000 });+ const majorVersion = Number(version.match(/short-bundle-version:\s*(\d+)/)?.[1]);+ if (!Number.isInteger(majorVersion) || majorVersion < 26) {+ throw new Error('macOS adaptive app icons require Xcode 26 or newer (actool >= 26).');+ }++ const iconName = 'OpenCreator';+ const source = join(context.packager.projectDir, 'resources', `${iconName}.icon`);+ const resources = join(+ context.appOutDir,+ `${context.packager.appInfo.productFilename}.app`,+ 'Contents',+ 'Resources'+ );+ const output = mkdtempSync(join(tmpdir(), 'opencreator-app-icon-'));+ try {+ run('xcrun', [+ 'actool', source,+ '--compile', output,+ '--output-format', 'human-readable-text',+ '--output-partial-info-plist', join(output, 'icon-info.plist'),+ '--app-icon', iconName,+ '--include-all-app-icons',+ '--enable-on-demand-resources', 'NO',+ '--target-device', 'mac',+ '--minimum-deployment-target', '12.0',+ '--platform', 'macosx'+ ], { encoding: 'utf8', timeout: 120_000 });+ const catalog = join(output, 'Assets.car');+ if (!existsSync(catalog)) {+ throw new Error('actool did not generate the macOS adaptive icon catalog.');+ }+ verifyMacAppIconCatalog(catalog, { execFileSync: run });+ mkdirSync(resources, { recursive: true });+ // Keep icon.icns as the fallback on macOS versions without adaptive icons.+ copyFileSync(catalog, join(resources, 'Assets.car'));+ } finally {+ rmSync(output, { recursive: true, force: true });+ }+}diff --git a/apps/desktop/scripts/sign-creator-runtime-after-pack.mjs b/apps/desktop/scripts/sign-creator-runtime-after-pack.mjsindex c22ee568..7ea0c3a4 100644--- a/apps/desktop/scripts/sign-creator-runtime-after-pack.mjs+++ b/apps/desktop/scripts/sign-creator-runtime-after-pack.mjs@@ -14,6 +14,7 @@ import { spawnSync } from 'node:child_process';import { verifyCreatorRuntime } from './creator-runtime-contract.mjs';import { verifyStickmanRuntime } from './stickman-runtime-contract.mjs';import { findDeveloperIdIdentity } from './mac-signing.mjs';+import { prepareMacAppIcon } from './mac-app-icon.mjs';const machOMagicValues = new Set(['feedface',@@ -27,6 +28,7 @@ const machOMagicValues = new Set([]);export async function afterPack(context) {+ prepareMacAppIcon(context);if (process.env.OPENCREATOR_SIGN_CREATOR_RUNTIME !== '1') return;await signDaemonRuntimeBundle(context);await signCreatorRuntimeBundle(context);diff --git a/apps/desktop/scripts/verify-package.mjs b/apps/desktop/scripts/verify-package.mjsindex 0cb6aac8..05608f2b 100644--- a/apps/desktop/scripts/verify-package.mjs+++ b/apps/desktop/scripts/verify-package.mjs@@ -30,6 +30,7 @@ import { spawnSync } from 'node:child_process';import { fileURLToPath } from 'node:url';import { verifyCreatorRuntime } from './creator-runtime-contract.mjs';import { verifyCodexRuntime } from './codex-runtime-contract.mjs';+import { verifyMacAppIconCatalog } from './mac-app-icon.mjs';import {hashDirectory as hashStickmanDirectory,hashFile as hashStickmanFile,@@ -206,6 +207,25 @@ function assertBrandingContents() {if (process.platform === 'darwin') {assertExists(join(resourcesDir, 'icon.icns'));+ assertExists(join(resourcesDir, 'Assets.car'));+ verifyMacAppIconCatalog(join(resourcesDir, 'Assets.car'));+ const iconName = spawnSync('plutil', [+ '-extract', 'CFBundleIconName', 'raw', '-o', '-',+ join(packageRoot, 'Contents', 'Info.plist')+ ], { encoding: 'utf8', timeout: 30_000 });+ if (iconName.status !== 0 || iconName.stdout.trim() !== 'OpenCreator') {+ throw new Error('Packaged macOS app does not reference the adaptive icon catalog.');+ }+ assertSameFile(+ 'macOS adaptive icon definition',+ join(desktopResourcesDir, 'OpenCreator.icon', 'icon.json'),+ join(sourceResourcesDir, 'OpenCreator.icon', 'icon.json')+ );+ assertSameFile(+ 'macOS adaptive icon brand mark',+ join(desktopResourcesDir, 'OpenCreator.icon', 'Assets', 'mark.svg'),+ join(sourceResourcesDir, 'OpenCreator.icon', 'Assets', 'mark.svg')+ );}}diff --git a/apps/desktop/src/bootstrap/index.html b/apps/desktop/src/bootstrap/index.htmlindex 870d2d61..911f6440 100644--- a/apps/desktop/src/bootstrap/index.html+++ b/apps/desktop/src/bootstrap/index.html@@ -7,6 +7,11 @@<link rel="stylesheet" href="./style.css" /></head><body>+ <div class="desktop-window-controls" role="group" aria-label="窗口控制" hidden>+ <button type="button" data-action="close" aria-label="关闭窗口" title="关闭窗口"><span aria-hidden="true">×</span></button>+ <button type="button" data-action="minimize" aria-label="最小化窗口" title="最小化窗口"><span aria-hidden="true">−</span></button>+ <button type="button" data-action="zoom" aria-label="缩放窗口" title="缩放窗口"><span aria-hidden="true">+</span></button>+ </div><main class="bootstrap-shell"><section class="bootstrap-panel" aria-live="polite"><span class="brand-name">OpenCreator</span>diff --git a/apps/desktop/src/bootstrap/main.ts b/apps/desktop/src/bootstrap/main.tsindex 40e7aa43..86bbdc0f 100644--- a/apps/desktop/src/bootstrap/main.ts+++ b/apps/desktop/src/bootstrap/main.ts@@ -15,6 +15,7 @@ type BootstrapApi = {restartRuntime(): Promise<unknown>;exportDiagnostics(): Promise<unknown>;quit(): Promise<void>;+ controlWindow?(action: 'close' | 'minimize' | 'zoom'): Promise<void>;};declare global {@@ -39,6 +40,17 @@ if ('--opencreator-traffic-light-inset',`${api.windowChrome.trafficLightInset}px`);+ if (api.controlWindow !== undefined) {+ const controls = document.querySelector<HTMLElement>('.desktop-window-controls')!;+ controls.hidden = false;+ controls.addEventListener('click', event => {+ const button = (event.target as HTMLElement).closest<HTMLButtonElement>('button[data-action]');+ const action = button?.dataset.action;+ if (action === 'close' || action === 'minimize' || action === 'zoom') {+ void api.controlWindow!(action).catch(error => console.error('Failed to control desktop window', error));+ }+ });+ }}const title = element('status-title');diff --git a/apps/desktop/src/bootstrap/style.css b/apps/desktop/src/bootstrap/style.cssindex 1ee6d4e3..72339782 100644--- a/apps/desktop/src/bootstrap/style.css+++ b/apps/desktop/src/bootstrap/style.css@@ -47,6 +47,38 @@ button {user-select: none;}+.desktop-window-controls {+ position: fixed;+ z-index: 20;+ top: 0;+ left: 10px;+ height: var(--opencreator-titlebar-height, 38px);+ display: flex;+ align-items: center;+ gap: 6px;+ -webkit-app-region: no-drag;+}++.desktop-window-controls button {+ width: 16px;+ height: 16px;+ display: grid;+ place-items: center;+ padding: 0;+ border: 1px solid rgba(0, 0, 0, 0.2);+ border-radius: 50%;+ color: rgba(0, 0, 0, 0.65);+ cursor: default;+ -webkit-app-region: no-drag;+}++.desktop-window-controls button span { opacity: 0; font-size: 12px; line-height: 1; }+.desktop-window-controls:hover button span,+.desktop-window-controls button:focus-visible span { opacity: 1; }+.desktop-window-controls button[data-action="close"] { background: #ff5f57; }+.desktop-window-controls button[data-action="minimize"] { background: #febc2e; }+.desktop-window-controls button[data-action="zoom"] { background: #28c840; }+.bootstrap-panel {display: flex;width: min(520px, 100%);diff --git a/apps/desktop/src/main/main.ts b/apps/desktop/src/main/main.tsindex 023c7f14..71b0dd63 100644--- a/apps/desktop/src/main/main.ts+++ b/apps/desktop/src/main/main.ts@@ -412,6 +412,18 @@ function registerIpcHandlers(input: {telemetryEnabled: updated.telemetryEnabled};});+ handle(desktopIpc.setWindowColorMode, input.development, (_event, mode: unknown) => {+ if (process.platform !== 'darwin' || (mode !== 'light' && mode !== 'dark')) {+ throw new Error('Invalid macOS window color mode');+ }+ input.windowManager.setColorMode(mode);+ });+ handle(desktopIpc.controlWindow, input.development, (_event, action: unknown) => {+ if (process.platform !== 'darwin' || (action !== 'close' && action !== 'minimize' && action !== 'zoom')) {+ throw new Error('Invalid macOS window action');+ }+ input.windowManager.controlWindow(action as 'close' | 'minimize' | 'zoom');+ });handle(desktopIpc.openExternal, input.development, async (_event, url: unknown) => {if (typeof url !== 'string') throw new Error('URL must be a string');await openExternal(url);diff --git a/apps/desktop/src/main/window-manager.ts b/apps/desktop/src/main/window-manager.tsindex 139e5b1a..d8da8ff8 100644--- a/apps/desktop/src/main/window-manager.ts+++ b/apps/desktop/src/main/window-manager.ts@@ -1,6 +1,7 @@import { join } from 'node:path';import {BrowserWindow,+ nativeTheme,screen,shell} from 'electron';@@ -8,6 +9,8 @@ import type { BrowserWindowConstructorOptions } from 'electron';import type { SettingsStore } from './settings-store.js';import {DESKTOP_TITLE_BAR_HEIGHT,+ type DesktopWindowAction,+ type DesktopWindowColorMode,type DesktopStartupMetrics} from '../shared/types.js';@@ -54,6 +57,7 @@ export class DebouncedWindowStateWriter {export class WindowManager {private window: BrowserWindow | undefined;+ private colorMode: DesktopWindowColorMode = 'dark';private quitting = false;private workspaceReady:| {@@ -84,6 +88,7 @@ export class WindowManager {create(): BrowserWindow {if (this.window !== undefined && !this.window.isDestroyed()) return this.window;+ if (process.platform === 'darwin') nativeTheme.themeSource = this.colorMode;const settings = this.input.settings.read();const bounds = visibleBounds(settings.window);const window = new BrowserWindow({@@ -92,7 +97,7 @@ export class WindowManager {minWidth: 980,minHeight: 680,show: false,- backgroundColor: '#f3f4f6',+ backgroundColor: nativeWindowBackgroundColor(this.colorMode),title: 'OpenCreator',webPreferences: {nodeIntegration: false,@@ -101,6 +106,7 @@ export class WindowManager {preload: this.input.preloadPath}});+ if (process.platform === 'darwin') window.setWindowButtonVisibility(false);this.startupMetrics.windowCreatedAt ??= Date.now();this.window = window;if (settings.window?.maximized === true) window.maximize();@@ -254,6 +260,21 @@ export class WindowManager {window.focus();}+ setColorMode(mode: DesktopWindowColorMode): void {+ if (process.platform !== 'darwin') return;+ this.colorMode = mode;+ nativeTheme.themeSource = mode;+ if (this.window !== undefined && !this.window.isDestroyed()) {+ this.window.setBackgroundColor(nativeWindowBackgroundColor(mode));+ }+ }++ controlWindow(action: DesktopWindowAction): void {+ const window = this.window;+ if (window === undefined || window.isDestroyed()) return;+ applyWindowAction(window, action);+ }+isActive(): boolean {return this.window !== undefined&& !this.window.isDestroyed()@@ -291,6 +312,16 @@ export class WindowManager {}}+export function applyWindowAction(+ window: Pick<BrowserWindow, 'close' | 'minimize' | 'isMaximized' | 'maximize' | 'unmaximize'>,+ action: DesktopWindowAction+): void {+ if (action === 'close') window.close();+ else if (action === 'minimize') window.minimize();+ else if (window.isMaximized()) window.unmaximize();+ else window.maximize();+}+export function nativeWindowChromeOptions(platform: NodeJS.Platform): Pick<@@ -307,6 +338,10 @@ export function nativeWindowChromeOptions(};}+export function nativeWindowBackgroundColor(mode: DesktopWindowColorMode): string {+ return mode === 'dark' ? '#0a0a0a' : '#e5e5e5';+}+function visibleBounds(saved: ReturnType<SettingsStore['read']>['window']): { x?: number; y?: number; width: number; height: number } {diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.tsindex 9e7b5670..767384a4 100644--- a/apps/desktop/src/preload/index.ts+++ b/apps/desktop/src/preload/index.ts@@ -42,6 +42,14 @@ const api: DesktopApi = {readDesktopPreferences: () => ipcRenderer.invoke(desktopIpc.readPreferences),updateDesktopPreferences: preferences =>ipcRenderer.invoke(desktopIpc.updatePreferences, preferences),+ ...(process.platform === 'darwin'+ ? {+ setWindowColorMode: (mode: 'light' | 'dark') =>+ ipcRenderer.invoke(desktopIpc.setWindowColorMode, mode),+ controlWindow: (action: 'close' | 'minimize' | 'zoom') =>+ ipcRenderer.invoke(desktopIpc.controlWindow, action)+ }+ : {}),openExternal: url => ipcRenderer.invoke(desktopIpc.openExternal, url),revealPath: path => ipcRenderer.invoke(desktopIpc.revealPath, path),notify: message => ipcRenderer.invoke(desktopIpc.notify, message),diff --git a/apps/desktop/src/shared/ipc.ts b/apps/desktop/src/shared/ipc.tsindex af6ddf27..be32e41b 100644--- a/apps/desktop/src/shared/ipc.ts+++ b/apps/desktop/src/shared/ipc.ts@@ -11,6 +11,8 @@ export const desktopIpc = {workspaceReady: 'opencreator:workspace:ready',readPreferences: 'opencreator:preferences:read',updatePreferences: 'opencreator:preferences:update',+ setWindowColorMode: 'opencreator:window:color-mode',+ controlWindow: 'opencreator:window:control',openExternal: 'opencreator:native:open-external',revealPath: 'opencreator:native:reveal-path',notify: 'opencreator:notification:show',diff --git a/apps/desktop/src/shared/types.ts b/apps/desktop/src/shared/types.tsindex b96d6330..b44b2887 100644--- a/apps/desktop/src/shared/types.ts+++ b/apps/desktop/src/shared/types.ts@@ -84,6 +84,9 @@ export type DesktopWindowChrome =trafficLightInset: number;};+export type DesktopWindowColorMode = 'light' | 'dark';+export type DesktopWindowAction = 'close' | 'minimize' | 'zoom';+export type DesktopHostResult =| { ok: true }| { ok: false; code: 'UNSUPPORTED' | 'FAILED'; message: string };@@ -116,6 +119,8 @@ export type DesktopApi = {updateDesktopPreferences(preferences: Partial<DesktopPreferences>): Promise<DesktopPreferences>;+ setWindowColorMode?(mode: DesktopWindowColorMode): Promise<void>;+ controlWindow?(action: DesktopWindowAction): Promise<void>;openExternal(url: string): Promise<void>;revealPath(path: string): Promise<DesktopHostResult>;notify(message: DesktopHostNotification): Promise<void>;diff --git a/apps/desktop/test/mac-app-icon.test.mjs b/apps/desktop/test/mac-app-icon.test.mjsnew file mode 100644index 00000000..0f416954--- /dev/null+++ b/apps/desktop/test/mac-app-icon.test.mjs@@ -0,0 +1,120 @@+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+import { afterEach, describe, expect, it, vi } from 'vitest';+import {+ assertMacAppIconRenditions,+ prepareMacAppIcon+} from '../scripts/mac-app-icon.mjs';++const temporaryDirectories = [];+afterEach(() => {+ for (const directory of temporaryDirectories.splice(0)) {+ rmSync(directory, { recursive: true, force: true });+ }+});++describe('macOS adaptive app icons', () => {+ it('keeps the existing brand geometry and defines a white mark for dark mode', () => {+ const icon = JSON.parse(readFileSync(+ new URL('../resources/OpenCreator.icon/icon.json', import.meta.url), 'utf8'+ ));+ const mark = readFileSync(+ new URL('../resources/OpenCreator.icon/Assets/mark.svg', import.meta.url), 'utf8'+ );+ const legacy = readFileSync(new URL('../resources/icon.svg', import.meta.url), 'utf8');+ expect(mark.match(/<polygon[^>]+>/g)).toEqual(legacy.match(/<polygon[^>]+>/g));+ expect(mark).not.toContain('<rect');+ expect(icon.groups[0].layers[0]['fill-specializations'].find(+ fill => fill.appearance === 'dark'+ ).value.solid).toBe('srgb:1.00000,1.00000,1.00000,1.00000');+ const config = readFileSync(new URL('../electron-builder.yml', import.meta.url), 'utf8');+ expect(config).toContain('CFBundleIconName: OpenCreator');+ expect(config).toContain('icon: resources/icon.png');+ });++ it('does not invoke macOS tools for Windows or Linux', () => {+ const run = vi.fn();+ for (const platform of ['win32', 'linux']) {+ prepareMacAppIcon({ electronPlatformName: platform }, { execFileSync: run });+ }+ expect(run).not.toHaveBeenCalled();+ });++ it.each(['16.4', 'unknown'])('blocks packaging with unsupported actool %s', version => {+ expect(() => prepareMacAppIcon(+ { electronPlatformName: 'darwin' },+ { execFileSync: () => `short-bundle-version: ${version}` }+ )).toThrow(/Xcode 26 or newer/);+ });++ it('compiles and validates the catalog before copying it, without replacing the legacy icon', () => {+ const context = createContext();+ mkdirSync(resources(context), { recursive: true });+ writeFileSync(join(resources(context), 'icon.icns'), 'legacy-icon');+ let output;+ const run = vi.fn((_command, args) => {+ if (args.includes('--version')) return 'short-bundle-version: 26.1';+ if (args[0] === 'assetutil') return JSON.stringify(catalogEntries());+ output = args[args.indexOf('--compile') + 1];+ writeFileSync(join(output, 'Assets.car'), 'adaptive-icon-catalog');+ return '';+ });+ prepareMacAppIcon(context, { execFileSync: run });+ expect(readFileSync(join(resources(context), 'Assets.car'), 'utf8')).toBe('adaptive-icon-catalog');+ expect(readFileSync(join(resources(context), 'icon.icns'), 'utf8')).toBe('legacy-icon');+ expect(run.mock.calls[1][1]).toContain(join(context.packager.projectDir, 'resources', 'OpenCreator.icon'));+ expect(run.mock.calls[1][1]).toContain('12.0');+ expect(existsSync(output)).toBe(false);+ });++ it('fails instead of silently packaging an absent catalog and cleans up temporary output', () => {+ const context = createContext();+ let output;+ const run = vi.fn((_command, args) => {+ if (args.includes('--version')) return 'short-bundle-version: 26.1';+ output = args[args.indexOf('--compile') + 1];+ return '';+ });+ expect(() => prepareMacAppIcon(context, { execFileSync: run })).toThrow(/did not generate/);+ expect(existsSync(output)).toBe(false);+ expect(existsSync(join(resources(context), 'Assets.car'))).toBe(false);+ });++ it('rejects missing dark mode and a dark brand mark in the compiled catalog', () => {+ const entries = catalogEntries();+ expect(() => assertMacAppIconRenditions(entries)).not.toThrow();+ expect(() => assertMacAppIconRenditions(entries.filter(+ entry => entry.Appearance !== 'NSAppearanceNameDarkAqua'+ ))).toThrow(/missing/);+ entries[0]['Color components'] = [0.067, 0.067, 0.075, 1];+ expect(() => assertMacAppIconRenditions(entries)).toThrow(/opaque white/);+ });+});++function createContext() {+ const appOutDir = mkdtempSync(join(tmpdir(), 'opencreator-icon-test-'));+ temporaryDirectories.push(appOutDir);+ return {+ electronPlatformName: 'darwin',+ appOutDir,+ packager: { projectDir: appOutDir, appInfo: { productFilename: 'OpenCreator' } }+ };+}++function resources(context) {+ return join(context.appOutDir, 'OpenCreator.app', 'Contents', 'Resources');+}++function catalogEntries() {+ return [+ { AssetType: 'Color', Name: 'white', 'Color components': [1, 1, 1, 1] },+ ...['NSAppearanceNameAqua', 'NSAppearanceNameDarkAqua'].flatMap(appearance => [+ { AssetType: 'IconImageStack', Name: 'OpenCreator', Appearance: appearance },+ {+ AssetType: 'IconGroup', Name: 'OpenCreator/Group', Appearance: appearance,+ Layers: [{ LayerGradientColorName: 'white' }]+ }+ ])+ ];+}diff --git a/apps/desktop/test/window-manager.test.ts b/apps/desktop/test/window-manager.test.tsindex d2756781..9f7dfd75 100644--- a/apps/desktop/test/window-manager.test.ts+++ b/apps/desktop/test/window-manager.test.ts@@ -1,6 +1,8 @@import { describe, expect, it, vi } from 'vitest';import {+ applyWindowAction,DebouncedWindowStateWriter,+ nativeWindowBackgroundColor,nativeWindowChromeOptions} from '../src/main/window-manager.js';@@ -23,6 +25,26 @@ describe('Window state debounce', () => {});describe('Native window chrome', () => {+ it('keeps close behavior and toggles native minimize and zoom actions', () => {+ const window = {+ close: vi.fn(),+ minimize: vi.fn(),+ isMaximized: vi.fn(() => false),+ maximize: vi.fn(),+ unmaximize: vi.fn()+ };+ applyWindowAction(window, 'close');+ applyWindowAction(window, 'minimize');+ applyWindowAction(window, 'zoom');+ window.isMaximized.mockReturnValue(true);+ applyWindowAction(window, 'zoom');++ expect(window.close).toHaveBeenCalledOnce();+ expect(window.minimize).toHaveBeenCalledOnce();+ expect(window.maximize).toHaveBeenCalledOnce();+ expect(window.unmaximize).toHaveBeenCalledOnce();+ });+it('uses an inset native title bar on macOS', () => {expect(nativeWindowChromeOptions('darwin')).toEqual({titleBarStyle: 'hiddenInset',@@ -34,4 +56,9 @@ describe('Native window chrome', () => {expect(nativeWindowChromeOptions('win32')).toEqual({});expect(nativeWindowChromeOptions('linux')).toEqual({});});++ it('matches the native window background to the shared theme', () => {+ expect(nativeWindowBackgroundColor('dark')).toBe('#0a0a0a');+ expect(nativeWindowBackgroundColor('light')).toBe('#e5e5e5');+ });});diff --git a/apps/web/e2e/stickman-web-desktop-parity.spec.ts b/apps/web/e2e/stickman-web-desktop-parity.spec.tsindex b1492f88..cb6d15fe 100644--- a/apps/web/e2e/stickman-web-desktop-parity.spec.ts+++ b/apps/web/e2e/stickman-web-desktop-parity.spec.ts@@ -34,6 +34,162 @@ const viewports = [{ name: 'mobile', width: 390, height: 844 }] as const;+test('Creator 设置页组件间距和下拉箭头在 Browser/Desktop 下保持一致', async ({+ browser,+ runtime+}, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '内部覆盖桌面和移动内容视口');+ test.setTimeout(120_000);+ for (const viewport of [+ { width: 980, height: 1014, theme: 'dark' },+ { width: 1440, height: 900, theme: 'light' },+ { width: 390, height: 844, theme: 'dark' }+ ] as const) {+ const results = [];+ for (const platform of ['browser', 'desktop'] as const) {+ const fakeDaemon = new FakeStickmanDaemon(runtime.projectId);+ const context = await browser.newContext({+ viewport,+ colorScheme: viewport.theme,+ deviceScaleFactor: 1,+ reducedMotion: 'reduce',+ locale: 'zh-CN'+ });+ const page = await context.newPage();+ await fakeDaemon.attach(page);+ await installPlatformEnvironment(page, platform);+ try {+ await runtime.openApp(page, { currentProjectId: fakeDaemon.projectId });+ await page.goto(`${runtime.origin}/#/workbench?tool=stickman-video&jobId=${fakeDaemon.jobId}`);+ await page.locator('.stickman-steps button').first().click();+ await expect(page.locator('.stickman-style-summary')).toBeVisible();+ await page.evaluate(theme => { document.documentElement.dataset.theme = theme; }, viewport.theme);+ for (const source of ['输入文本', 'YouTube']) {+ await page.getByRole('tab', { name: source, exact: true }).click();+ await expect(page.getByRole('textbox', { name: source === 'YouTube' ? 'YouTube 链接' : '文本内容' })).toBeVisible();+ const geometry = await 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();+ const voiceSettings = panel.querySelector('.stickman-voice-settings')!.getBoundingClientRect();+ const imageNotice = panel.querySelector(':scope > .stickman-tts-configuration')!.getBoundingClientRect();+ return {+ sourceCharacterGap: Math.round(characters.top - source.bottom),+ serviceNoticeGap: Math.round(imageNotice.top - voiceSettings.bottom),+ selectTopDelta: Math.round(duration.top - style.top),+ rowGap: getComputedStyle(panel.querySelector('.creator-tool-form-row')!).gap,+ selects: Array.from(panel.querySelectorAll('.native-select select')).map(select => {+ const arrow = select.parentElement!.querySelector('svg')!.getBoundingClientRect();+ return {+ arrowInset: Math.round(select.getBoundingClientRect().right - arrow.right),+ textInset: getComputedStyle(select).paddingInlineEnd,+ appearance: getComputedStyle(select).appearance+ };+ })+ };+ });+ expect(geometry.sourceCharacterGap).toBe(16);+ expect(geometry.serviceNoticeGap).toBe(16);+ expect(geometry.rowGap).toBe('16px');+ if (viewport.width >= 700) expect(geometry.selectTopDelta).toBe(0);+ expect(geometry.selects.length).toBeGreaterThanOrEqual(2);+ for (const select of geometry.selects) {+ expect(select).toEqual({ arrowInset: 12, textInset: '40px', appearance: 'none' });+ }+ results.push(geometry);+ }+ await page.getByRole('combobox', { name: '目标时长' }).selectOption('60');+ await expect.poll(() => fakeDaemon.snapshot().state.targetDurationSeconds).toBe(60);+ await page.locator('.creator-tool-form-row').scrollIntoViewIfNeeded();+ await testInfo.attach(`creator-settings-${platform}-${viewport.width}-${viewport.theme}.png`, {+ body: await page.screenshot({ animations: 'disabled' }), contentType: 'image/png'+ });+ expect(fakeDaemon.unknownRequestPaths()).toEqual([]);+ } finally {+ await context.close();+ }+ }+ expect(results.slice(2)).toEqual(results.slice(0, 2));+ }+});++test('最小桌面宽度下 Browser/Desktop 协作输入区在缩放和滚动后保持贴底', async ({+ browser,+ runtime+}, testInfo) => {+ test.skip(testInfo.project.name !== 'chromium-desktop', '本规格固定验证桌面内容视口');+ const checkpoints: Checkpoint[] = [];+ const snapshots: FakeStickmanSnapshot[] = [];++ for (const platform of ['browser', 'desktop'] as const) {+ const fakeDaemon = new FakeStickmanDaemon(runtime.projectId);+ const context = await browser.newContext({+ viewport: { width: 980, height: 1014 },+ deviceScaleFactor: 1,+ colorScheme: 'dark',+ reducedMotion: 'reduce',+ locale: 'zh-CN'+ });+ const page = await context.newPage();+ await fakeDaemon.attach(page);+ await installPlatformEnvironment(page, platform);+ try {+ await runtime.openApp(page, { currentProjectId: fakeDaemon.projectId });+ await page.goto(`${runtime.origin}/#/workbench?tool=stickman-video&jobId=${fakeDaemon.jobId}`);+ await expect(page.getByRole('heading', { name: '火柴人动画' })).toBeVisible();+ await page.locator('.stickman-steps button').first().click();+ await expect(page.getByRole('heading', { name: '来源与角色', exact: true })).toBeVisible();++ for (const viewport of [+ { width: 980, height: 1014 },+ { width: 980, height: 680 },+ { width: 1120, height: 900 },+ { width: 1121, height: 900 },+ { width: 1440, height: 900 },+ { width: 980, height: 1014 }+ ]) {+ await page.setViewportSize(viewport);+ await expectCollaborationComposerAtBottom(page);+ await page.locator('.stickman-step-scroll').evaluate(element => {+ element.scrollTop = element.scrollHeight;+ });+ await expectCollaborationComposerAtBottom(page);+ }+ const checkpoint = await captureCheckpoint(page);+ checkpoints.push(checkpoint);+ snapshots.push(fakeDaemon.snapshot());+ await testInfo.attach(`stickman-min-width-${platform}.png`, {+ body: checkpoint.screenshot, contentType: 'image/png'+ });+ expect(fakeDaemon.unknownRequestPaths()).toEqual([]);+ } finally {+ await context.close();+ }+ }+ expect(checkpoints[1]!.text).toBe(checkpoints[0]!.text);+ expect(checkpoints[1]!.boxes).toEqual(checkpoints[0]!.boxes);+ expect(snapshots[1]).toEqual(snapshots[0]);+ const pixelDiff = await compareScreenshots(browser, checkpoints[0]!.screenshot, checkpoints[1]!.screenshot);+ expect(pixelDiff.maxChannelDelta).toBeLessThanOrEqual(1);+ expect(pixelDiff.differentPixels).toBeLessThanOrEqual(100);+});++async function expectCollaborationComposerAtBottom(page: Page): Promise<void> {+ await expect(page.getByRole('textbox', { name: '告诉 Agent 你的要求' })).toBeVisible();+ await expect.poll(() => page.evaluate(() => {+ const workspace = document.querySelector('.creator-workspace-layout')!.getBoundingClientRect();+ const panel = document.querySelector('.creator-collaboration-panel')!.getBoundingClientRect();+ const composer = document.querySelector('.creator-collaboration-panel .tool-agent-composer')!;+ const marginBottom = parseFloat(getComputedStyle(composer).marginBottom);+ return {+ panelBottomDelta: Math.round(panel.bottom - workspace.bottom),+ panelHeightDelta: Math.round(panel.height - workspace.height),+ composerBottomDelta: Math.round(composer.getBoundingClientRect().bottom + marginBottom - panel.bottom)+ };+ })).toEqual({ panelBottomDelta: 0, panelHeightDelta: 0, composerBottomDelta: 0 });+}+test('火柴人工作台在 Browser/Desktop Bridge 下保持同构并持久化同一结果', async ({browser,runtime@@ -365,9 +521,12 @@ async function captureCheckpoint(page: Page): Promise<Checkpoint> {'.creator-task-workspace','.stickman-delivery-content','.creator-collaboration-panel',+ '.creator-collaboration-panel .tool-agent-composer','.creator-result-files']) {- const box = await page.locator(selector).first().boundingBox();+ const element = page.locator(selector).first();+ if (await element.count() === 0) continue;+ const box = await element.boundingBox();if (box !== null) {boxes[selector] = {x: Math.round(box.x),diff --git a/apps/web/e2e/web-desktop-parity.spec.ts b/apps/web/e2e/web-desktop-parity.spec.tsindex 00feacaf..94b49136 100644--- a/apps/web/e2e/web-desktop-parity.spec.ts+++ b/apps/web/e2e/web-desktop-parity.spec.ts@@ -1,6 +1,567 @@import type { CreatorYtDlpStatusResponse } from '@opencreator/protocol';import { test, expect } from './fixtures/runtime.js';+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+ };+ 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'+ });+ }+ }+ 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();+ }+ }+ 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@@ -1046,14 +1607,20 @@ test('封面生成在桌面和移动视口保持可操作并从项目中心恢});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,value: {kind: 'desktop',+ ...(integratedTitleBar ? { windowChrome: {+ integratedTitleBar: true,+ titleBarHeight: 38,+ trafficLightInset: 76+ } } : {}),readConnectionConfig: async () => ({ baseUrl: '/.opencreator/runtime' }),subscribeConnectionConfig: () => () => undefined,restartRuntime: async () => success,@@ -1075,7 +1642,7 @@ async function installDesktopBridge(subscribeNavigation: () => () => undefined}});- });+ }, integratedTitleBar);}function normalizeParityText(value: string): string {diff --git a/apps/web/src/app/App.test.tsx b/apps/web/src/app/App.test.tsxindex d4f1c8d2..4b309f0a 100644--- a/apps/web/src/app/App.test.tsx+++ b/apps/web/src/app/App.test.tsx@@ -726,9 +726,31 @@ describe('App', () => {expect(shell?.style.getPropertyValue('--opencreator-titlebar-height')).toBe('38px');expect(shell?.style.getPropertyValue('--opencreator-traffic-light-inset')).toBe('76px');expect(document.querySelector('.desktop-titlebar-drag-region')).toBeInTheDocument();+ expect(screen.queryByRole('group', { name: '窗口控制' })).not.toBeInTheDocument();expect(document.querySelector('.opencreator-main-titlebar')).not.toBeInTheDocument();});+ it('shows functional window controls only with the Desktop capability', async () => {+ const user = userEvent.setup();+ const hostBridge = createHostBridge();+ const controlWindow = vi.fn(async () => undefined);+ hostBridge.windowChrome = {+ integratedTitleBar: true,+ titleBarHeight: 38,+ trafficLightInset: 76+ };+ hostBridge.controlWindow = controlWindow;++ render(<App fileService={createFileService()} hostBridge={hostBridge} />);++ await screen.findByRole('button', { name: '工作台' });+ const controls = screen.getByRole('group', { name: '窗口控制' });+ await user.click(within(controls).getByRole('button', { name: '缩放窗口' }));+ await user.click(within(controls).getByRole('button', { name: '最小化窗口' }));+ await user.click(within(controls).getByRole('button', { name: '关闭窗口' }));+ expect(controlWindow.mock.calls).toEqual([['zoom'], ['minimize'], ['close']]);+ });+it('moves a desktop conversation title into the integrated titlebar without duplicating it', async () => {const user = userEvent.setup();const hostBridge = createHostBridge();@@ -7109,6 +7131,24 @@ describe('App', () => {expect(window.localStorage.getItem('opencreator.preferences.colorMode')).toBe('light');});+ it('synchronizes a supported native window when switching color modes', async () => {+ const user = userEvent.setup();+ const hostBridge = createHostBridge();+ hostBridge.windowChrome = {+ integratedTitleBar: true,+ titleBarHeight: 38,+ trafficLightInset: 76+ };+ const setWindowColorMode = vi.fn().mockResolvedValue(undefined);+ hostBridge.setWindowColorMode = setWindowColorMode;++ render(<App fileService={createFileService()} hostBridge={hostBridge} />);+ await waitFor(() => expect(setWindowColorMode).toHaveBeenCalledWith('dark'));+ await user.click(await screen.findByRole('button', { name: '设置' }));+ await user.click(await screen.findByRole('button', { name: '浅色' }));+ await waitFor(() => expect(setWindowColorMode).toHaveBeenCalledWith('light'));+ });+it('applies and persists the selected accent color', async () => {const user = userEvent.setup();diff --git a/apps/web/src/app/AppController.tsx b/apps/web/src/app/AppController.tsxindex a72105d7..084f9437 100644--- a/apps/web/src/app/AppController.tsx+++ b/apps/web/src/app/AppController.tsx@@ -31,6 +31,7 @@ import type {import { FolderInput } from 'lucide-react';import { lazy, Suspense, useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';import { AppLayout } from '../components/layout/AppLayout.js';+import { DesktopWindowControls } from '../components/layout/DesktopWindowControls.js';import { beginPaneResize } from '../components/layout/pane-resize-2026-07-29.js';import { Timeline, type TimelineHandle } from '../components/timeline/Timeline.js';import { eventToTimelineItem, type TimelineItem } from '../components/timeline/timeline-model.js';@@ -434,7 +435,10 @@ export function AppController(props: AppControllerProps) {useEffect(() => {applyColorMode(colorMode);- }, [colorMode]);+ void hostBridge.setWindowColorMode?.(colorMode).catch(error => {+ console.error('Failed to synchronize native window color mode', error);+ });+ }, [colorMode, hostBridge]);useEffect(() => {applyAccentColor(accentColor, customAccentColor);}, [accentColor, customAccentColor]);@@ -4520,6 +4524,9 @@ export function AppController(props: AppControllerProps) {{integratedTitleBar?.integratedTitleBar === true ? (<div className="desktop-titlebar-drag-region" aria-hidden="true" />) : null}+ {integratedTitleBar?.integratedTitleBar === true && hostBridge.controlWindow !== undefined ? (+ <DesktopWindowControls onAction={hostBridge.controlWindow} />+ ) : null}<spanclassName="app-visually-hidden"role="status"diff --git a/apps/web/src/components/forms/NativeSelect.test.tsx b/apps/web/src/components/forms/NativeSelect.test.tsxnew file mode 100644index 00000000..fe59599d--- /dev/null+++ b/apps/web/src/components/forms/NativeSelect.test.tsx@@ -0,0 +1,46 @@+import { fireEvent, render, screen } from '@testing-library/react';+import { readFileSync } from 'node:fs';+import { describe, expect, it, vi } from 'vitest';+import NativeSelect from './NativeSelect.js';++describe('NativeSelect', () => {+ it('preserves native labels, values, options, and change events', () => {+ const onChange = vi.fn();+ render(+ <label htmlFor="duration">Duration+ <NativeSelect id="duration" name="duration" className="duration-control" defaultValue="30" onChange={onChange}>+ <option value="30">30 seconds</option>+ <option value="60">60 seconds</option>+ </NativeSelect>+ </label>+ );++ const select = screen.getByRole('combobox', { name: 'Duration' });+ expect(select).toHaveValue('30');+ expect(select).toHaveAttribute('name', 'duration');+ expect(select).toHaveClass('duration-control', 'native-select-control');+ expect(select.parentElement?.querySelector('svg')).toHaveAttribute('aria-hidden', 'true');+ fireEvent.change(select, { target: { value: '60' } });+ expect(select).toHaveValue('60');+ expect(onChange).toHaveBeenCalledOnce();+ });++ it('preserves controlled values and disabled state', () => {+ render(+ <NativeSelect aria-label="Style" value="pencil" disabled onChange={vi.fn()}>+ <option value="pencil">Pencil</option>+ </NativeSelect>+ );+ expect(screen.getByRole('combobox', { name: 'Style' })).toBeDisabled();+ expect(screen.getByRole('combobox', { name: 'Style' })).toHaveValue('pencil');+ });++ it('reserves text space and insets the noninteractive arrow from the right border', () => {+ const css = readFileSync('src/components/forms/native-select.css', 'utf8');+ expect(css).toContain('appearance: none;');+ expect(css).toContain('padding-inline-end: 40px;');+ expect(css).toContain('right: 12px;');+ expect(css).toContain('pointer-events: none;');+ expect(css).toContain('select:disabled + svg');+ });+});diff --git a/apps/web/src/components/forms/NativeSelect.tsx b/apps/web/src/components/forms/NativeSelect.tsxnew file mode 100644index 00000000..54f203cd--- /dev/null+++ b/apps/web/src/components/forms/NativeSelect.tsx@@ -0,0 +1,15 @@+import { ChevronDown } from 'lucide-react';+import type { SelectHTMLAttributes } from 'react';+import './native-select.css';++export default function NativeSelect({+ className,+ ...props+}: Omit<SelectHTMLAttributes<HTMLSelectElement>, 'multiple' | 'size'>) {+ return (+ <div className="native-select">+ <select {...props} className={['native-select-control', className].filter(Boolean).join(' ')} />+ <ChevronDown size={16} strokeWidth={1.8} aria-hidden="true" />+ </div>+ );+}diff --git a/apps/web/src/components/forms/native-select.css b/apps/web/src/components/forms/native-select.cssnew file mode 100644index 00000000..4eba0cfd--- /dev/null+++ b/apps/web/src/components/forms/native-select.css@@ -0,0 +1,27 @@+.native-select {+ position: relative;+ min-width: 0;+}++.native-select > .native-select-control {+ display: block;+ width: 100%;+ box-sizing: border-box;+ appearance: none;+ padding-inline-end: 40px;+}++.native-select > svg {+ position: absolute;+ top: 50%;+ right: 12px;+ width: 16px;+ height: 16px;+ transform: translateY(-50%);+ pointer-events: none;+ color: var(--muted);+}++.native-select > select:disabled + svg {+ opacity: 0.5;+}diff --git a/apps/web/src/components/layout/DesktopWindowControls.tsx b/apps/web/src/components/layout/DesktopWindowControls.tsxnew file mode 100644index 00000000..678efeec--- /dev/null+++ b/apps/web/src/components/layout/DesktopWindowControls.tsx@@ -0,0 +1,32 @@+import { Maximize2, Minus, X } from 'lucide-react';++type WindowAction = 'close' | 'minimize' | 'zoom';++export function DesktopWindowControls(props: {+ onAction(action: WindowAction): Promise<void>;+}) {+ const actions = [+ { action: 'close', label: '关闭窗口', Icon: X },+ { action: 'minimize', label: '最小化窗口', Icon: Minus },+ { action: 'zoom', label: '缩放窗口', Icon: Maximize2 }+ ] as const;++ return (+ <div className="desktop-window-controls" role="group" aria-label="窗口控制">+ {actions.map(({ action, label, Icon }) => (+ <button+ key={action}+ type="button"+ className={`desktop-window-control desktop-window-control-${action}`}+ aria-label={label}+ title={label}+ onClick={() => void props.onAction(action).catch(error => {+ console.error('Failed to control desktop window', error);+ })}+ >+ <Icon size={9} strokeWidth={2.4} aria-hidden="true" />+ </button>+ ))}+ </div>+ );+}diff --git a/apps/web/src/components/tts/TtsVoicePicker.tsx b/apps/web/src/components/tts/TtsVoicePicker.tsxindex f3ad5467..88cd21e4 100644--- a/apps/web/src/components/tts/TtsVoicePicker.tsx+++ b/apps/web/src/components/tts/TtsVoicePicker.tsx@@ -11,6 +11,7 @@ import {import { 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: {@@ -130,7 +131,7 @@ export function TtsVoicePicker(props: {<div className="tts-voice-picker"><label htmlFor={props.id}><span>{props.label ?? l('默认音色', 'Default voice')}</span>- <select+ <NativeSelectid={props.id}value={props.value}disabled={props.disabled || loading || props.provider === 'edge-tts'}@@ -152,7 +153,7 @@ export function TtsVoicePicker(props: {{voiceLabel(voice, l)}</option>))}- </select>+ </NativeSelect></label><div className="tts-voice-picker-actions"><buttondiff --git a/apps/web/src/features/dashboard/AutoClipWorkspace.tsx b/apps/web/src/features/dashboard/AutoClipWorkspace.tsxindex c51fb432..96bdd3f0 100644--- a/apps/web/src/features/dashboard/AutoClipWorkspace.tsx+++ b/apps/web/src/features/dashboard/AutoClipWorkspace.tsx@@ -18,6 +18,7 @@ import {X} from 'lucide-react';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import type { VideoMetadataService } from '../../services/video-metadata-service.js';import CreatorResultVersionMenu from './CreatorResultVersionMenu.js';import CreatorTaskSummary from './CreatorTaskSummary.js';@@ -507,7 +508,7 @@ export default function AutoClipWorkspace(props: {<div className="creator-tool-form-row auto-clip-settings-grid"><label className="creator-tool-field"><span>{l('原视频语言', 'Source language')}</span>- <select aria-label={l('原视频语言', 'Source language')} value={sourceLanguage} onChange={event => setSourceLanguage(event.target.value)}>+ <NativeSelect aria-label={l('原视频语言', 'Source language')} value={sourceLanguage} onChange={event => setSourceLanguage(event.target.value)}><option value="auto">{l('自动检测(优先平台字幕)', 'Auto detect (prefer platform captions)')}</option><option value="zh_cn">{l('简体中文', 'Simplified Chinese')}</option><option value="zh_tw">{l('繁體中文', 'Traditional Chinese')}</option>@@ -519,11 +520,11 @@ export default function AutoClipWorkspace(props: {<option value="de">Deutsch</option><option value="pt">Português</option><option value="ru">Русский</option>- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('内容类型', 'Content type')}</span>- <select aria-label={l('内容类型', 'Content type')} value={genre} onChange={event => setGenre(event.target.value as ClipGenre)}>+ <NativeSelect aria-label={l('内容类型', 'Content type')} value={genre} onChange={event => setGenre(event.target.value as ClipGenre)}><option value="auto">{l('自动判断', 'Auto detect')}</option><option value="talk">{l('演讲 / 观点', 'Talk / commentary')}</option><option value="podcast">{l('播客对谈', 'Podcast')}</option>@@ -533,15 +534,15 @@ export default function AutoClipWorkspace(props: {<option value="sports">{l('体育内容', 'Sports')}</option><option value="gaming">{l('游戏内容', 'Gaming')}</option><option value="news">{l('新闻 / 时事', 'News / current affairs')}</option>- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('内容重点', 'Content focus')}</span>- <select aria-label={l('内容重点', 'Content focus')} value={focus} onChange={event => setFocus(event.target.value as AnalysisFocus)}>+ <NativeSelect aria-label={l('内容重点', 'Content focus')} value={focus} onChange={event => setFocus(event.target.value as AnalysisFocus)}><option value="balanced">{l('综合表现', 'Balanced')}</option><option value="viral">{l('传播潜力优先', 'Shareability first')}</option><option value="knowledge">{l('知识完整度优先', 'Knowledge completeness')}</option>- </select>+ </NativeSelect></label></div></section>@@ -553,11 +554,11 @@ export default function AutoClipWorkspace(props: {<div className="creator-tool-form-row auto-clip-settings-grid"><label className="creator-tool-field"><span>{l('目标时长', 'Target duration')}</span>- <select aria-label={l('目标时长', 'Target duration')} value={duration} onChange={event => setDuration(event.target.value as ClipDuration)}>+ <NativeSelect aria-label={l('目标时长', 'Target duration')} value={duration} onChange={event => setDuration(event.target.value as ClipDuration)}><option value="15-30">15-30 {l('秒', 'sec')}</option><option value="30-60">30-60 {l('秒', 'sec')}</option><option value="60-90">60-90 {l('秒', 'sec')}</option>- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('切片数量', 'Number of clips')}</span>@@ -565,12 +566,12 @@ export default function AutoClipWorkspace(props: {</label><label className="creator-tool-field"><span>{l('输出画幅', 'Output format')}</span>- <select aria-label={l('输出画幅', 'Output format')} value={aspectRatio} onChange={event => setAspectRatio(event.target.value as ClipAspectRatio)}>+ <NativeSelect aria-label={l('输出画幅', 'Output format')} value={aspectRatio} onChange={event => setAspectRatio(event.target.value as ClipAspectRatio)}><option value="9:16">{l('竖屏', 'Portrait')} 9:16</option><option value="1:1">{l('方形', 'Square')} 1:1</option><option value="16:9">{l('横屏', 'Landscape')} 16:9</option><option value="source">{l('跟随原视频', 'Match source')}</option>- </select>+ </NativeSelect></label></div></section>diff --git a/apps/web/src/features/dashboard/CoverGeneratorWorkspace.tsx b/apps/web/src/features/dashboard/CoverGeneratorWorkspace.tsxindex b9ef2bcc..e0aacc4c 100644--- a/apps/web/src/features/dashboard/CoverGeneratorWorkspace.tsx+++ b/apps/web/src/features/dashboard/CoverGeneratorWorkspace.tsx@@ -23,6 +23,7 @@ import {import { useEffect, useMemo, useRef, useState } from 'react';import { useAppLanguage } from '../../i18n/LanguageProvider.js';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import CreatorResultVersionMenu from './CreatorResultVersionMenu.js';import CreatorTaskSummary from './CreatorTaskSummary.js';import CreatorToolShell from './CreatorToolShell.js';@@ -770,7 +771,7 @@ export default function CoverGeneratorWorkspace(props: {<div className="cover-copy-settings"><label className="creator-tool-field"><span>{l('封面文字语言', 'Cover text language')}</span>- <select+ <NativeSelectaria-label={l('封面文字语言', 'Cover text language')}value={coverTextLanguage}onChange={event => updateCoverTextLanguage(@@ -782,7 +783,7 @@ export default function CoverGeneratorWorkspace(props: {<option value="en-US">English</option><option value="ja-JP">日本語</option><option value="ko-KR">한국어</option>- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('主标题', 'Headline')} <small>{l('选填', 'Optional')}</small></span>diff --git a/apps/web/src/features/dashboard/DashboardPage.tsx b/apps/web/src/features/dashboard/DashboardPage.tsxindex 2ab379a9..9a5f6363 100644--- a/apps/web/src/features/dashboard/DashboardPage.tsx+++ b/apps/web/src/features/dashboard/DashboardPage.tsx@@ -440,8 +440,8 @@ export default function DashboardPage(props: {}return (- <main className="creator-tools-page">- <div className="creator-tools-page-inner">+ <main className="opencreator-scroll-page creator-tools-page">+ <div className="opencreator-page-content creator-tools-page-inner"><header className="creator-tools-page-header"><h1>{t('dashboard.title')}</h1>{props.onCreateProject ? (diff --git a/apps/web/src/features/dashboard/ShortVideoScriptWorkspace.tsx b/apps/web/src/features/dashboard/ShortVideoScriptWorkspace.tsxindex 06287477..a5874d44 100644--- a/apps/web/src/features/dashboard/ShortVideoScriptWorkspace.tsx+++ b/apps/web/src/features/dashboard/ShortVideoScriptWorkspace.tsx@@ -9,6 +9,7 @@ import {} from 'lucide-react';import { useEffect, useMemo, useState } from 'react';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import CreatorToolShell from './CreatorToolShell.js';import { useOptionalCreatorSession } from './creator-session-store.js';@@ -294,14 +295,14 @@ export default function ShortVideoScriptWorkspace(props: {<div className="short-video-script-options"><label className="creator-tool-field"><span>{l('发布平台或场景', 'Platform or use case')}</span>- <select+ <NativeSelectvalue={platform}onChange={event => updatePlatform(readPlatform(event.target.value))}>{platforms.map(item => (<option key={item.value} value={item.value}>{l(item.zh, item.en)}</option>))}- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('目标时长(秒)', 'Target duration (seconds)')}</span>@@ -316,14 +317,14 @@ export default function ShortVideoScriptWorkspace(props: {</label><label className="creator-tool-field"><span>{l('表达语气', 'Tone')}</span>- <select+ <NativeSelectvalue={tone}onChange={event => updateTone(readTone(event.target.value))}>{tones.map(item => (<option key={item.value} value={item.value}>{l(item.zh, item.en)}</option>))}- </select>+ </NativeSelect></label></div><label className="creator-tool-field">diff --git a/apps/web/src/features/dashboard/StickmanVideoWorkspace.tsx b/apps/web/src/features/dashboard/StickmanVideoWorkspace.tsxindex c24126e2..b366d176 100644--- a/apps/web/src/features/dashboard/StickmanVideoWorkspace.tsx+++ b/apps/web/src/features/dashboard/StickmanVideoWorkspace.tsx@@ -32,6 +32,7 @@ import {} from 'lucide-react';import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';import { TtsVoicePicker } from '../../components/tts/TtsVoicePicker.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';import type { CreatorServicesSettingsService } from '../../services/creator-services-service.js';import type { CreatorWebService } from '../../services/creator-service.js';@@ -920,7 +921,7 @@ function SourceAndCharacterStep(props: {<div className="creator-tool-field"><span id="stickman-target-duration-label">{props.l('目标时长', 'Target duration')}</span><div className="stickman-duration-control">- <select+ <NativeSelectaria-labelledby="stickman-target-duration-label"value={targetDurationPreset(props.targetDurationSeconds)}onChange={event => props.onPatch({@@ -934,7 +935,7 @@ function SourceAndCharacterStep(props: {<option value="300">{props.l('5 分钟', '5 minutes')}</option><option value="600">{props.l('10 分钟', '10 minutes')}</option><option value="custom">{props.l('自定义', 'Custom')}</option>- </select>+ </NativeSelect>{targetDurationPreset(props.targetDurationSeconds) === 'custom' ? (<span className="stickman-custom-duration"><input@@ -1076,7 +1077,7 @@ function VisualStylePicker(props: {return (<div className="creator-tool-field stickman-style-field"><label htmlFor="stickman-visual-style">{props.l('视觉风格', 'Visual style')}</label>- <select+ <NativeSelectid="stickman-visual-style"value={selectedAsset === undefined ? '' : assetRefKey(selectedAsset)}disabled={props.assets.length === 0}@@ -1091,7 +1092,7 @@ function VisualStylePicker(props: {{props.l(asset.name.zhCN, asset.name.en)}</option>))}- </select>+ </NativeSelect>{selectedAsset?.styleAttributes !== undefined ? (<div className="stickman-style-summary"><span@@ -1714,7 +1715,7 @@ function StoryboardShotRow(props: {) : null}<label className="stickman-storyboard-motion"><span>{props.l('镜头运动', 'Motion')}</span>- <select+ <NativeSelectaria-label={props.l(`第 ${props.index + 1} 个镜头运动`, `Motion for shot ${props.index + 1}`)}value={motion}disabled={props.saving || generating}@@ -1725,7 +1726,7 @@ function StoryboardShotRow(props: {<option value="zoom-out">{props.l('拉远', 'Zoom out')}</option><option value="pan-left">{props.l('向左平移', 'Pan left')}</option><option value="pan-right">{props.l('向右平移', 'Pan right')}</option>- </select>+ </NativeSelect></label><div className="stickman-storyboard-actions">{dirty ? (diff --git a/apps/web/src/features/dashboard/VideoDownloadWorkspace.tsx b/apps/web/src/features/dashboard/VideoDownloadWorkspace.tsxindex 9eceae01..73420c2a 100644--- a/apps/web/src/features/dashboard/VideoDownloadWorkspace.tsx+++ b/apps/web/src/features/dashboard/VideoDownloadWorkspace.tsx@@ -27,6 +27,7 @@ import {} from 'lucide-react';import { useEffect, useMemo, useRef, useState } from 'react';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import CreatorTaskSummary from './CreatorTaskSummary.js';import CreatorToolShell from './CreatorToolShell.js';import { useOptionalCreatorSession } from './creator-session-store.js';@@ -824,7 +825,7 @@ export default function VideoDownloadWorkspace(props: {{audioLanguages.length > 1 && selectedAudioLanguage !== undefined ? (<label className="creator-tool-field video-download-language-field"><span>{l('音频语言', 'Audio language')}</span>- <select+ <NativeSelectaria-label={l('音频语言', 'Audio language')}value={selectedAudioLanguage}onChange={event => selectAudioLanguage(event.target.value)}@@ -834,7 +835,7 @@ export default function VideoDownloadWorkspace(props: {{audioLanguageLabel(language, l)}</option>))}- </select>+ </NativeSelect></label>) : null}{visibleOptions.length > 0 ? (diff --git a/apps/web/src/features/dashboard/VideoGenerationWorkspace.tsx b/apps/web/src/features/dashboard/VideoGenerationWorkspace.tsxindex 655c0064..cd768396 100644--- a/apps/web/src/features/dashboard/VideoGenerationWorkspace.tsx+++ b/apps/web/src/features/dashboard/VideoGenerationWorkspace.tsx@@ -24,6 +24,7 @@ import {} from 'lucide-react';import { useEffect, useMemo, useRef, useState } from 'react';import { useLocalizedCopy } from '../../i18n/useLocalizedCopy.js';+import NativeSelect from '../../components/forms/NativeSelect.js';import type { CreatorServicesSettingsService } from '../../services/creator-services-service.js';import CreatorResultVersionMenu from './CreatorResultVersionMenu.js';import CreatorTaskSummary from './CreatorTaskSummary.js';@@ -659,21 +660,21 @@ export default function VideoGenerationWorkspace(props: {<div className="video-generation-settings-grid"><label className="creator-tool-field"><span>{l('视频服务', 'Video provider')}</span>- <select value={provider} onChange={event => updateProvider(event.target.value as VideoGenerationProvider)}>+ <NativeSelect value={provider} onChange={event => updateProvider(event.target.value as VideoGenerationProvider)}>{providers.map(item => <option key={item.value} value={item.value}>{l(item.zh, item.en)}</option>)}- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('模型版本', 'Model version')}</span>- <select value={model} onChange={event => updateModel(event.target.value)}>+ <NativeSelect value={model} onChange={event => updateModel(event.target.value)}>{modelOptions.map(item => (<option key={item.value} value={item.value}>{item.label}</option>))}- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('画幅', 'Format')}</span>- <select+ <NativeSelectvalue={size}disabled={followsReferenceRatio}title={followsReferenceRatio@@ -684,13 +685,13 @@ export default function VideoGenerationWorkspace(props: {{followsReferenceRatio ? (<option value={size}>{l('跟随参考图', 'Match reference image')}</option>) : sizes.map(item => <option key={item.value} value={item.value}>{l(item.zh, item.en)} · {item.ratio} · {item.value}</option>)}- </select>+ </NativeSelect></label><label className="creator-tool-field"><span>{l('视频时长', 'Video duration')}</span>- <select value={duration} onChange={event => updateDuration(Number(event.target.value) as VideoGenerationDuration)}>+ <NativeSelect value={duration} onChange={event => updateDuration(Number(event.target.value) as VideoGenerationDuration)}>{durations.map(value => <option key={value} value={value}>{value} {l('秒', 'seconds')}</option>)}- </select>+ </NativeSelect></label></div><div className="media-generation-setting-note">diff --git a/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx b/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsxindex 769eeffa..390f3c0a 100644--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx@@ -116,8 +116,8 @@ type LanguageOption = {const steps = ['添加视频', '翻译设置', '字幕样式', '配音与输出'] as const;const subtitleColors = ['#FFFFFF', '#FFE45C', '#7EE7FF', '#A7F3D0'] as const;-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 --git a/apps/web/src/features/dashboard/dashboard-css.test.ts b/apps/web/src/features/dashboard/dashboard-css.test.tsindex 81ee62d4..56c8b783 100644--- a/apps/web/src/features/dashboard/dashboard-css.test.ts+++ b/apps/web/src/features/dashboard/dashboard-css.test.ts@@ -18,6 +18,50 @@ function cssBlocks(selector: string): string[] {}describe('dashboard CSS contracts', () => {+ it('keeps article-template icons unframed inside selectable list items', () => {+ for (const selector of [+ '.wechat-template-inline-list > button > span',+ '.wechat-template-grid > button > span'+ ]) {+ const blocks = cssBlocks(selector);+ expect(blocks).toHaveLength(1);+ expect(blocks[0]).toContain('background: transparent;');+ expect(blocks[0]).not.toMatch(/border|box-shadow/);+ }+ });++ it('separates Creator form groups and top-aligns fields beside taller previews', () => {+ const formRow = cssBlocks('.creator-tool-form-row');+ const characterPicker = cssBlocks('.stickman-character-picker');++ expect(formRow).toHaveLength(1);+ expect(formRow[0]).toContain('align-items: start;');+ expect(formRow[0]).toContain('gap: 16px;');+ expect(formRow[0]).toContain('margin-top: 16px;');+ expect(characterPicker).toHaveLength(1);+ expect(characterPicker[0]).toContain('margin-top: 16px;');+ expect(cssBlocks('.stickman-voice-settings + .stickman-tts-configuration')[0]).toContain('margin-top: 16px;');+ expect(cssBlocks('.creator-tool-field')[0]).toContain('gap: 8px;');+ expect(cssBlocks('.video-translation-select-wrap select')[0]).toContain('padding: 0 40px 0 12px;');+ expect(cssBlocks('.video-translation-select-wrap svg')[0]).toContain('right: 12px;');+ });++ it('keeps collaboration panels full-height beside the workspace at narrow widths', () => {+ const sharedPanel = cssBlocks('.creator-collaboration');+ const workspaceLayout = cssBlocks('.creator-workspace-layout');+ const translationLayout = cssBlocks('.video-translation-collab-layout');++ expect(sharedPanel).toHaveLength(1);+ expect(sharedPanel[0]).toContain('height: 100%;');+ expect(sharedPanel[0]).toContain('min-height: 0;');+ expect(sharedPanel[0]).toContain('grid-template-rows: auto auto minmax(0, 1fr) auto auto;');+ expect(workspaceLayout[0]).toContain('min-width: 680px;');+ expect(workspaceLayout[0]).toContain('grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);');+ expect(translationLayout[0]).toContain('min-width: 680px;');+ expect(translationLayout[0]).toContain('minmax(280px, 1fr);');+ expect(dashboardCss).not.toMatch(/\.creator-collaboration-panel\s*\{[^}]*height: auto;/);+ });+it('constrains portrait source previews without forcing a landscape frame', () => {const portraitPreview = cssBlocks('.video-source-preview[data-orientation="portrait"]');diff --git a/apps/web/src/features/dashboard/dashboard.css b/apps/web/src/features/dashboard/dashboard.cssindex fd1488fa..4d824149 100644--- a/apps/web/src/features/dashboard/dashboard.css+++ b/apps/web/src/features/dashboard/dashboard.css@@ -5,13 +5,8 @@color: var(--text);}-.creator-tools-page-inner {- width: min(1120px, calc(100% - 48px));- margin: 0 auto;- padding: 34px 0 56px;-}-.creator-tools-page-header {+ min-height: var(--page-title-row-height);display: flex;align-items: center;justify-content: space-between;@@ -350,11 +345,6 @@}@media (max-width: 700px) {- .creator-tools-page-inner {- width: calc(100% - 28px);- padding: 24px 0 40px;- }-.creator-tools-page-header {margin-bottom: 20px;}@@ -397,7 +387,7 @@.video-translation-page {height: 100%;- overflow: hidden;+ overflow: auto hidden;background: var(--conversation-bg);color: var(--text);}@@ -405,7 +395,7 @@.video-translation-page-inner {width: min(1080px, calc(100% - 48px));margin: 0 auto;- padding: 30px 0 64px;+ padding: 11px 0 64px;}.video-translation-header {@@ -719,14 +709,14 @@.video-translation-select-wrap select {appearance: none;- padding: 0 34px 0 12px;+ padding: 0 40px 0 12px;outline: 0;}.video-translation-select-wrap svg {position: absolute;top: 50%;- right: 11px;+ right: 12px;pointer-events: none;color: var(--subtle);transform: translateY(-50%);@@ -1326,16 +1316,16 @@.creator-workspace-page {height: 100%;- overflow: hidden;+ overflow: auto hidden;background: var(--conversation-bg);color: var(--text);}.creator-workspace-layout {height: 100%;- min-width: 960px;+ min-width: 680px;display: grid;- grid-template-columns: minmax(640px, 3fr) minmax(320px, 1fr);+ grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);}.creator-workspace-main {@@ -1348,7 +1338,7 @@}.creator-workspace-header {- height: 72px;+ height: var(--page-title-band-height);display: grid;grid-template-columns: 34px minmax(0, 1fr);align-items: center;@@ -1665,10 +1655,11 @@.creator-tool-field {min-width: 0;display: grid;- gap: 7px;+ gap: 8px;}-.creator-tool-field > span {+.creator-tool-field > span,+.creator-tool-field > label {color: var(--muted);font-size: 12px;font-weight: 560;@@ -1718,8 +1709,9 @@.creator-tool-form-row {display: grid;grid-template-columns: repeat(2, minmax(0, 1fr));- gap: 12px;- margin-top: 14px;+ align-items: start;+ gap: 16px;+ margin-top: 16px;}.auto-clip-settings-grid {@@ -2123,7 +2115,7 @@display: grid;grid-template-columns: repeat(4, minmax(0, 1fr));align-items: end;- gap: 12px;+ gap: 16px;}.video-generation-settings-grid .creator-tool-field {@@ -2409,64 +2401,12 @@}@media (max-width: 960px) {- .video-generation-workspace-page {- height: auto;- min-height: 100%;- overflow-y: auto;- }-- .video-generation-workspace-page .creator-workspace-layout {- min-width: 0;- height: auto;- min-height: 100%;- grid-template-columns: minmax(0, 1fr);- }-- .video-generation-workspace-page .creator-workspace-main {- overflow: visible;- border-right: 0;- }-- .video-generation-workspace-page .creator-workspace-content {- overflow: visible;- scrollbar-gutter: auto;- }-.video-generation-workspace-page .creator-task-final-grid {grid-template-columns: minmax(0, 1fr);}-- .video-generation-workspace-page .creator-collaboration-panel {- min-width: 0;- height: auto;- min-height: 640px;- border-top: 1px solid var(--border-hairline);- border-left: 0;- }}@media (max-width: 760px) {- .image-generation-workspace-page,- .cover-generation-workspace-page {- height: auto;- min-height: 100%;- overflow-y: auto;- }-- .image-generation-workspace-page .creator-workspace-layout,- .cover-generation-workspace-page .creator-workspace-layout {- min-width: 0;- height: auto;- min-height: 100%;- grid-template-columns: minmax(0, 1fr);- }-- .image-generation-workspace-page .creator-workspace-main,- .cover-generation-workspace-page .creator-workspace-main {- overflow: visible;- border-right: 0;- }-.image-generation-workspace-page .creator-workspace-header,.cover-generation-workspace-page .creator-workspace-header {padding: 0 16px;@@ -2474,9 +2414,7 @@.image-generation-workspace-page .creator-workspace-content,.cover-generation-workspace-page .creator-workspace-content {- overflow: visible;padding: 16px;- scrollbar-gutter: auto;}.image-generation-workspace-page .creator-tool-panel,@@ -2515,14 +2453,6 @@align-self: flex-start;}- .image-generation-workspace-page .creator-collaboration-panel,- .cover-generation-workspace-page .creator-collaboration-panel {- min-width: 0;- height: auto;- min-height: 640px;- border-top: 1px solid var(--border-hairline);- border-left: 0;- }}.wechat-article-workspace-content {@@ -3312,8 +3242,7 @@height: 32px;display: grid;place-items: center;- border-radius: 6px;- background: var(--surface-2);+ background: transparent;color: var(--muted);}@@ -3642,8 +3571,7 @@height: 28px;display: grid;place-items: center;- border-radius: 6px;- background: var(--surface-2);+ background: transparent;color: var(--muted);}@@ -6294,7 +6222,7 @@.short-video-script-fields,.xiaohongshu-post-control-group {display: grid;- gap: 14px;+ gap: 16px;}.xiaohongshu-post-control-group {@@ -6320,7 +6248,7 @@.short-video-script-options {display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));- gap: 10px;+ gap: 16px;}.short-video-script-result-panel textarea {@@ -6386,49 +6314,6 @@animation: smart-dubbing-spin 0.9s linear infinite;}-@media (max-width: 960px) {- .xiaohongshu-post-workspace-page,- .short-video-script-workspace-page {- height: auto;- min-height: 100%;- overflow-y: auto;- }-- .xiaohongshu-post-workspace-page .creator-workspace-layout,- .short-video-script-workspace-page .creator-workspace-layout {- min-width: 0;- height: auto;- min-height: 100%;- grid-template-columns: minmax(0, 1fr);- }-- .xiaohongshu-post-workspace-page .creator-workspace-main,- .xiaohongshu-post-workspace-page .creator-workspace-content,- .short-video-script-workspace-page .creator-workspace-main,- .short-video-script-workspace-page .creator-workspace-content {- overflow: visible;- }-- .xiaohongshu-post-workspace-page .creator-workspace-main,- .short-video-script-workspace-page .creator-workspace-main {- border-right: 0;- }-- .xiaohongshu-post-workspace-page .creator-workspace-content,- .short-video-script-workspace-page .creator-workspace-content {- scrollbar-gutter: auto;- }-- .xiaohongshu-post-workspace-page .creator-collaboration-panel,- .short-video-script-workspace-page .creator-collaboration-panel {- min-width: 0;- height: auto;- min-height: 640px;- border-top: 1px solid var(--border-hairline);- border-left: 0;- }-}-@media (max-width: 700px) {.short-video-script-options {grid-template-columns: minmax(0, 1fr);@@ -7172,6 +7057,7 @@.stickman-character-picker {display: block;+ margin-top: 16px;}.stickman-character-presets {@@ -7499,11 +7385,15 @@}.stickman-voice-settings {- margin-top: 14px;- padding-top: 14px;+ margin-top: 16px;+ padding-top: 16px;border-top: 1px solid var(--border-hairline);}+.stickman-voice-settings + .stickman-tts-configuration {+ margin-top: 16px;+}+.stickman-tts-configuration {min-height: 48px;display: grid;@@ -10566,7 +10456,7 @@display: grid;grid-template-columns: minmax(150px, 0.75fr) repeat(2, minmax(0, 1fr));align-items: end;- gap: 10px;+ gap: 16px;margin-top: 18px;}@@ -11565,18 +11455,19 @@.video-translation-collab-layout {height: 100%;+ min-width: 680px;min-height: 0;display: grid;grid-template-columns:minmax(- 780px,+ 0px,min(var(--video-translation-pane-width, calc(68% - 3.5px)),- calc(100% - 327px)+ calc(100% - 287px)))7px- minmax(320px, 1fr);+ minmax(280px, 1fr);align-items: stretch;overflow: hidden;}@@ -11588,7 +11479,7 @@display: grid;grid-template-rows: auto auto minmax(0, 1fr) auto;overflow: hidden;- padding: 20px 24px 24px;+ padding: 11px 24px 24px;box-sizing: border-box;container-name: video-translation-workspace;container-type: inline-size;@@ -13386,41 +13277,6 @@}}-@media (max-width: 1120px) {- .video-translation-page {- overflow: auto;- }-- .video-translation-page-inner.video-translation-wizard {- height: auto;- min-height: 100%;- }-- .video-translation-collab-layout {- grid-template-columns: 1fr;- height: auto;- overflow: visible;- }-- .video-translation-wizard-main {- height: auto;- overflow: visible;- }-- .video-translation-wizard-main .video-translation-wizard-body {- overflow: visible;- }-- .video-translation-pane-resize {- display: none;- }-- .creator-collaboration {- position: static;- height: 574px;- }-}-.digital-avatar-workspace-content {overflow: hidden;}diff --git a/apps/web/src/features/plugins/skill-market.css b/apps/web/src/features/plugins/skill-market.cssindex 9c991feb..5128c89c 100644--- a/apps/web/src/features/plugins/skill-market.css+++ b/apps/web/src/features/plugins/skill-market.css@@ -4,7 +4,7 @@min-height: 0;height: 100%;display: grid;- grid-template-rows: 52px minmax(0, 1fr);+ grid-template-rows: var(--page-title-band-height) minmax(0, 1fr);overflow: hidden;background: var(--bg);color: var(--text);@@ -12,7 +12,7 @@.plugin-center-header {min-width: 0;- min-height: 52px;+ min-height: var(--page-title-band-height);display: flex;align-items: center;padding: 0 clamp(20px, 2.4vw, 32px);diff --git a/apps/web/src/features/projects/ProjectsPage.tsx b/apps/web/src/features/projects/ProjectsPage.tsxindex 00f854ac..0e5a7cfb 100644--- a/apps/web/src/features/projects/ProjectsPage.tsx+++ b/apps/web/src/features/projects/ProjectsPage.tsx@@ -169,8 +169,8 @@ export default function ProjectsPage(props: {}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>@@ -185,28 +185,30 @@ export default function ProjectsPage(props: {onCreate={props.onCreateProject}/>) : null}- <label className="projects-search">- <Search size={17} strokeWidth={1.8} aria-hidden="true" />- <input- type="search"- value={query}- onChange={event => setQuery(event.target.value)}- aria-label={view === 'projects' ? l('搜索项目', 'Search projects') : l('搜索产出', 'Search outputs')}- placeholder={view === 'projects' ? l('搜索项目', 'Search projects') : l('搜索产出', 'Search outputs')}- />- </label></div></header>- <div className="projects-dimension-tabs" role="tablist" aria-label={l('内容维度', 'Content view')}>- <button type="button" role="tab" aria-selected={view === 'projects'} onClick={() => selectView('projects')}>- <FolderKanban size={16} strokeWidth={1.8} aria-hidden="true" />- {l('项目', 'Projects')}- </button>- <button type="button" role="tab" aria-selected={view === 'outputs'} onClick={() => selectView('outputs')}>- <PackageOpen size={16} strokeWidth={1.8} aria-hidden="true" />- {l('产出中心', 'Output Center')}- </button>+ <div className="projects-primary-row">+ <div className="projects-dimension-tabs" role="tablist" aria-label={l('内容维度', 'Content view')}>+ <button type="button" role="tab" aria-selected={view === 'projects'} onClick={() => selectView('projects')}>+ <FolderKanban size={16} strokeWidth={1.8} aria-hidden="true" />+ {l('项目', 'Projects')}+ </button>+ <button type="button" role="tab" aria-selected={view === 'outputs'} onClick={() => selectView('outputs')}>+ <PackageOpen size={16} strokeWidth={1.8} aria-hidden="true" />+ {l('产出中心', 'Output Center')}+ </button>+ </div>+ <label className="projects-search">+ <Search size={17} strokeWidth={1.8} aria-hidden="true" />+ <input+ type="search"+ value={query}+ onChange={event => setQuery(event.target.value)}+ aria-label={view === 'projects' ? l('搜索项目', 'Search projects') : l('搜索产出', 'Search outputs')}+ placeholder={view === 'projects' ? l('搜索项目', 'Search projects') : l('搜索产出', 'Search outputs')}+ />+ </label></div><div className={`projects-category-tabs${view === 'outputs' ? ' is-output' : ''}`} role="tablist" aria-label={view === 'projects' ? l('项目分类', 'Project categories') : l('产出分类', 'Output categories')}>diff --git a/apps/web/src/features/projects/projects-page-css.test.ts b/apps/web/src/features/projects/projects-page-css.test.tsindex 6ef47d0b..eeeefbb0 100644--- a/apps/web/src/features/projects/projects-page-css.test.ts+++ b/apps/web/src/features/projects/projects-page-css.test.ts@@ -9,18 +9,45 @@ function cssBlock(selector: string) {}describe('projects page spacing', () => {- it('separates the subtitle from the title and view tabs', () => {+ it('aligns the page title and actions on the shared title row', () => {+ expect(cssBlock('.projects-page-header')).toContain('align-items: flex-start;');+ expect(cssBlock('.projects-page-header h1')).toContain('min-height: var(--page-title-row-height);');+ expect(cssBlock('.projects-header-actions')).toContain('min-height: var(--page-title-row-height);');+ });++ it('separates the subtitle from the primary navigation row', () => {expect(cssBlock('.projects-page-header p')).toContain('margin-top: 12px;');expect(cssBlock('.projects-page-header p')).toContain('line-height: 1.6;');- expect(cssBlock('.projects-dimension-tabs')).toContain('margin-top: 24px;');+ expect(cssBlock('.projects-primary-row')).toContain('margin-top: 20px;');});- it('spaces view tabs and their icons without preventing wrapping', () => {+ it('gives the primary view tabs a stronger hierarchy than the category filters', () => {expect(cssBlock('.projects-dimension-tabs')).toContain('display: flex;');- expect(cssBlock('.projects-dimension-tabs')).toContain('flex-wrap: wrap;');+ expect(cssBlock('.projects-primary-row')).toContain('border-bottom: 1px solid var(--border-hairline);');expect(cssBlock('.projects-dimension-tabs')).toContain('gap: 24px;');expect(cssBlock('.projects-dimension-tabs button')).toContain('display: inline-flex;');expect(cssBlock('.projects-dimension-tabs button')).toContain('gap: 8px;');- expect(cssBlock('.projects-dimension-tabs button')).toContain('min-height: 40px;');+ expect(cssBlock('.projects-dimension-tabs button')).toContain('min-height: 44px;');+ expect(cssBlock('.projects-dimension-tabs button')).toContain('font-size: 14px;');+ expect(cssBlock('.projects-dimension-tabs button[aria-selected="true"]::after')).toContain('background: var(--accent);');+ expect(cssBlock('.projects-category-tabs button')).toContain('min-height: 34px;');+ expect(cssBlock('.projects-category-tabs button')).toContain('font-size: 12px;');+ });++ it('places the search in the primary navigation row without stretching the tabs', () => {+ expect(cssBlock('.projects-primary-row')).toContain('justify-content: space-between;');+ expect(cssBlock('.projects-dimension-tabs')).toContain('flex: 0 0 auto;');+ expect(cssBlock('.projects-search')).toContain('flex: 0 1 260px;');+ });++ it('keeps second-level categories compact, unframed, and on one scrollable row', () => {+ const tabs = cssBlock('.projects-category-tabs');+ expect(tabs).toContain('display: flex;');+ expect(tabs).toContain('overflow-x: auto;');+ expect(tabs).not.toContain('border:');+ expect(tabs).not.toContain('background:');+ expect(cssBlock('.projects-category-tabs button')).toContain('flex: 0 0 auto;');+ expect(cssBlock('.projects-category-tabs button')).toContain('white-space: nowrap;');+ expect(cssBlock('.projects-category-tabs button[aria-selected="true"]')).toContain('background: var(--surface-2);');});});diff --git a/apps/web/src/features/projects/projects-page.css b/apps/web/src/features/projects/projects-page.cssindex 553ee6c6..831cc927 100644--- a/apps/web/src/features/projects/projects-page.css+++ b/apps/web/src/features/projects/projects-page.css@@ -5,15 +5,9 @@color: var(--text);}-.projects-page-inner {- width: min(1160px, calc(100% - 48px));- margin: 0 auto;- padding: 36px 0 56px;-}-.projects-page-header {display: flex;- align-items: flex-end;+ align-items: flex-start;justify-content: space-between;gap: 24px;}@@ -27,6 +21,9 @@}.projects-page-header h1 {+ min-height: var(--page-title-row-height);+ display: flex;+ align-items: center;font-size: 26px;font-weight: 650;line-height: 1.25;@@ -40,48 +37,84 @@}.projects-header-actions {+ min-height: var(--page-title-row-height);display: flex;align-items: center;gap: 10px;}-.projects-dimension-tabs {+.projects-primary-row {display: flex;- flex-wrap: wrap;align-items: center;+ justify-content: space-between;+ gap: 16px;+ margin-top: 20px;+ border-bottom: 1px solid var(--border-hairline);+}++.projects-dimension-tabs {+ display: flex;+ align-items: stretch;gap: 24px;- margin-top: 24px;+ flex: 0 0 auto;}.projects-dimension-tabs button {+ position: relative;display: inline-flex;align-items: center;gap: 8px;- min-height: 40px;+ min-height: 44px;padding: 0 4px;+ border: 0;+ border-radius: 0;+ background: transparent;+ color: var(--muted);+ font-size: 14px;+ font-weight: 500;+ white-space: nowrap;+}++.projects-dimension-tabs button:hover,+.projects-dimension-tabs button[aria-selected="true"] {+ color: var(--text);+}++.projects-dimension-tabs button[aria-selected="true"] {+ font-weight: 600;+}++.projects-dimension-tabs button[aria-selected="true"]::after {+ content: "";+ position: absolute;+ right: 0;+ bottom: -1px;+ left: 0;+ height: 2px;+ background: var(--accent);}.projects-category-tabs {- display: grid;- grid-template-columns: repeat(3, minmax(0, 1fr));+ display: flex;+ align-items: center;gap: 4px;- margin-top: 24px;- padding: 5px;- border: 1px solid var(--border);- border-radius: 8px;- background: var(--surface);+ margin-top: 12px;+ overflow-x: auto;+ scrollbar-width: none;+}++.projects-category-tabs::-webkit-scrollbar {+ display: none;}.projects-category-tabs button {- min-width: 0;- height: 42px;- overflow: hidden;+ min-height: 34px;+ flex: 0 0 auto;padding: 0 12px;border-radius: 6px;color: var(--muted);- font-size: 13px;- font-weight: 560;- text-overflow: ellipsis;+ font-size: 12px;+ font-weight: 500;white-space: nowrap;}@@ -92,13 +125,14 @@.projects-category-tabs button[aria-selected="true"] {background: var(--surface-2);color: var(--text);- font-weight: 650;+ font-weight: 600;}.projects-search {width: min(260px, 36vw);- flex: 0 0 auto;- height: 42px;+ min-width: 110px;+ flex: 0 1 260px;+ height: 36px;display: grid;grid-template-columns: 18px minmax(0, 1fr);align-items: center;@@ -456,20 +490,10 @@}@media (max-width: 760px) {- .projects-page-inner {- width: calc(100% - 28px);- padding-top: 24px;- }-.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) {@@ -486,7 +510,37 @@gap: 16px;}- .projects-search {+ .projects-header-actions {+ min-width: 0;width: 100%;}++ .projects-primary-row {+ gap: 10px;+ }++ .projects-dimension-tabs {+ gap: 10px;+ }++ .projects-dimension-tabs button {+ padding: 0 1px;+ font-size: 13px;+ }++ .projects-search {+ width: min(160px, 34vw);+ min-width: 92px;+ flex: 0 1 160px;+ }+}++@media (max-width: 370px) {+ .projects-primary-row {+ flex-wrap: wrap;+ }++ .projects-search {+ margin-left: auto;+ }}diff --git a/apps/web/src/features/schedules/schedules-view.css b/apps/web/src/features/schedules/schedules-view.cssindex ebdb84d7..b0537f13 100644--- a/apps/web/src/features/schedules/schedules-view.css+++ b/apps/web/src/features/schedules/schedules-view.css@@ -11,7 +11,7 @@width: min(980px, 100%);min-height: 100%;margin: 0 auto;- padding: 32px 28px 48px;+ padding: var(--page-title-inset) 28px 48px;}.schedules-view__header {@@ -22,6 +22,9 @@}.schedules-view__header h1 {+ min-height: var(--page-title-row-height);+ display: flex;+ align-items: center;margin: 0;font-size: 28px;font-weight: 600;@@ -36,6 +39,10 @@line-height: 1.5;}+.schedules-view__header > .schedule-button {+ min-height: var(--page-title-row-height);+}+.schedule-button,.schedule-icon-button {border: 1px solid var(--border);diff --git a/apps/web/src/features/search/search-view.css b/apps/web/src/features/search/search-view.cssindex bb477c7c..0d3b5bc5 100644--- a/apps/web/src/features/search/search-view.css+++ b/apps/web/src/features/search/search-view.css@@ -14,12 +14,12 @@display: grid;grid-template-rows: auto minmax(0, 1fr);gap: 18px;- padding: 30px 24px 0;+ padding: var(--page-title-inset) 24px 0;}.search-view__input {min-width: 0;- height: 46px;+ height: var(--page-title-row-height);display: flex;align-items: center;gap: 10px;diff --git a/apps/web/src/features/settings/OpenCreatorSettingsView.tsx b/apps/web/src/features/settings/OpenCreatorSettingsView.tsxindex e9ee8fdf..81ba3c92 100644--- a/apps/web/src/features/settings/OpenCreatorSettingsView.tsx+++ b/apps/web/src/features/settings/OpenCreatorSettingsView.tsx@@ -136,7 +136,7 @@ export function OpenCreatorSettingsView(props: OpenCreatorSettingsViewProps) {))}</nav></aside>- <main className="settings-content">+ <main className="opencreator-scroll-page settings-content">{activeTab === 'general' ? (<GeneralSettingsdefaultPermission={props.defaultPermission ?? 'follow-project'}diff --git a/apps/web/src/features/settings/creator-services-settings.css b/apps/web/src/features/settings/creator-services-settings.cssindex 89d4a48d..5deb53fc 100644--- a/apps/web/src/features/settings/creator-services-settings.css+++ b/apps/web/src/features/settings/creator-services-settings.css@@ -1,7 +1,3 @@-.creator-services-settings {- width: min(940px, 100%);-}-.settings-section .creator-services-header {display: grid;grid-template-columns: minmax(0, 1fr) auto;diff --git a/apps/web/src/features/settings/settings-management.css b/apps/web/src/features/settings/settings-management.cssindex 1d02c2a4..8d4cd1b1 100644--- a/apps/web/src/features/settings/settings-management.css+++ b/apps/web/src/features/settings/settings-management.css@@ -1,7 +1,3 @@-.settings-management {- width: min(920px, 100%);-}-.settings-management__header {min-width: 0;display: flex !important;diff --git a/apps/web/src/features/tasks/task-center.css b/apps/web/src/features/tasks/task-center.cssindex df4a8b57..5eaa0d4d 100644--- a/apps/web/src/features/tasks/task-center.css+++ b/apps/web/src/features/tasks/task-center.css@@ -12,7 +12,7 @@align-content: start;gap: 18px;margin: 0 auto;- padding: 28px 30px 44px;+ padding: var(--page-title-inset) 30px 44px;}.task-center__header {@@ -29,6 +29,9 @@}.task-center__header h1 {+ min-height: var(--page-title-row-height);+ display: flex;+ align-items: center;font-size: 24px;line-height: 1.2;}@@ -40,7 +43,9 @@}.task-center__header-actions {+ min-height: var(--page-title-row-height);display: flex;+ align-items: center;flex-wrap: wrap;justify-content: flex-end;gap: 8px;diff --git a/apps/web/src/host/bridge.ts b/apps/web/src/host/bridge.tsindex 9240e0d4..5c1d67ab 100644--- a/apps/web/src/host/bridge.ts+++ b/apps/web/src/host/bridge.ts@@ -1,4 +1,5 @@import type { ConnectionConfig } from '../runtime/types.js';+import type { ColorMode } from '../styles/color-mode.js';export type HostBridgeResult = { ok: true } | { ok: false; code: 'UNSUPPORTED' | 'FAILED'; message: string };@@ -44,6 +45,8 @@ export type HostBridge = {updateDesktopPreferences?(preferences: Partial<DesktopPreferences>): Promise<DesktopPreferences>;+ setWindowColorMode?(mode: ColorMode): Promise<void>;+ controlWindow?(action: 'close' | 'minimize' | 'zoom'): Promise<void>;selectProjectDirectory?(): Promise<string | null>;resolveDroppedFilePath?(file: File): string | null;};diff --git a/apps/web/src/host/desktop-bridge.ts b/apps/web/src/host/desktop-bridge.tsindex 4a55db98..8454a940 100644--- a/apps/web/src/host/desktop-bridge.ts+++ b/apps/web/src/host/desktop-bridge.ts@@ -31,6 +31,8 @@ type DesktopApi = {closeBehavior: 'hide' | 'quit';telemetryEnabled: boolean;}>;+ setWindowColorMode?(mode: 'light' | 'dark'): Promise<void>;+ controlWindow?(action: 'close' | 'minimize' | 'zoom'): Promise<void>;selectProjectDirectory(): Promise<string | null>;resolveDroppedFilePath(file: File): string | null;openExternal(url: string): Promise<void>;@@ -78,6 +80,12 @@ export function readDesktopHostBridge(): DesktopHostBridge | undefined {readDesktopPreferences: () => api.readDesktopPreferences(),updateDesktopPreferences: preferences =>api.updateDesktopPreferences(preferences),+ ...(windowChrome !== undefined && api.setWindowColorMode !== undefined+ ? { setWindowColorMode: (mode: 'light' | 'dark') => api.setWindowColorMode!(mode) }+ : {}),+ ...(windowChrome !== undefined && api.controlWindow !== undefined+ ? { controlWindow: (action: 'close' | 'minimize' | 'zoom') => api.controlWindow!(action) }+ : {}),selectProjectDirectory: () => api.selectProjectDirectory(),resolveDroppedFilePath: file => api.resolveDroppedFilePath(file),openExternal: url => api.openExternal(url),diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsxindex 671a5873..03fc169a 100644--- a/apps/web/src/main.tsx+++ b/apps/web/src/main.tsx@@ -26,7 +26,11 @@ import './styles/app.css';const desktopHostBridge = readDesktopHostBridge();-applyColorMode(readColorModePreference());+const initialColorMode = readColorModePreference();+applyColorMode(initialColorMode);+void desktopHostBridge?.setWindowColorMode?.(initialColorMode).catch(error => {+ console.error('Failed to synchronize native window color mode', error);+});applyAppLanguage(resolveAppLanguage(readLanguagePreference()));applyAccentColor(readAccentColorPreference(),diff --git a/apps/web/src/styles/app-css.test.ts b/apps/web/src/styles/app-css.test.tsindex 68e5cec9..39285493 100644--- a/apps/web/src/styles/app-css.test.ts+++ b/apps/web/src/styles/app-css.test.ts@@ -9,6 +9,8 @@ const schedulesCss = readSource('src/features/schedules/schedules-view.css');const settingsCss = readSource('src/features/settings/settings-management.css');const taskCenterCss = readSource('src/features/tasks/task-center.css');const tokensCss = readSource('src/styles/tokens.css');+const dashboardPageTsx = readSource('src/features/dashboard/DashboardPage.tsx');+const projectsPageTsx = readSource('src/features/projects/ProjectsPage.tsx');function cssBlock(selector: string) {const escapedSelector = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');@@ -36,6 +38,41 @@ function hexChannels(value: string): number[] {}describe('app CSS visual contracts', () => {+ 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');@@ -65,7 +102,8 @@ describe('app CSS visual contracts', () => {const neutralThemeSources = themeSources.replaceAll('#f59e0b', '').replace(/--destructive(?:-hover|-soft)?:\s*[^;]+;/g, '')- .replace(/--status-(?:connected|disconnected)(?:-soft)?:\s*[^;]+;/g, '');+ .replace(/--status-(?:connected|disconnected)(?:-soft)?:\s*[^;]+;/g, '')+ .replace(/\.desktop-window-control-(?:close|minimize|zoom)\s*\{[^}]*\}/g, '');const colorChannels = [...Array.from(neutralThemeSources.matchAll(/#([\da-f]{3}|[\da-f]{6})(?![\da-f])/gi), match =>hexChannels(match[1]!)@@ -81,16 +119,40 @@ describe('app CSS visual contracts', () => {expect(tokensCss).toContain('color-scheme: light;');expect(tokensCss).toContain('--accent: #d7d7da;');expect(tokensCss).toContain('--accent: #303035;');- expect(tokensCss).toContain('--surface-page: #fafafa;');- expect(tokensCss).toContain('--surface-sidebar: #f3f3f4;');- expect(tokensCss).toContain('--surface-input: #ffffff;');- expect(tokensCss).toContain('--surface-popover: #ffffff;');+ expect(tokensCss).toContain('--surface-page: #0a0a0a;');+ expect(tokensCss).toContain('--text: #e5e5e5;');+ expect(tokensCss).toContain('--surface-page: #e5e5e5;');+ expect(tokensCss).toContain('--text: #0a0a0a;');expect(tokensCss).toContain('--sidebar: var(--surface-sidebar);');- expect(tokensCss).toContain('--sidebar-hover: #e9e9eb;');expect(colorChannels.length).toBeGreaterThan(0);expect(colorChannels.every(channels => Math.max(...channels) - Math.min(...channels) <= 8)).toBe(true);});+ it('keeps layered gray surfaces neutral regardless of the selected accent', () => {+ const [dark, light] = tokensCss.split(':root[data-theme="light"]');+ for (const theme of [dark, light]) {+ expect(theme).toMatch(/--surface-page: #[\da-f]{6};/);+ expect(theme).toMatch(/--text: #[\da-f]{6};/);+ for (const role of ['surface-sidebar', 'surface-input', 'surface-popover', 'sidebar-hover', 'surface', 'surface-2', 'surface-3']) {+ expect(theme).toMatch(new RegExp(`--${role}: #[\\da-f]{6};`));+ }+ }+ });++ it('aligns page headings and settings controls with the sidebar brand row', () => {+ const dashboardCss = readSource('src/features/dashboard/dashboard.css');+ expect(tokensCss).toContain('--page-title-inset: 13px;');+ expect(tokensCss).toContain('--page-title-row-height: 42px;');+ expect(tokensCss).toContain('--page-title-band-height: 68px;');+ expect(cssBlock('.opencreator-page-content')).toContain('padding: var(--page-title-inset) 0 56px;');+ expect(dashboardCss).toMatch(/\.creator-tools-page-header\s*\{[^}]*min-height: var\(--page-title-row-height\);/);+ expect(appCss).toMatch(/(?:^|\n)\.opencreator-sidebar\s*\{[^}]*padding: var\(--page-title-inset\) 12px 8px;/);+ expect(cssBlock('.sidebar-brand')).toContain('min-height: var(--page-title-row-height);');+ expect(cssBlock('.opencreator-sidebar[data-collapsed="true"]')).toContain('padding: var(--page-title-inset) 8px 12px;');+ expect(cssBlock('.settings-back')).toContain('min-height: var(--page-title-row-height);');+ expect(cssBlock('.settings-section h1')).toContain('min-height: var(--page-title-row-height);');+ });+it('assigns page, sidebar, composer, and popover surfaces by semantic role', () => {expect(tokensCss).toContain('--bg: var(--surface-page);');expect(tokensCss).toContain('--conversation-bg: var(--surface-page);');@@ -100,6 +162,29 @@ describe('app CSS visual contracts', () => {expect(cssBlock('.composer-popover')).toContain('background: var(--popover);');});+ it('extends the desktop settings sidebar behind the title bar without moving its controls', () => {+ expect(cssBlock('.app-drop-shell[data-integrated-title-bar="true"] .opencreator-main-pane:has(.settings-page)'))+ .toContain('padding-top: 0;');+ expect(cssBlock('.app-drop-shell[data-integrated-title-bar="true"] .settings-sidebar'))+ .toContain('padding-top: calc(var(--page-title-inset) + var(--opencreator-titlebar-height, 38px));');+ expect(cssBlock('.app-drop-shell[data-integrated-title-bar="true"] .settings-content'))+ .toContain('padding-top: calc(var(--page-title-inset) + var(--opencreator-titlebar-height, 38px));');+ expect(appCss).toMatch(/(?:^|\n)\.settings-content\s*\{[^}]*padding: var\(--page-title-inset\) 24px 48px;/);+ expect(appCss).toMatch(/@media \(max-width: 720px\)\s*\{[\s\S]*?\.app-drop-shell\[data-integrated-title-bar="true"\] \.settings-content\s*\{\s*padding-top: 24px;/);+ expect(cssBlock('.desktop-titlebar-drag-region')).toContain('display: none;');+ });++ it('uses the shared page gutter and content width for every settings tab', () => {+ const settingsView = readSource('src/features/settings/OpenCreatorSettingsView.tsx');+ const managementCss = readSource('src/features/settings/settings-management.css');+ const servicesCss = readSource('src/features/settings/creator-services-settings.css');+ expect(settingsView).toContain('className="opencreator-scroll-page settings-content"');+ expect(cssBlock('.settings-section')).toContain('width: min(1160px, 100%);');+ expect(cssBlock('.settings-section')).toContain('margin: 0 auto;');+ expect(managementCss).not.toMatch(/\.settings-management\s*\{[^}]*width:/);+ expect(servicesCss).not.toMatch(/\.creator-services-settings\s*\{[^}]*width:/);+ });+it('limits ordinary corner radii to the 4px, 6px, and 8px scale', () => {const productCss = [appCss, skillMarketCss, schedulesCss, settingsCss, taskCenterCss].join('\n');const radiusValues = Array.from(@@ -339,8 +424,8 @@ describe('app CSS visual contracts', () => {const mainPane = cssBlock('.opencreator-main-pane');expect(appCss).toMatch(/html,\nbody,\n#root\s*\{[^}]*height:\s*100%;[^}]*min-height:\s*0;[^}]*overflow:\s*hidden;[^}]*background:\s*var\(--bg\);/);- expect(tokensCss).toContain('--surface-page: #0c0d0f;');- expect(tokensCss).toContain('--surface-page: #fafafa;');+ expect(tokensCss).toContain('--surface-page: #0a0a0a;');+ expect(tokensCss).toContain('--surface-page: #e5e5e5;');expect(tokensCss).toContain('--bg: var(--surface-page);\n --conversation-bg: var(--surface-page);');expect(mainPane).toContain('background: var(--conversation-bg);');expect(mainPane).toContain('overflow: hidden;');@@ -609,10 +694,10 @@ describe('app CSS visual contracts', () => {expect(composer).toContain('gap: 8px;');expect(composer).toContain('padding: 10px 18px;');expect(composer).toContain('width: 100%;');- expect(composer).toContain('--composer-input-background: #1a1b1e;');- expect(composer).toContain('--composer-project-background: #232427;');- expect(composer).toContain('--composer-border: rgba(245, 245, 246, 0.12);');- expect(composer).toContain('--composer-separator: rgba(245, 245, 246, 0.06);');+ expect(composer).toContain('--composer-input-background: var(--surface-input);');+ expect(composer).toContain('--composer-project-background: var(--surface-popover);');+ expect(composer).toContain('--composer-border: rgba(229, 229, 229, 0.12);');+ expect(composer).toContain('--composer-separator: rgba(229, 229, 229, 0.06);');expect(composer).toContain('border: 1px solid var(--composer-border);');expect(cssBlock('.opencreator-composer::after')).toContain('background: var(--composer-input-background);'@@ -640,7 +725,7 @@ describe('app CSS visual contracts', () => {expect(cssBlock('.composer-popover')).toContain('background: var(--popover);');expect(cssBlock('.composer-popover')).toContain('opacity: 1;');expect(cssBlock(':root[data-theme="light"] .composer-popover')).toContain('background: var(--surface-popover);');- expect(cssBlock(':root[data-theme="light"] .composer-popover')).toContain('border-color: #dedee1;');+ expect(cssBlock(':root[data-theme="light"] .composer-popover')).toContain('border-color: var(--border);');expect(cssBlock(':root[data-theme="light"] .composer-popover')).toContain('opacity: 1;');expect(cssBlock('.composer-menu-item')).toContain('min-height: var(--control-compact-lg);');expect(cssBlock('.composer-menu-item strong')).toContain('font-size: 12px;');@@ -650,10 +735,10 @@ describe('app CSS visual contracts', () => {expect(cssBlock('.composer-project-option span')).toContain('font-size: 12px;');expect(cssBlock('.composer-project-option span')).toContain('font-weight: 400;');expect(cssBlock('.composer-popover.composer-project-popover')).toContain('border: 1px solid #343438;');- expect(cssBlock(':root[data-theme="light"] .composer-popover.composer-project-popover')).toContain('border-color: #e8e8ea;');+ expect(cssBlock(':root[data-theme="light"] .composer-popover.composer-project-popover')).toContain('border-color: var(--border-hairline);');expect(cssBlock('.composer-project-search')).toContain('border: 0;');- expect(cssBlock(':root[data-theme="light"] .composer-project-search')).toContain('background: #f3f3f4;');- expect(cssBlock(':root[data-theme="light"] .composer-project-create')).toContain('border-top-color: #eeeeef;');+ expect(cssBlock(':root[data-theme="light"] .composer-project-search')).toContain('background: var(--surface);');+ expect(cssBlock(':root[data-theme="light"] .composer-project-create')).toContain('border-top-color: var(--border-hairline);');expect(appCss).toMatch(/\.composer-send\s*\{[^}]*width:\s*38px;[^}]*height:\s*38px;/);expect(appCss).toMatch(/\n\.composer-icon-button\s*\{[^}]*background:\s*transparent;[^}]*box-shadow:\s*none;/);expect(cssBlock('.composer-icon-button:hover')).toContain('color-mix(in srgb, var(--text) 4%, transparent)');@@ -706,8 +791,8 @@ describe('app CSS visual contracts', () => {);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);'@@ -715,7 +800,7 @@ describe('app CSS visual contracts', () => {expect(cssBlock('.opencreator-composer.without-project-selector::after')).toContain('inset: 0;');expect(cssBlock('.opencreator-composer::before')).toContain('border: 0;');expect(cssBlock('.opencreator-composer::before')).toContain('z-index: 0;');- expect(lightComposer).toContain('--composer-project-background: #eeeeef;');+ expect(lightComposer).toContain('--composer-project-background: var(--surface);');expect(lightComposer).toContain('background: var(--composer-project-background);');expect(cssBlock(':root[data-theme="light"] .opencreator-composer::after')).toContain('background: var(--surface-input);');expect(lightComposer).toContain('backdrop-filter: none;');@@ -820,8 +905,8 @@ describe('app CSS visual contracts', () => {it('uses a solid conversation background without dynamic background assets', () => {const conversationPage = cssBlock('.conversation-page');- expect(tokensCss).toContain('--surface-page: #0c0d0f;');- expect(tokensCss).toContain('--surface-page: #fafafa;');+ expect(tokensCss).toContain('--surface-page: #0a0a0a;');+ expect(tokensCss).toContain('--surface-page: #e5e5e5;');expect(tokensCss).toContain('--conversation-bg: var(--surface-page);');expect(conversationPage).toContain('background: var(--conversation-bg);');expect(appCss).not.toContain('.conversation-lightfall-bg');@@ -964,10 +1049,10 @@ describe('app CSS visual contracts', () => {match => match.groups?.body ?? '').find(block => block.includes('min-height: 40px;')) ?? '';- expect(composer).toContain('--composer-input-background: #1a1b1e;');- expect(composer).toContain('--composer-project-background: #232427;');- expect(composer).toContain('--composer-border: rgba(245, 245, 246, 0.12);');- expect(composer).toContain('--composer-separator: rgba(245, 245, 246, 0.06);');+ expect(composer).toContain('--composer-input-background: var(--surface-input);');+ expect(composer).toContain('--composer-project-background: var(--surface-popover);');+ expect(composer).toContain('--composer-border: rgba(229, 229, 229, 0.12);');+ expect(composer).toContain('--composer-separator: rgba(229, 229, 229, 0.06);');expect(composer).toContain('border: 1px solid var(--composer-border);');expect(composerAfter).toContain('background: var(--composer-input-background);');expect(projectContext).toContain('background: var(--composer-project-background);');diff --git a/apps/web/src/styles/app.css b/apps/web/src/styles/app.cssindex ae07f000..8e7d55fd 100644--- a/apps/web/src/styles/app.css+++ b/apps/web/src/styles/app.css@@ -69,7 +69,7 @@ body,}.app-drop-shell[data-integrated-title-bar="true"] .opencreator-sidebar {- padding-top: calc(13px + var(--opencreator-titlebar-height, 38px));+ padding-top: calc(var(--page-title-inset) + var(--opencreator-titlebar-height, 38px));}.app-drop-shell[data-integrated-title-bar="true"] .opencreator-main-pane,@@ -77,6 +77,18 @@ body,padding-top: var(--opencreator-titlebar-height, 38px);}+.app-drop-shell[data-integrated-title-bar="true"] .opencreator-main-pane:has(.settings-page) {+ padding-top: 0;+}++.app-drop-shell[data-integrated-title-bar="true"] .settings-sidebar {+ padding-top: calc(var(--page-title-inset) + var(--opencreator-titlebar-height, 38px));+}++.app-drop-shell[data-integrated-title-bar="true"] .settings-content {+ padding-top: calc(var(--page-title-inset) + var(--opencreator-titlebar-height, 38px));+}+.app-drop-shell[data-integrated-title-bar="true"] .opencreator-main-pane[data-has-main-header="true"] {grid-template-rows: var(--opencreator-titlebar-height, 38px) minmax(0, 1fr);padding-top: 0;@@ -97,6 +109,51 @@ body,-webkit-app-region: no-drag;}+.desktop-window-controls {+ position: absolute;+ z-index: 90;+ top: 0;+ left: 10px;+ width: 66px;+ height: var(--opencreator-titlebar-height, 38px);+ display: flex;+ align-items: center;+ gap: 6px;+ -webkit-app-region: no-drag;+}++.desktop-window-control {+ width: 16px;+ height: 16px;+ flex: 0 0 16px;+ display: grid;+ place-items: center;+ padding: 0;+ border: 1px solid rgba(0, 0, 0, 0.2);+ border-radius: 50%;+ color: rgba(0, 0, 0, 0.65);+ cursor: default;+ -webkit-app-region: no-drag;+}++.desktop-window-control svg {+ opacity: 0;+}++.desktop-window-controls:hover svg,+.desktop-window-control:focus-visible svg {+ opacity: 1;+}++.desktop-window-control-close { background: #ff5f57; }+.desktop-window-control-minimize { background: #febc2e; }+.desktop-window-control-zoom { background: #28c840; }++.desktop-window-control:focus-visible {+ outline: 2px solid var(--text);+ outline-offset: 2px;+}+.project-drop-overlay {position: absolute;inset: 12px;@@ -3467,10 +3524,10 @@ html.is-pane-resizing * {}.opencreator-composer {- --composer-input-background: #1a1b1e;- --composer-project-background: #232427;- --composer-border: rgba(245, 245, 246, 0.12);- --composer-separator: rgba(245, 245, 246, 0.06);+ --composer-input-background: var(--surface-input);+ --composer-project-background: var(--surface-popover);+ --composer-border: rgba(229, 229, 229, 0.12);+ --composer-separator: rgba(229, 229, 229, 0.06);--composer-left-baseline: 20px;position: relative;isolation: isolate;@@ -3520,7 +3577,7 @@ html.is-pane-resizing * {:root[data-theme="light"] .opencreator-composer {--composer-input-background: var(--surface-input);- --composer-project-background: #eeeeef;+ --composer-project-background: var(--surface);--composer-border: var(--border-hairline);--composer-separator: transparent;background: var(--composer-project-background);@@ -3954,7 +4011,7 @@ html.is-pane-resizing * {border: 1px solid rgb(255 255 255 / 16%);border-radius: 999px;background: rgb(24 24 27 / 88%);- color: #f4f4f5;+ color: #e5e5e5;box-shadow: none;pointer-events: auto;}@@ -4394,16 +4451,16 @@ html.is-pane-resizing * {:root[data-theme="light"] .composer-popover {background: var(--surface-popover);- border-color: #dedee1;+ border-color: var(--border);opacity: 1;}:root[data-theme="light"] .composer-popover.composer-project-popover {- border-color: #e8e8ea;+ border-color: var(--border-hairline);}:root[data-theme="light"] .composer-project-search {- background: #f3f3f4;+ background: var(--surface);}:root[data-theme="light"] .composer-project-search:focus-within {@@ -4411,7 +4468,7 @@ html.is-pane-resizing * {}:root[data-theme="light"] .composer-project-create {- border-top-color: #eeeeef;+ border-top-color: var(--border-hairline);}.composer-right-actions .composer-popover {@@ -4850,6 +4907,23 @@ html.is-pane-resizing * {overflow: hidden;}+.opencreator-page-content {+ width: min(1160px, calc(100% - 48px));+ margin: 0 auto;+ padding: var(--page-title-inset) 0 56px;+}++.opencreator-scroll-page {+ scrollbar-gutter: stable;+}++@media (max-width: 760px) {+ .opencreator-page-content {+ width: calc(100% - 28px);+ padding: 24px 0 40px;+ }+}+.mobile-navigation-toolbar,.mobile-navigation-backdrop,.mobile-navigation-close {@@ -4867,13 +4941,13 @@ html.is-pane-resizing * {display: grid;grid-template-rows: auto auto minmax(0, 1fr) auto auto;gap: 9px;- padding: 13px 12px 8px;+ padding: var(--page-title-inset) 12px 8px;color: var(--text);}.sidebar-brand {min-width: 0;- min-height: 42px;+ min-height: var(--page-title-row-height);display: flex;align-items: flex-start;justify-content: space-between;@@ -4991,6 +5065,10 @@ html.is-pane-resizing * {gap: 1px;}+.sidebar-primary {+ gap: 6px;+}+.sidebar-section {min-width: 0;min-height: 0;@@ -5567,15 +5645,13 @@ html.is-pane-resizing * {height: 28px;display: grid;place-items: center;- border: 1px solid transparent;- border-radius: 8px;+ border: 0;color: color-mix(in srgb, var(--text) 68%, transparent);background: transparent;}.sidebar-primary .sidebar-row:hover .sidebar-nav-icon {color: var(--text);- background: color-mix(in srgb, var(--text) 6%, transparent);}.sidebar-primary .sidebar-row[aria-current="page"] {@@ -5586,9 +5662,7 @@ html.is-pane-resizing * {}.sidebar-primary .sidebar-row[aria-current="page"] .sidebar-nav-icon {- border-color: color-mix(in srgb, var(--accent) 24%, transparent);color: var(--accent-strong);- background: color-mix(in srgb, var(--accent) 12%, transparent);}.sidebar-primary .sidebar-row:active .sidebar-nav-icon {@@ -5732,7 +5806,7 @@ html.is-pane-resizing * {grid-template-rows: auto auto minmax(0, 1fr) auto;gap: 14px;align-items: start;- padding: 20px 8px 12px;+ padding: var(--page-title-inset) 8px 12px;}.opencreator-sidebar[data-collapsed="true"] .sidebar-brand {@@ -5804,13 +5878,13 @@ html.is-pane-resizing * {display: grid;grid-template-rows: auto auto minmax(0, 1fr);gap: 14px;- padding: 14px 12px;+ padding: var(--page-title-inset) 12px;border-right: 1px solid color-mix(in srgb, var(--text) 8%, transparent);background: var(--sidebar);}.settings-back {- min-height: 32px;+ min-height: var(--page-title-row-height);justify-self: start;padding: 0 10px;border-radius: 6px;@@ -5886,11 +5960,12 @@ html.is-pane-resizing * {min-width: 0;min-height: 0;overflow: auto;- padding: 48px clamp(24px, 6vw, 72px);+ padding: var(--page-title-inset) 24px 48px;}.settings-section {- width: min(720px, 100%);+ width: min(1160px, 100%);+ margin: 0 auto;display: grid;gap: 18px;}@@ -5907,6 +5982,9 @@ html.is-pane-resizing * {}.settings-section h1 {+ min-height: var(--page-title-row-height);+ display: flex;+ align-items: center;font-size: 26px;line-height: 1.2;}@@ -6216,6 +6294,10 @@ html.is-pane-resizing * {padding: 24px 16px;}+ .app-drop-shell[data-integrated-title-bar="true"] .settings-content {+ padding-top: 24px;+ }+.settings-row {grid-template-columns: 1fr;gap: 4px;@@ -7450,6 +7532,11 @@ html.is-pane-resizing * {min-height: var(--control-touch) !important;}+ .app-drop-shell .desktop-window-control {+ min-width: 16px;+ min-height: 16px !important;+ }+.sidebar-task-list {grid-auto-rows: var(--control-touch);}diff --git a/apps/web/src/styles/tokens.css b/apps/web/src/styles/tokens.cssindex 47e5ad7d..00cdc8df 100644--- a/apps/web/src/styles/tokens.css+++ b/apps/web/src/styles/tokens.css@@ -1,38 +1,44 @@+:root {+ --page-title-inset: 13px;+ --page-title-row-height: 42px;+ --page-title-band-height: 68px;+}+:root,:root[data-theme="dark"] {color-scheme: dark;- --surface-page: #0c0d0f;- --surface-sidebar: #111214;- --surface-input: #18191c;- --surface-popover: #242529;+ --surface-page: #0a0a0a;+ --surface-sidebar: #111111;+ --surface-input: #1a1a1a;+ --surface-popover: #252525;--bg: var(--surface-page);--conversation-bg: var(--surface-page);--sidebar: var(--surface-sidebar);- --sidebar-hover: #18191c;- --surface: #18191c;- --surface-2: #1f2023;- --surface-3: #282a2e;+ --sidebar-hover: #1a1a1a;+ --surface: #181818;+ --surface-2: #202020;+ --surface-3: #292929;--popover: var(--surface-popover);- --border: rgba(245, 245, 246, 0.1);- --border-hairline: rgba(245, 245, 246, 0.08);- --border-strong: rgba(245, 245, 246, 0.3);- --text: #f4f4f5;- --muted: rgba(244, 244, 245, 0.7);- --subtle: rgba(244, 244, 245, 0.46);+ --border: rgba(229, 229, 229, 0.1);+ --border-hairline: rgba(229, 229, 229, 0.08);+ --border-strong: rgba(229, 229, 229, 0.3);+ --text: #e5e5e5;+ --muted: rgba(229, 229, 229, 0.7);+ --subtle: rgba(229, 229, 229, 0.46);--accent: #d7d7da;--accent-strong: #f0f0f1;- --accent-soft: rgba(244, 244, 245, 0.1);- --accent-glow: rgba(244, 244, 245, 0.18);- --on-accent: #171719;+ --accent-soft: rgba(229, 229, 229, 0.1);+ --accent-glow: rgba(229, 229, 229, 0.18);+ --on-accent: #0a0a0a;--danger: #d4d4d7;- --danger-soft: rgba(244, 244, 245, 0.08);+ --danger-soft: rgba(229, 229, 229, 0.08);--destructive: #ef4444;--destructive-hover: #dc2626;--destructive-soft: rgba(239, 68, 68, 0.13);--warning: #bcbcc1;- --warning-soft: rgba(244, 244, 245, 0.07);+ --warning-soft: rgba(229, 229, 229, 0.07);--success: #ededee;- --success-soft: rgba(244, 244, 245, 0.1);+ --success-soft: rgba(229, 229, 229, 0.1);--status-connected: #34d399;--status-connected-soft: rgba(52, 211, 153, 0.18);--status-disconnected: #f87171;@@ -42,8 +48,8 @@--shadow-popover: 0 12px 32px rgba(5, 5, 6, 0.34);--shadow-dialog: 0 24px 64px rgba(5, 5, 6, 0.44);--control-disabled: linear-gradient(180deg, #414348, #292b2f);- --control-disabled-text: rgba(244, 244, 245, 0.48);- --ambient-glow: rgba(244, 244, 245, 0.11);+ --control-disabled-text: rgba(229, 229, 229, 0.48);+ --ambient-glow: rgba(229, 229, 229, 0.11);--scrim: rgba(5, 5, 6, 0.7);--logo-filter: grayscale(1) contrast(1.08) brightness(1.08);--radius-sm: 4px;@@ -69,50 +75,50 @@:root[data-theme="light"] {color-scheme: light;- --surface-page: #fafafa;- --surface-sidebar: #f3f3f4;- --surface-input: #ffffff;- --surface-popover: #ffffff;+ --surface-page: #e5e5e5;+ --surface-sidebar: #dedede;+ --surface-input: #f3f3f3;+ --surface-popover: #f3f3f3;--bg: var(--surface-page);--conversation-bg: var(--surface-page);--sidebar: var(--surface-sidebar);- --sidebar-hover: #e9e9eb;- --surface: #fafafa;- --surface-2: #f0f0f1;- --surface-3: #e4e4e6;+ --sidebar-hover: #d6d6d6;+ --surface: #ebebeb;+ --surface-2: #dadada;+ --surface-3: #cecece;--popover: var(--surface-popover);- --border: rgba(24, 24, 27, 0.12);- --border-hairline: rgba(24, 24, 27, 0.07);- --border-strong: rgba(24, 24, 27, 0.32);- --text: #18181b;- --muted: rgba(24, 24, 27, 0.68);- --subtle: rgba(24, 24, 27, 0.46);+ --border: rgba(10, 10, 10, 0.12);+ --border-hairline: rgba(10, 10, 10, 0.07);+ --border-strong: rgba(10, 10, 10, 0.32);+ --text: #0a0a0a;+ --muted: rgba(10, 10, 10, 0.68);+ --subtle: rgba(10, 10, 10, 0.46);--accent: #303035;- --accent-strong: #18181b;- --accent-soft: rgba(24, 24, 27, 0.08);- --accent-glow: rgba(24, 24, 27, 0.14);- --on-accent: #f7f7f8;+ --accent-strong: #0a0a0a;+ --accent-soft: rgba(10, 10, 10, 0.08);+ --accent-glow: rgba(10, 10, 10, 0.14);+ --on-accent: #e5e5e5;--danger: #3f3f46;- --danger-soft: rgba(24, 24, 27, 0.06);+ --danger-soft: rgba(10, 10, 10, 0.06);--destructive: #dc2626;--destructive-hover: #b91c1c;--destructive-soft: rgba(220, 38, 38, 0.09);--warning: #525256;- --warning-soft: rgba(24, 24, 27, 0.055);+ --warning-soft: rgba(10, 10, 10, 0.055);--success: #27272a;- --success-soft: rgba(24, 24, 27, 0.07);+ --success-soft: rgba(10, 10, 10, 0.07);--status-connected: #16a34a;--status-connected-soft: rgba(22, 163, 74, 0.14);--status-disconnected: #dc2626;--status-disconnected-soft: rgba(220, 38, 38, 0.12);- --shadow-base: #18181b;- --shadow: 0 18px 48px rgba(24, 24, 27, 0.12);- --shadow-popover: 0 12px 28px rgba(24, 24, 27, 0.14);- --shadow-dialog: 0 24px 60px rgba(24, 24, 27, 0.18);+ --shadow-base: #0a0a0a;+ --shadow: 0 18px 48px rgba(10, 10, 10, 0.12);+ --shadow-popover: 0 12px 28px rgba(10, 10, 10, 0.14);+ --shadow-dialog: 0 24px 60px rgba(10, 10, 10, 0.18);--control-disabled: linear-gradient(180deg, #e4e4e6, #d8d8db);- --control-disabled-text: rgba(24, 24, 27, 0.46);- --ambient-glow: rgba(24, 24, 27, 0.07);- --scrim: rgba(24, 24, 27, 0.56);+ --control-disabled-text: rgba(10, 10, 10, 0.46);+ --ambient-glow: rgba(10, 10, 10, 0.07);+ --scrim: rgba(10, 10, 10, 0.56);--logo-filter: grayscale(1) contrast(1.12) brightness(0.78);--state-hover-bg: color-mix(in srgb, var(--text) 5%, transparent);--state-pressed-bg: color-mix(in srgb, var(--text) 9%, transparent);diff --git a/docs/operations/opencreator-desktop-release-runbook.md b/docs/operations/opencreator-desktop-release-runbook.mdindex 4ed3bd57..38ebb053 100644--- a/docs/operations/opencreator-desktop-release-runbook.md+++ b/docs/operations/opencreator-desktop-release-runbook.md@@ -30,7 +30,7 @@ pnpm desktop:package1. Node.js 22。2. pnpm 9.15.0。-3. macOS 构建机安装 Xcode Command Line Tools。+3. macOS 构建机安装完整的 Xcode 26 或更新版本,并通过 `xcode-select` 选中对应 Developer 目录;仅安装 Command Line Tools 不足以编译自适应应用图标。4. Windows 构建机允许执行 PowerShell 和 NSIS 打包工具。5. 仓库全量测试、类型检查和构建通过。6. 打包脚本会删除目标架构旧目录,并要求构建后只找到一个 fresh package root。@@ -39,6 +39,8 @@ pnpm desktop:package9. OSV Scanner 2.3.8 扫描发布源码无未解释漏洞。10. `.github/workflows/desktop-release.yml` 通过 actionlint。+macOS 打包时,`resources/OpenCreator.icon` 在 `afterPack` 阶段编译为 App 内的 `Assets.car`,由 `CFBundleIconName` 引用;系统暗色图标使用深色背景和白色品牌图形。原有 `icon.icns` 保留用于旧版 macOS。包校验会检查明暗两种 rendition 和暗色品牌图形的白色填充,资源缺失时阻止交付。+## 3. 版本与标签1. 更新 `apps/desktop/package.json` 的版本。