From 8b03291327461aacaf0c4df029becaa8058263f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E5=B7=A5?= Date: Wed, 30 Sep 2026 09:26:36 +0800 Subject: [PATCH] =?UTF-8?q?HEL-652:=20B=20=E6=89=B9=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E5=A3=B3=E5=B1=82=E2=80=94=E2=80=9460px=20=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E8=BD=A8=E3=80=81=E9=A1=B6=E6=A0=8F=E4=B8=8E=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=BA=95=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 216px 文字侧栏改为 60px 图标轨:金色渐变 Logo、当前页金色指示条滑动、350ms 延迟悬停提示,底部连接/模型/设置/语言 - 顶栏:标题+副标题、项目范围胶囊(全部项目列表/最近项目)、Ctrl/⌘K 搜索、减少动态开关、任务托盘胶囊、本次连接胶囊(名称+延迟) - ≤760px:隐藏图标轨,底部 项目/创作/生成/更多 四个标签,更多为底部抽屉(其余页面、搜索、减少动态、语言);删除「手机端暂不适配」拦截 - 新增 ShellPop(Esc/↑↓/Tab 循环/外部点击关闭、焦点归还)与 CommandPalette(复用 Modal) - 减少动态:跟随系统设置,另可手动开启并持久化(data-reduce) - .a-darkroom 背景接入 --page-glow;新增壳层尺寸 token 与 .a-kbd/.a-menu-* 公共类 - 生图/生视频顶栏去掉与全局胶囊重复的连接状态(参数栏仍显示所选连接与队列) - 路由 URL 不变(/projects 仍重定向到项目总览 /) Co-authored-by: multica-agent Co-authored-by: Cursor --- .../src/lib/components/ToastHost.svelte | 2 +- .../src/lib/components/shell/AppShell.svelte | 997 ++++++++++-------- .../components/shell/CommandPalette.svelte | 218 ++++ .../lib/components/shell/ProjectScope.svelte | 127 +++ .../src/lib/components/shell/QueueTray.svelte | 164 +++ .../src/lib/components/shell/ShellPop.svelte | 184 ++++ calliope-web/src/lib/components/shell/nav.ts | 70 ++ .../components/studio/StudioGenerate.svelte | 16 - calliope-web/src/lib/i18n/de.ts | 40 +- calliope-web/src/lib/i18n/en.ts | 40 +- calliope-web/src/lib/i18n/es.ts | 40 +- calliope-web/src/lib/i18n/fr.ts | 40 +- calliope-web/src/lib/i18n/ja.ts | 40 +- calliope-web/src/lib/i18n/ko.ts | 40 +- calliope-web/src/lib/i18n/zh.ts | 40 +- calliope-web/src/lib/reduceMotion.svelte.ts | 45 + calliope-web/src/routes/+layout.svelte | 4 + calliope-web/src/routes/app.css | 96 +- 18 files changed, 1730 insertions(+), 473 deletions(-) create mode 100644 calliope-web/src/lib/components/shell/CommandPalette.svelte create mode 100644 calliope-web/src/lib/components/shell/ProjectScope.svelte create mode 100644 calliope-web/src/lib/components/shell/QueueTray.svelte create mode 100644 calliope-web/src/lib/components/shell/ShellPop.svelte create mode 100644 calliope-web/src/lib/components/shell/nav.ts create mode 100644 calliope-web/src/lib/reduceMotion.svelte.ts diff --git a/calliope-web/src/lib/components/ToastHost.svelte b/calliope-web/src/lib/components/ToastHost.svelte index 40debcac..721863f3 100644 --- a/calliope-web/src/lib/components/ToastHost.svelte +++ b/calliope-web/src/lib/components/ToastHost.svelte @@ -146,7 +146,7 @@ } @media (max-width: 760px) { .toast-host { - bottom: 20px; + bottom: calc(var(--tabbar-h) + var(--sp-5) + env(safe-area-inset-bottom)); right: 16px; left: 16px; max-width: none; diff --git a/calliope-web/src/lib/components/shell/AppShell.svelte b/calliope-web/src/lib/components/shell/AppShell.svelte index 635cee02..705e03de 100644 --- a/calliope-web/src/lib/components/shell/AppShell.svelte +++ b/calliope-web/src/lib/components/shell/AppShell.svelte @@ -1,65 +1,55 @@ + + {title} · {t('shell.brand')} + + +{#snippet railLink(item: NavItem)} + + + {#if item.id === 'tasks' && activeJobs > 0} + + {:else if item.id === 'connections'} + + {/if} + + +{/snippet} +
- -
- -

{t('shell.mobileNotice')}

-
-
- +
-
+

{title}

{#if subtitle}

{subtitle}

{/if}
+ +
{#if actions}
{@render actions()}
{/if} +
+ + + + + + {probeState === 'unset' ? t('shell.comfyUnset') : endpointName} + {#if latencyMs != null}· {latencyMs} ms{/if} + +
{@render children?.()}
+ +
+ + diff --git a/calliope-web/src/lib/components/shell/CommandPalette.svelte b/calliope-web/src/lib/components/shell/CommandPalette.svelte new file mode 100644 index 00000000..eaaac0a8 --- /dev/null +++ b/calliope-web/src/lib/components/shell/CommandPalette.svelte @@ -0,0 +1,218 @@ + + + +
+ +
+ {#if entries.length === 0} +

{t('shell.searchEmpty', { q: query.trim() })}

+ {/if} + {#each entries as entry, i (entry.key)} + {#if i === 0 || entries[i - 1].group !== entry.group} + + {/if} +
(activeIndex = i)} + onmousedown={(e) => e.preventDefault()} + onclick={() => go(entry)} + onkeydown={handleKeydown} + > + + {entry.label} + {entry.href} +
+ {/each} +
+

+ ↑↓{t('shell.searchHintMove')} + Enter{t('shell.searchHintOpen')} + Esc{t('shell.searchHintClose')} +

+
+
+ + diff --git a/calliope-web/src/lib/components/shell/ProjectScope.svelte b/calliope-web/src/lib/components/shell/ProjectScope.svelte new file mode 100644 index 00000000..207963ee --- /dev/null +++ b/calliope-web/src/lib/components/shell/ProjectScope.svelte @@ -0,0 +1,127 @@ + + +
+ + + + (open = false)} + > + + {t('shell.scopeAllList')} + {#if all.length > 0}{all.length}{/if} + +
{t('shell.scopeRecent')}
+ {#if $projectsQuery.isPending} +

{t('common.loading')}…

+ {:else if $projectsQuery.isError} +

{t('shell.scopeLoadFailed')}

+ {:else if recent.length === 0} + (open = false)}> + + {t('shell.scopeEmpty')} + + {:else} + {#each recent as project (project.id)} + (open = false)} + > + + {project.title} + {#if project.stats} + + {t('shell.scopeStage', { n: project.stats.stage_confirmed })} + + {/if} + + {/each} + {/if} +
+
+ + diff --git a/calliope-web/src/lib/components/shell/QueueTray.svelte b/calliope-web/src/lib/components/shell/QueueTray.svelte new file mode 100644 index 00000000..01543a6d --- /dev/null +++ b/calliope-web/src/lib/components/shell/QueueTray.svelte @@ -0,0 +1,164 @@ + + +
+ + + +
{t('shell.trayRecent')}
+ {#if recent.length === 0} +

{t('shell.trayEmpty')}

+ {:else} + {#each recent as job (job.id)} + {@const info = jobStatusInfo(job)} + (open = false)}> + + {workflowName(job)} + {jobSourceLabel(job)} · {timeOf(job)} + + {info.label} + + {/each} + {/if} + (open = false)}> + {t('shell.trayAll')} + +
+
+ + diff --git a/calliope-web/src/lib/components/shell/ShellPop.svelte b/calliope-web/src/lib/components/shell/ShellPop.svelte new file mode 100644 index 00000000..e016148e --- /dev/null +++ b/calliope-web/src/lib/components/shell/ShellPop.svelte @@ -0,0 +1,184 @@ + + +{#if open} + + +{/if} + + diff --git a/calliope-web/src/lib/components/shell/nav.ts b/calliope-web/src/lib/components/shell/nav.ts new file mode 100644 index 00000000..11d48cbb --- /dev/null +++ b/calliope-web/src/lib/components/shell/nav.ts @@ -0,0 +1,70 @@ +import type { IconName } from '$lib/components/ui/icons'; + +export type NavId = + | 'projects' + | 'workbench' + | 'image' + | 'video' + | 'tasks' + | 'agents' + | 'connections' + | 'models' + | 'settings'; + +export interface NavItem { + id: NavId; + labelKey: string; + icon: IconName; + href: string; +} + +// Order is fixed by spec-v2 §3: 项目 / 创作工作台 / 生图 / 生视频 / 生成任务 / +// 智能体 / ComfyUI 连接 / 模型设置 / 设置. HEL-649 §二 puts the connection +// and settings entries at the foot of the 60px rail. +export const NAV_MAIN: NavItem[] = [ + { id: 'projects', labelKey: 'shell.navProjects', icon: 'home', href: '/' }, + { id: 'workbench', labelKey: 'shell.navWorkbench', icon: 'story', href: '/workbench' }, + { id: 'image', labelKey: 'shell.navImage', icon: 'image', href: '/image' }, + { id: 'video', labelKey: 'shell.navVideo', icon: 'film', href: '/video' }, + { id: 'tasks', labelKey: 'shell.navTasks', icon: 'queue', href: '/tasks' }, + { id: 'agents', labelKey: 'shell.navAgents', icon: 'sparkle', href: '/agents' }, +]; + +export const NAV_FOOT: NavItem[] = [ + { id: 'connections', labelKey: 'shell.navConnections', icon: 'link', href: '/connections' }, + { id: 'models', labelKey: 'shell.navModels', icon: 'assets', href: '/models' }, + { id: 'settings', labelKey: 'shell.navSettings', icon: 'settings', href: '/settings' }, +]; + +export const NAV: NavItem[] = [...NAV_MAIN, ...NAV_FOOT]; + +export interface TabItem { + id: 'projects' | 'workbench' | 'generate'; + labelKey: string; + icon: IconName; + href: string; + /** Pages that light this tab up. */ + covers: NavId[]; +} + +/** ≤760px bottom tab bar (§二): 项目 / 创作 / 生成 / 更多. */ +export const TABS: TabItem[] = [ + { id: 'projects', labelKey: 'shell.tabProjects', icon: 'home', href: '/', covers: ['projects'] }, + { id: 'workbench', labelKey: 'shell.tabCreate', icon: 'story', href: '/workbench', covers: ['workbench'] }, + { + id: 'generate', + labelKey: 'shell.tabGenerate', + icon: 'image', + href: '/image', + covers: ['image', 'video'], + }, +]; + +/** + * Every page a tab does not link to directly lives in the 更多 sheet. 生视频 + * is still its own route, so it is listed there too until the two + * generation pages merge. + */ +export const MORE_ITEMS: NavItem[] = NAV.filter( + (item) => !TABS.some((tab) => tab.href === item.href), +); diff --git a/calliope-web/src/lib/components/studio/StudioGenerate.svelte b/calliope-web/src/lib/components/studio/StudioGenerate.svelte index afb1126c..7d71d5a4 100644 --- a/calliope-web/src/lib/components/studio/StudioGenerate.svelte +++ b/calliope-web/src/lib/components/studio/StudioGenerate.svelte @@ -1012,22 +1012,6 @@ title={kind === 'image' ? t('studio.image.title') : t('studio.video.title')} subtitle={kind === 'image' ? t('studio.image.subtitle') : t('studio.video.subtitle')} > - {#snippet actions()} - {#if endpointId} - - - {queueCount > 0 - ? t('studio.chipBusy', { name: selectedEndpointName, n: queueCount }) - : t('studio.chipIdle', { name: selectedEndpointName })} - - {/if} - {/snippet}
diff --git a/calliope-web/src/lib/i18n/de.ts b/calliope-web/src/lib/i18n/de.ts index cc9d9c86..bee84b35 100644 --- a/calliope-web/src/lib/i18n/de.ts +++ b/calliope-web/src/lib/i18n/de.ts @@ -1260,14 +1260,44 @@ export const de: Dict = { 'shell.navConnections': 'ComfyUI-Verbindungen', 'shell.navModels': 'Modelle', 'shell.navSettings': 'Einstellungen', - 'shell.wip': 'In Entwicklung', - 'shell.wipHint': 'Diese Seite ist noch im Bau und folgt später', 'shell.comfy_ok': '{name} verbunden', 'shell.comfy_fail': '{name} nicht erreichbar', 'shell.comfy_testing': '{name} wird getestet…', 'shell.comfyUnset': 'ComfyUI · nicht konfiguriert', - 'shell.comfyManage': 'ComfyUI-Adresse in den Einstellungen pflegen', - 'shell.mobileNotice': 'Bitte öffne diese Werkbank in einem Desktop-Browser (mindestens 768px breit); Handys werden noch nicht unterstützt.', + 'shell.scopeHint': 'Projekt wechseln', + 'shell.scopeAll': 'Alle Projekte', + 'shell.scopeAllList': 'Liste aller Projekte', + 'shell.scopeRecent': 'Letzte Projekte', + 'shell.scopeLoadFailed': 'Projekte konnten nicht geladen werden', + 'shell.scopeEmpty': 'Noch keine Projekte – jetzt anlegen', + 'shell.scopeStage': '{n}/5 bestätigt', + 'shell.queueRunning': '{n} in Arbeit', + 'shell.queueQueued': '{n} in der Warteschlange', + 'shell.queueIdle': 'Warteschlange leer', + 'shell.queueActive': '{n} aktiv', + 'shell.trayTitle': 'Auftragsablage', + 'shell.trayRecent': 'Letzte Aufträge · klicken für alle Aufträge', + 'shell.trayEmpty': 'Noch keine Generierungsaufträge', + 'shell.trayAll': 'Alle Aufträge anzeigen', + 'shell.searchTitle': 'Seiten und Projekte suchen', + 'shell.searchPlaceholder': 'Seiten, Projekte suchen', + 'shell.searchShortcut': 'Suchen (Strg/⌘ + K)', + 'shell.searchEmpty': 'Keine Seite und kein Projekt passt zu „{q}“', + 'shell.searchGroupPages': 'Seiten', + 'shell.searchGroupProjects': 'Projekte · Werkbank öffnen', + 'shell.searchHintMove': 'auswählen', + 'shell.searchHintOpen': 'öffnen', + 'shell.searchHintClose': 'schließen', + 'shell.reduceMotion': 'Weniger Bewegung', + 'shell.reduceHint': 'Bewegungs-, Zoom- und Glüheffekte aus; nur kurze Überblendungen', + 'shell.reduceSystem': 'Folgt der Systemeinstellung „Bewegung reduzieren“', + 'shell.tabAria': 'Hauptnavigation (schmal)', + 'shell.tabProjects': 'Projekte', + 'shell.tabCreate': 'Erstellen', + 'shell.tabGenerate': 'Generieren', + 'shell.tabMore': 'Mehr', + 'shell.morePages': 'Weitere Seiten', + 'shell.moreTools': 'Werkzeuge', 'home.title': 'Projektübersicht', 'home.subtitle': 'Verwalte deine Projekte — starte mit einer Idee oder einem fertigen Drehbuch.', 'home.projectCount': '{n} Projekte · {m} in Arbeit', @@ -1456,8 +1486,6 @@ export const de: Dict = { 'studio.genParams': 'Parameter', 'studio.modeTextToImage': 'Text zu Bild', 'studio.modeTextToVideo': 'Text zu Video', - 'studio.chipIdle': '{name} · Warteschlange frei', - 'studio.chipBusy': '{name} · {n} in Warteschlange', 'studio.video.resultsTitle': 'Vorschau', 'studio.image.historyTitle': 'Bildverlauf', 'studio.video.historyTitle': 'Videoverlauf', diff --git a/calliope-web/src/lib/i18n/en.ts b/calliope-web/src/lib/i18n/en.ts index 1dea9911..cfe926df 100644 --- a/calliope-web/src/lib/i18n/en.ts +++ b/calliope-web/src/lib/i18n/en.ts @@ -1262,14 +1262,44 @@ export const en = { 'shell.navConnections': 'ComfyUI Connections', 'shell.navModels': 'Models', 'shell.navSettings': 'Settings', - 'shell.wip': 'In development', - 'shell.wipHint': 'This page is under construction and will open later', 'shell.comfy_ok': '{name} connected', 'shell.comfy_fail': '{name} unreachable', 'shell.comfy_testing': 'Testing {name}…', 'shell.comfyUnset': 'ComfyUI · not configured', - 'shell.comfyManage': 'Configure the ComfyUI address in Settings', - 'shell.mobileNotice': 'Please open this workbench in a desktop browser (at least 768px wide). Phones are not supported yet.', + 'shell.scopeHint': 'Switch project', + 'shell.scopeAll': 'All projects', + 'shell.scopeAllList': 'All projects list', + 'shell.scopeRecent': 'Recent projects', + 'shell.scopeLoadFailed': 'Could not load projects', + 'shell.scopeEmpty': 'No projects yet — create one', + 'shell.scopeStage': '{n}/5 confirmed', + 'shell.queueRunning': '{n} generating', + 'shell.queueQueued': '{n} queued', + 'shell.queueIdle': 'Queue idle', + 'shell.queueActive': '{n} active', + 'shell.trayTitle': 'Job tray', + 'shell.trayRecent': 'Recent jobs · click to see all jobs', + 'shell.trayEmpty': 'No generation jobs yet', + 'shell.trayAll': 'View all jobs', + 'shell.searchTitle': 'Search pages and projects', + 'shell.searchPlaceholder': 'Search pages, projects', + 'shell.searchShortcut': 'Search (Ctrl/⌘ + K)', + 'shell.searchEmpty': 'No page or project matches “{q}”', + 'shell.searchGroupPages': 'Pages', + 'shell.searchGroupProjects': 'Projects · open the workbench', + 'shell.searchHintMove': 'select', + 'shell.searchHintOpen': 'open', + 'shell.searchHintClose': 'close', + 'shell.reduceMotion': 'Reduce motion', + 'shell.reduceHint': 'Turn off movement, scaling and glow animations; keep only short fades', + 'shell.reduceSystem': 'Following the system “Reduce motion” setting', + 'shell.tabAria': 'Primary (narrow screens)', + 'shell.tabProjects': 'Projects', + 'shell.tabCreate': 'Create', + 'shell.tabGenerate': 'Generate', + 'shell.tabMore': 'More', + 'shell.morePages': 'More pages', + 'shell.moreTools': 'Tools', 'home.title': 'Projects overview', 'home.subtitle': 'Manage your projects — start from an idea or a ready-made script.', 'home.projectCount': '{n} projects · {m} in progress', @@ -1455,8 +1485,6 @@ export const en = { 'studio.genParams': 'Parameters', 'studio.modeTextToImage': 'Text to image', 'studio.modeTextToVideo': 'Text to video', - 'studio.chipIdle': '{name} · queue idle', - 'studio.chipBusy': '{name} · {n} in queue', 'studio.video.resultsTitle': 'Preview', 'studio.image.historyTitle': 'Image history', 'studio.video.historyTitle': 'Video history', diff --git a/calliope-web/src/lib/i18n/es.ts b/calliope-web/src/lib/i18n/es.ts index c6589f86..75c3aa0e 100644 --- a/calliope-web/src/lib/i18n/es.ts +++ b/calliope-web/src/lib/i18n/es.ts @@ -1260,14 +1260,44 @@ export const es: Dict = { 'shell.navConnections': 'Conexiones ComfyUI', 'shell.navModels': 'Modelos', 'shell.navSettings': 'Ajustes', - 'shell.wip': 'En desarrollo', - 'shell.wipHint': 'Esta página está en construcción y llegará más adelante', 'shell.comfy_ok': '{name} conectado', 'shell.comfy_fail': '{name} sin conexión', 'shell.comfy_testing': 'Probando {name}…', 'shell.comfyUnset': 'ComfyUI · sin configurar', - 'shell.comfyManage': 'Configura la dirección de ComfyUI en Ajustes', - 'shell.mobileNotice': 'Abre este banco de trabajo en un navegador de escritorio (mínimo 768 px); los móviles aún no se admiten.', + 'shell.scopeHint': 'Cambiar de proyecto', + 'shell.scopeAll': 'Todos los proyectos', + 'shell.scopeAllList': 'Lista de proyectos', + 'shell.scopeRecent': 'Proyectos recientes', + 'shell.scopeLoadFailed': 'No se pudieron cargar los proyectos', + 'shell.scopeEmpty': 'Aún no hay proyectos: crea uno', + 'shell.scopeStage': '{n}/5 confirmadas', + 'shell.queueRunning': '{n} generando', + 'shell.queueQueued': '{n} en cola', + 'shell.queueIdle': 'Cola libre', + 'shell.queueActive': '{n} activos', + 'shell.trayTitle': 'Bandeja de tareas', + 'shell.trayRecent': 'Tareas recientes · clic para ver todas', + 'shell.trayEmpty': 'Aún no hay tareas de generación', + 'shell.trayAll': 'Ver todas las tareas', + 'shell.searchTitle': 'Buscar páginas y proyectos', + 'shell.searchPlaceholder': 'Buscar páginas, proyectos', + 'shell.searchShortcut': 'Buscar (Ctrl/⌘ + K)', + 'shell.searchEmpty': 'Ninguna página ni proyecto coincide con «{q}»', + 'shell.searchGroupPages': 'Páginas', + 'shell.searchGroupProjects': 'Proyectos · abrir el banco de trabajo', + 'shell.searchHintMove': 'elegir', + 'shell.searchHintOpen': 'abrir', + 'shell.searchHintClose': 'cerrar', + 'shell.reduceMotion': 'Reducir movimiento', + 'shell.reduceHint': 'Desactiva desplazamientos, escalados y brillos; solo quedan fundidos breves', + 'shell.reduceSystem': 'Se sigue el ajuste del sistema «Reducir movimiento»', + 'shell.tabAria': 'Navegación principal (estrecha)', + 'shell.tabProjects': 'Proyectos', + 'shell.tabCreate': 'Crear', + 'shell.tabGenerate': 'Generar', + 'shell.tabMore': 'Más', + 'shell.morePages': 'Más páginas', + 'shell.moreTools': 'Herramientas', 'home.title': 'Resumen de proyectos', 'home.subtitle': 'Gestiona tus proyectos: empieza con una idea o un guion terminado.', 'home.projectCount': '{n} proyectos · {m} en curso', @@ -1456,8 +1486,6 @@ export const es: Dict = { 'studio.genParams': 'Parámetros', 'studio.modeTextToImage': 'Texto a imagen', 'studio.modeTextToVideo': 'Texto a vídeo', - 'studio.chipIdle': '{name} · cola libre', - 'studio.chipBusy': '{name} · {n} en cola', 'studio.video.resultsTitle': 'Vista previa', 'studio.image.historyTitle': 'Historial de imágenes', 'studio.video.historyTitle': 'Historial de vídeos', diff --git a/calliope-web/src/lib/i18n/fr.ts b/calliope-web/src/lib/i18n/fr.ts index 6d804fcc..f76a6f8b 100644 --- a/calliope-web/src/lib/i18n/fr.ts +++ b/calliope-web/src/lib/i18n/fr.ts @@ -1260,14 +1260,44 @@ export const fr: Dict = { 'shell.navConnections': 'Connexions ComfyUI', 'shell.navModels': 'Modèles', 'shell.navSettings': 'Réglages', - 'shell.wip': 'En développement', - 'shell.wipHint': 'Cette page est en construction et arrivera plus tard', 'shell.comfy_ok': '{name} connecté', 'shell.comfy_fail': '{name} injoignable', 'shell.comfy_testing': 'Test de {name}…', 'shell.comfyUnset': 'ComfyUI · non configuré', - 'shell.comfyManage': 'Configurez l\'adresse ComfyUI dans les Réglages', - 'shell.mobileNotice': 'Ouvrez cet atelier dans un navigateur de bureau (largeur minimum 768 px) ; les téléphones ne sont pas encore pris en charge.', + 'shell.scopeHint': 'Changer de projet', + 'shell.scopeAll': 'Tous les projets', + 'shell.scopeAllList': 'Liste des projets', + 'shell.scopeRecent': 'Projets récents', + 'shell.scopeLoadFailed': 'Impossible de charger les projets', + 'shell.scopeEmpty': 'Aucun projet — en créer un', + 'shell.scopeStage': '{n}/5 validées', + 'shell.queueRunning': '{n} en cours', + 'shell.queueQueued': '{n} en file', + 'shell.queueIdle': 'File libre', + 'shell.queueActive': '{n} actifs', + 'shell.trayTitle': 'Plateau des tâches', + 'shell.trayRecent': 'Tâches récentes · cliquer pour tout voir', + 'shell.trayEmpty': 'Aucune tâche de génération', + 'shell.trayAll': 'Voir toutes les tâches', + 'shell.searchTitle': 'Rechercher pages et projets', + 'shell.searchPlaceholder': 'Rechercher pages, projets', + 'shell.searchShortcut': 'Rechercher (Ctrl/⌘ + K)', + 'shell.searchEmpty': 'Aucune page ni projet ne correspond à « {q} »', + 'shell.searchGroupPages': 'Pages', + 'shell.searchGroupProjects': 'Projets · ouvrir l’atelier', + 'shell.searchHintMove': 'choisir', + 'shell.searchHintOpen': 'ouvrir', + 'shell.searchHintClose': 'fermer', + 'shell.reduceMotion': 'Réduire les animations', + 'shell.reduceHint': 'Coupe déplacements, zooms et halos ; garde seulement de courts fondus', + 'shell.reduceSystem': 'Réglage système « Réduire les animations » appliqué', + 'shell.tabAria': 'Navigation principale (étroite)', + 'shell.tabProjects': 'Projets', + 'shell.tabCreate': 'Créer', + 'shell.tabGenerate': 'Générer', + 'shell.tabMore': 'Plus', + 'shell.morePages': 'Autres pages', + 'shell.moreTools': 'Outils', 'home.title': 'Aperçu des projets', 'home.subtitle': 'Gérez vos projets — commencez avec une idée ou un scénario prêt.', 'home.projectCount': '{n} projets · {m} en cours', @@ -1456,8 +1486,6 @@ export const fr: Dict = { 'studio.genParams': 'Paramètres', 'studio.modeTextToImage': 'Texte vers image', 'studio.modeTextToVideo': 'Texte vers vidéo', - 'studio.chipIdle': '{name} · file libre', - 'studio.chipBusy': '{name} · {n} en file', 'studio.video.resultsTitle': 'Aperçu', 'studio.image.historyTitle': 'Historique images', 'studio.video.historyTitle': 'Historique vidéos', diff --git a/calliope-web/src/lib/i18n/ja.ts b/calliope-web/src/lib/i18n/ja.ts index 6e9a32fe..85751047 100644 --- a/calliope-web/src/lib/i18n/ja.ts +++ b/calliope-web/src/lib/i18n/ja.ts @@ -1260,14 +1260,44 @@ export const ja: Dict = { 'shell.navConnections': 'ComfyUI 接続', 'shell.navModels': 'モデル設定', 'shell.navSettings': '設定', - 'shell.wip': '開発中', - 'shell.wipHint': 'このページは準備中です。後ほど公開されます', 'shell.comfy_ok': '{name} 接続済み', 'shell.comfy_fail': '{name} 接続失敗', 'shell.comfy_testing': '{name} テスト中…', 'shell.comfyUnset': 'ComfyUI · 未設定', - 'shell.comfyManage': '「設定」で ComfyUI のアドレスを設定できます', - 'shell.mobileNotice': 'このワークベンチはデスクトップブラウザ(幅 768px 以上)で開いてください。スマートフォンには未対応です。', + 'shell.scopeHint': 'プロジェクト切替', + 'shell.scopeAll': 'すべてのプロジェクト', + 'shell.scopeAllList': 'プロジェクト一覧', + 'shell.scopeRecent': '最近のプロジェクト', + 'shell.scopeLoadFailed': 'プロジェクトを読み込めませんでした', + 'shell.scopeEmpty': 'プロジェクトはまだありません — 作成する', + 'shell.scopeStage': '{n}/5 確定', + 'shell.queueRunning': '{n} 件生成中', + 'shell.queueQueued': '{n} 件待機', + 'shell.queueIdle': 'キューは空です', + 'shell.queueActive': '{n} 件進行中', + 'shell.trayTitle': 'タスクトレイ', + 'shell.trayRecent': '最近のタスク · クリックで全タスク', + 'shell.trayEmpty': '生成タスクはまだありません', + 'shell.trayAll': 'すべてのタスクを見る', + 'shell.searchTitle': 'ページとプロジェクトを検索', + 'shell.searchPlaceholder': 'ページ・プロジェクトを検索', + 'shell.searchShortcut': '検索(Ctrl/⌘ + K)', + 'shell.searchEmpty': '「{q}」に一致するページやプロジェクトはありません', + 'shell.searchGroupPages': 'ページ', + 'shell.searchGroupProjects': 'プロジェクト · ワークベンチを開く', + 'shell.searchHintMove': '選択', + 'shell.searchHintOpen': '開く', + 'shell.searchHintClose': '閉じる', + 'shell.reduceMotion': '動きを減らす', + 'shell.reduceHint': '移動・拡大・発光アニメーションを止め、短いフェードのみ残します', + 'shell.reduceSystem': 'システムの「視差効果を減らす」設定に従っています', + 'shell.tabAria': 'メインナビ(狭い画面)', + 'shell.tabProjects': 'プロジェクト', + 'shell.tabCreate': '創作', + 'shell.tabGenerate': '生成', + 'shell.tabMore': 'その他', + 'shell.morePages': 'その他のページ', + 'shell.moreTools': 'ツール', 'home.title': 'プロジェクト概要', 'home.subtitle': '創作プロジェクトを管理 — アイデアでも完成台本でも始められます。', 'home.projectCount': 'プロジェクト {n} 件 · 進行中 {m} 件', @@ -1456,8 +1486,6 @@ export const ja: Dict = { 'studio.genParams': '生成パラメータ', 'studio.modeTextToImage': 'テキストから画像', 'studio.modeTextToVideo': 'テキストから動画', - 'studio.chipIdle': '{name} · キュー空き', - 'studio.chipBusy': '{name} · キュー {n} 件', 'studio.video.resultsTitle': 'プレビュー', 'studio.image.historyTitle': '画像生成履歴', 'studio.video.historyTitle': '動画生成履歴', diff --git a/calliope-web/src/lib/i18n/ko.ts b/calliope-web/src/lib/i18n/ko.ts index a9f2c146..026c8016 100644 --- a/calliope-web/src/lib/i18n/ko.ts +++ b/calliope-web/src/lib/i18n/ko.ts @@ -1260,14 +1260,44 @@ export const ko: Dict = { 'shell.navConnections': 'ComfyUI 연결', 'shell.navModels': '모델 설정', 'shell.navSettings': '설정', - 'shell.wip': '개발 중', - 'shell.wipHint': '이 페이지는 준비 중이며 곧 열립니다', 'shell.comfy_ok': '{name} 연결됨', 'shell.comfy_fail': '{name} 연결 실패', 'shell.comfy_testing': '{name} 테스트 중…', 'shell.comfyUnset': 'ComfyUI · 미설정', - 'shell.comfyManage': '「설정」에서 ComfyUI 주소를 설정하세요', - 'shell.mobileNotice': '이 워크벤치는 데스크톱 브라우저(폭 768px 이상)에서 열어 주세요. 휴대폰은 아직 지원되지 않습니다.', + 'shell.scopeHint': '프로젝트 전환', + 'shell.scopeAll': '전체 프로젝트', + 'shell.scopeAllList': '프로젝트 목록', + 'shell.scopeRecent': '최근 프로젝트', + 'shell.scopeLoadFailed': '프로젝트를 불러오지 못했습니다', + 'shell.scopeEmpty': '아직 프로젝트가 없습니다 — 만들기', + 'shell.scopeStage': '{n}/5 확정', + 'shell.queueRunning': '{n}개 생성 중', + 'shell.queueQueued': '{n}개 대기', + 'shell.queueIdle': '대기열 비어 있음', + 'shell.queueActive': '{n}개 진행 중', + 'shell.trayTitle': '작업 트레이', + 'shell.trayRecent': '최근 작업 · 클릭하면 전체 작업', + 'shell.trayEmpty': '아직 생성 작업이 없습니다', + 'shell.trayAll': '전체 작업 보기', + 'shell.searchTitle': '페이지와 프로젝트 검색', + 'shell.searchPlaceholder': '페이지, 프로젝트 검색', + 'shell.searchShortcut': '검색 (Ctrl/⌘ + K)', + 'shell.searchEmpty': '‘{q}’와 일치하는 페이지나 프로젝트가 없습니다', + 'shell.searchGroupPages': '페이지', + 'shell.searchGroupProjects': '프로젝트 · 워크벤치 열기', + 'shell.searchHintMove': '선택', + 'shell.searchHintOpen': '열기', + 'shell.searchHintClose': '닫기', + 'shell.reduceMotion': '동작 줄이기', + 'shell.reduceHint': '이동·확대·발광 애니메이션을 끄고 짧은 페이드만 남깁니다', + 'shell.reduceSystem': '시스템의 ‘동작 줄이기’ 설정을 따르는 중', + 'shell.tabAria': '주 탐색 (좁은 화면)', + 'shell.tabProjects': '프로젝트', + 'shell.tabCreate': '창작', + 'shell.tabGenerate': '생성', + 'shell.tabMore': '더보기', + 'shell.morePages': '더 많은 페이지', + 'shell.moreTools': '도구', 'home.title': '프로젝트 개요', 'home.subtitle': '창작 프로젝트를 관리하세요 — 아이디어나 완성된 대본으로 시작할 수 있습니다.', 'home.projectCount': '프로젝트 {n}개 · 진행 중 {m}개', @@ -1456,8 +1486,6 @@ export const ko: Dict = { 'studio.genParams': '생성 매개변수', 'studio.modeTextToImage': '텍스트→이미지', 'studio.modeTextToVideo': '텍스트→영상', - 'studio.chipIdle': '{name} · 대기열 비어 있음', - 'studio.chipBusy': '{name} · 대기열 {n}건', 'studio.video.resultsTitle': '미리보기', 'studio.image.historyTitle': '이미지 생성 기록', 'studio.video.historyTitle': '영상 생성 기록', diff --git a/calliope-web/src/lib/i18n/zh.ts b/calliope-web/src/lib/i18n/zh.ts index 5c59a216..24896e7b 100644 --- a/calliope-web/src/lib/i18n/zh.ts +++ b/calliope-web/src/lib/i18n/zh.ts @@ -1262,14 +1262,44 @@ export const zh: Dict = { 'shell.navConnections': 'ComfyUI 连接', 'shell.navModels': '模型设置', 'shell.navSettings': '设置', - 'shell.wip': '开发中', - 'shell.wipHint': '该页面正在开发中,稍后开放', 'shell.comfy_ok': '{name} 已连接', 'shell.comfy_fail': '{name} 连接失败', 'shell.comfy_testing': '{name} 测试中…', 'shell.comfyUnset': 'ComfyUI · 未配置', - 'shell.comfyManage': '管理 ComfyUI 连接', - 'shell.mobileNotice': '请用桌面浏览器(宽 768px 以上)打开影工坊,手机端暂不适配。', + 'shell.scopeHint': '切换项目', + 'shell.scopeAll': '全部项目', + 'shell.scopeAllList': '全部项目列表', + 'shell.scopeRecent': '最近项目', + 'shell.scopeLoadFailed': '项目列表加载失败', + 'shell.scopeEmpty': '还没有项目,去创建', + 'shell.scopeStage': '已确认 {n}/5', + 'shell.queueRunning': '{n} 个生成中', + 'shell.queueQueued': '{n} 个排队', + 'shell.queueIdle': '队列空闲', + 'shell.queueActive': '{n} 个进行中', + 'shell.trayTitle': '任务托盘', + 'shell.trayRecent': '最近任务 · 点击查看全部任务', + 'shell.trayEmpty': '还没有生成任务', + 'shell.trayAll': '查看全部任务', + 'shell.searchTitle': '搜索页面和项目', + 'shell.searchPlaceholder': '搜索页面、项目', + 'shell.searchShortcut': '搜索(Ctrl/⌘ + K)', + 'shell.searchEmpty': '没有找到与「{q}」相关的页面或项目', + 'shell.searchGroupPages': '页面', + 'shell.searchGroupProjects': '项目 · 打开创作工作台', + 'shell.searchHintMove': '选择', + 'shell.searchHintOpen': '打开', + 'shell.searchHintClose': '关闭', + 'shell.reduceMotion': '减少动态', + 'shell.reduceHint': '关闭位移、缩放和光晕动画,只保留短暂淡入淡出', + 'shell.reduceSystem': '已跟随系统的「减少动态效果」设置', + 'shell.tabAria': '主导航(窄屏)', + 'shell.tabProjects': '项目', + 'shell.tabCreate': '创作', + 'shell.tabGenerate': '生成', + 'shell.tabMore': '更多', + 'shell.morePages': '更多页面', + 'shell.moreTools': '工具', 'home.title': '项目总览', 'home.subtitle': '管理创作项目,从一个创意或一份现成剧本开始。', 'home.projectCount': '{n} 个项目 · {m} 个进行中', @@ -1455,8 +1485,6 @@ export const zh: Dict = { 'studio.genParams': '生成参数', 'studio.modeTextToImage': '文生图', 'studio.modeTextToVideo': '文生视频', - 'studio.chipIdle': '{name} · 队列空闲', - 'studio.chipBusy': '{name} · 队列 {n} 个任务', 'studio.video.resultsTitle': '成片预览', 'studio.image.historyTitle': '生图历史', 'studio.video.historyTitle': '生视频历史', diff --git a/calliope-web/src/lib/reduceMotion.svelte.ts b/calliope-web/src/lib/reduceMotion.svelte.ts new file mode 100644 index 00000000..70f0ee6f --- /dev/null +++ b/calliope-web/src/lib/reduceMotion.svelte.ts @@ -0,0 +1,45 @@ +import { storageGet, storageSet } from './storage'; + +/** + * 减少动态效果 (HEL-649 §五). The OS setting always wins (app.css also reacts + * to `prefers-reduced-motion` directly, so it cannot be switched off here); + * otherwise the top-bar switch decides. The effective value is mirrored to + * ``, which is what every reduced-motion rule keys on. + */ +const STORAGE_KEY = 'aigc-reduce-motion'; +const QUERY = '(prefers-reduced-motion: reduce)'; + +export const reduceMotion = $state({ system: false, manual: false }); + +let stop: (() => void) | null = null; + +function apply() { + document.documentElement.dataset.reduce = + reduceMotion.system || reduceMotion.manual ? '1' : '0'; +} + +/** Call once on the client (root layout). Returns the teardown. */ +export function initReduceMotion(): () => void { + if (typeof window === 'undefined') return () => {}; + stop?.(); + const mq = window.matchMedia(QUERY); + reduceMotion.system = mq.matches; + reduceMotion.manual = storageGet(STORAGE_KEY) === '1'; + apply(); + const onChange = (e: MediaQueryListEvent) => { + reduceMotion.system = e.matches; + apply(); + }; + mq.addEventListener('change', onChange); + stop = () => mq.removeEventListener('change', onChange); + return () => { + stop?.(); + stop = null; + }; +} + +export function setReduceMotion(on: boolean) { + reduceMotion.manual = on; + storageSet(STORAGE_KEY, on ? '1' : '0'); + apply(); +} diff --git a/calliope-web/src/routes/+layout.svelte b/calliope-web/src/routes/+layout.svelte index 71608bd4..0a378bc7 100644 --- a/calliope-web/src/routes/+layout.svelte +++ b/calliope-web/src/routes/+layout.svelte @@ -1,13 +1,17 @@ diff --git a/calliope-web/src/routes/app.css b/calliope-web/src/routes/app.css index dd7382db..ac31501a 100644 --- a/calliope-web/src/routes/app.css +++ b/calliope-web/src/routes/app.css @@ -83,6 +83,11 @@ --r-pill: 999px; --shadow-float: 0 14px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-2); + /* 壳层尺寸 (§二):60px 图标轨、顶栏、≤760px 底部标签栏 */ + --rail-w: 60px; + --topbar-h: 52px; + --tabbar-h: 56px; + /* 专属符号 (§1.7):齿孔只在记录流/输入台分隔带,光晕只在播放舞台 */ --sprocket: radial-gradient(circle 2px, var(--line-2) 98%, transparent); --stage-bg: @@ -204,7 +209,7 @@ body { } .a-darkroom { - background: var(--bg); + background: var(--page-glow), var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body); @@ -344,6 +349,38 @@ code, border-color: var(--accent-line); color: var(--accent); } +a.status-chip, +button.status-chip { + font-family: inherit; + text-decoration: none; + cursor: pointer; + transition: + border-color var(--d-state) ease, + color var(--d-state) ease, + transform var(--d-press) var(--ease-out); +} +a.status-chip:active, +button.status-chip:active { + transform: scale(var(--press-scale)); +} +@media (hover: hover) and (pointer: fine) { + a.status-chip:hover, + button.status-chip:hover { + border-color: var(--text-3); + color: var(--text); + } +} +/* Keyboard shortcut hint, e.g. the Ctrl K badge on the search capsule. */ +.a-kbd { + font: var(--fs-mini) var(--mono); + color: var(--text-3); + border: 1px solid var(--line-2); + border-bottom-width: 2px; + border-radius: var(--r-sm); + padding: 0 var(--sp-2); + line-height: 16px; + white-space: nowrap; +} .status-chip-dot { width: 6px; height: 6px; @@ -450,6 +487,63 @@ code, box-shadow: var(--shadow-float); } +/* Rows inside pops, sheets and the Ctrl+K palette (§四.3 pop). Gold marks + only the current page / project; keyboard and hover highlight is neutral. */ +.a-menu-group { + padding: var(--sp-4) var(--sp-4) var(--sp-1); + font-size: var(--fs-mini); + color: var(--text-3); +} +.a-menu-item { + display: flex; + align-items: center; + gap: var(--sp-3); + width: 100%; + min-height: 40px; + padding: var(--sp-3) var(--sp-4); + border: 0; + border-radius: var(--r-md); + background: transparent; + color: var(--text-2); + font-family: inherit; + font-size: var(--fs-body); + text-align: left; + text-decoration: none; + cursor: pointer; + box-sizing: border-box; + transition: + background-color var(--d-state) ease, + color var(--d-state) ease; +} +.a-menu-item.active, +.a-menu-item:focus-visible { + background: var(--bg-4); + color: var(--text); +} +@media (hover: hover) and (pointer: fine) { + .a-menu-item:hover { + background: var(--bg-4); + color: var(--text); + } +} +.a-menu-item[aria-current='page'], +.a-menu-item[aria-current='true'] { + color: var(--accent); +} +.a-menu-label { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.a-menu-meta { + flex-shrink: 0; + font-size: var(--fs-mini); + color: var(--text-3); + white-space: nowrap; +} + /* Card / panel surface (§1.5:卡片不投影,用底色差分层). */ .a-panel { background: var(--bg-2);