From 1a7a682cd0e2864b89892a7d7e57917145c802b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=BD=E5=B7=A5=E5=91=98?= Date: Mon, 28 Sep 2026 16:25:55 +0800 Subject: [PATCH] =?UTF-8?q?HEL-615:=20=E5=85=A8=E9=83=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=B8=BA=20A=E3=80=8C=E7=89=87=E5=9C=BA?= =?UTF-8?q?=E6=9A=97=E6=88=BF=E3=80=8D=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 设置页重写进 AppShell:生成与队列 / 智能体运行 / 存储路径三段,其余设置入口链到模型设置、ComfyUI 连接、智能体;旧 ?tab= 链接跳转到对应新页 - 项目卡状态标签改为按五段真实进度显示(已完成 / 某阶段生成中·待确认 / 进行中 / 待开始) - 首页生成任务行对齐 a1(来源标签、项目名、进度条、本地时间) - 连接页:右栏默认新增表单 + 任务使用目标面板,进入页面自动实测各连接;模型页默认新增表单、自动 1-token 实测,去掉双加号 - 生图/生视频:生成参数面板标题、通栏生成按钮、成片预览、按类型的历史标题与 16:9 视频历史、顶栏连接状态胶囊,连接状态改用服务器实测 - 智能体页:五个 Agent / Skill 库 / 已装 Skill 面板标题,内置 Skill 中文名,去掉对话空态 Calliope 字样 - 侧栏底部 ComfyUI 状态修正为真实实测(原查询不响应导致一直测试中) - 统一样式来源:.a-btn/.a-panel/.a-select/.status-chip 等只在 app.css 定义一次,删除各页重复定义;新增 Switch、Button block、ProgressBar tone - 旧 Calliope 路由(/projects、/project/:id、/canvas、/library、/build-scene、/playground)重定向到 A 页面;页面标题改为影工坊 - 轮询间隔单位改为秒(7 种语言) Co-authored-by: multica-agent --- calliope-web/src/app.html | 2 +- .../src/lib/components/agent/AgentChat.svelte | 10 - .../lib/components/home/AProjectCard.svelte | 63 +- .../components/settings/MemoryPanel.svelte | 81 +- .../components/settings/SettingsNav.svelte | 111 -- .../components/settings/SkillsLibrary.svelte | 485 ------- .../settings/WorkflowsLibrary.svelte | 700 --------- .../src/lib/components/shell/AppShell.svelte | 114 +- .../components/studio/StudioGenerate.svelte | 1244 ++++++++-------- .../src/lib/components/ui/Button.svelte | 92 +- .../src/lib/components/ui/ProgressBar.svelte | 20 +- calliope-web/src/lib/components/ui/README.md | 7 +- .../src/lib/components/ui/Switch.svelte | 65 + calliope-web/src/lib/endpointKind.ts | 33 + calliope-web/src/lib/i18n/de.ts | 59 +- calliope-web/src/lib/i18n/en.ts | 59 +- calliope-web/src/lib/i18n/es.ts | 59 +- calliope-web/src/lib/i18n/fr.ts | 59 +- calliope-web/src/lib/i18n/ja.ts | 59 +- calliope-web/src/lib/i18n/ko.ts | 59 +- calliope-web/src/lib/i18n/zh.ts | 59 +- calliope-web/src/lib/jobLabels.ts | 20 + calliope-web/src/lib/wideLayout.ts | 8 + calliope-web/src/routes/+page.svelte | 200 +-- calliope-web/src/routes/agents/+page.svelte | 248 ++-- calliope-web/src/routes/app.css | 363 +++-- calliope-web/src/routes/build-scene/+page.ts | 8 + calliope-web/src/routes/canvas/+page.ts | 6 + calliope-web/src/routes/canvas/[id]/+page.ts | 6 + .../src/routes/connections/+page.svelte | 276 ++-- calliope-web/src/routes/image/+page.svelte | 6 +- calliope-web/src/routes/library/+page.ts | 8 + calliope-web/src/routes/models/+page.svelte | 169 +-- calliope-web/src/routes/playground/+page.ts | 6 + calliope-web/src/routes/project/[id]/+page.ts | 3 +- calliope-web/src/routes/projects/+page.ts | 6 +- calliope-web/src/routes/settings/+page.svelte | 1252 ++++++----------- calliope-web/src/routes/tasks/+page.svelte | 55 +- calliope-web/src/routes/video/+page.svelte | 6 +- 39 files changed, 2444 insertions(+), 3642 deletions(-) delete mode 100644 calliope-web/src/lib/components/settings/SettingsNav.svelte delete mode 100644 calliope-web/src/lib/components/settings/SkillsLibrary.svelte delete mode 100644 calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte create mode 100644 calliope-web/src/lib/components/ui/Switch.svelte create mode 100644 calliope-web/src/lib/endpointKind.ts create mode 100644 calliope-web/src/lib/jobLabels.ts create mode 100644 calliope-web/src/lib/wideLayout.ts create mode 100644 calliope-web/src/routes/build-scene/+page.ts create mode 100644 calliope-web/src/routes/library/+page.ts diff --git a/calliope-web/src/app.html b/calliope-web/src/app.html index bc3f64ba..124c4539 100644 --- a/calliope-web/src/app.html +++ b/calliope-web/src/app.html @@ -4,7 +4,7 @@ - Calliope Lab + 影工坊
-

Calliope

{t('agentChat.emptyTitle')}

{t('agentChat.emptyHint')}

{#if suggestions.length > 0} @@ -370,15 +369,6 @@ box-shadow: 0 0 32px var(--accent-glow); margin-bottom: 6px; } - .empty-eyebrow { - margin: 0; - font-family: var(--font-display); - font-size: 12px; - font-weight: 600; - letter-spacing: 0.28em; - text-transform: uppercase; - color: var(--accent); - } .empty-title { margin: 0; font-family: var(--font-display); diff --git a/calliope-web/src/lib/components/home/AProjectCard.svelte b/calliope-web/src/lib/components/home/AProjectCard.svelte index be1456c0..560bc5b6 100644 --- a/calliope-web/src/lib/components/home/AProjectCard.svelte +++ b/calliope-web/src/lib/components/home/AProjectCard.svelte @@ -45,11 +45,11 @@ // Spec §2.1 allows the five avatar gradients as cover placeholders. const PLACEHOLDER_GRADIENTS = [ - 'linear-gradient(135deg, #e8a33d, #b96a1b)', - 'linear-gradient(135deg, #5b8def, #3a5fa9)', - 'linear-gradient(135deg, #3fb97f, #2a7a54)', - 'linear-gradient(135deg, #b98be0, #7a4fa9)', - 'linear-gradient(135deg, #d98e6a, #a95535)', + 'var(--avatar-1)', + 'var(--avatar-2)', + 'var(--avatar-3)', + 'var(--avatar-4)', + 'var(--avatar-5)', ]; const placeholder = $derived(PLACEHOLDER_GRADIENTS[project.id % PLACEHOLDER_GRADIENTS.length]); @@ -57,20 +57,26 @@ let coverFailed = $state(false); - const STATUS_CLASS: Record = { - draft: 'st-draft', - in_progress: 'st-progress', - completed: 'st-done', - }; - const STATUS_KEY: Record = { - draft: 'home.statusDraft', - in_progress: 'home.statusProgress', - completed: 'home.statusDone', - }; - const statusClass = $derived(STATUS_CLASS[project.status] ?? 'st-draft'); - const statusLabel = $derived( - project.status in STATUS_KEY ? t(STATUS_KEY[project.status]) : project.status, - ); + // Cover tag reflects the real five-stage state (a1: 「分镜设计 · 进行中」): + // all confirmed → 已完成; otherwise the first unconfirmed stage + its state. + const cover = $derived.by(() => { + if (stats.stage_confirmed >= STAGE_SEGMENTS.length) { + return { cls: 'st-done', label: t('home.statusDone') }; + } + const current = STAGE_SEGMENTS.find((k) => stats.stage_status?.[k] !== 'confirmed'); + const state = current ? stats.stage_status?.[current] : undefined; + const stageName = current ? t(`workbench.stage.${current}`) : ''; + if (state === 'running') { + return { cls: 'st-progress', label: `${stageName} · ${t('workbench.state.running')}` }; + } + if (state === 'awaiting_confirm') { + return { cls: 'st-progress', label: `${stageName} · ${t('workbench.state.draft')}` }; + } + if (stats.stage_confirmed > 0) { + return { cls: 'st-progress', label: `${stageName} · ${t('home.statusProgress')}` }; + } + return { cls: 'st-draft', label: t('home.statusDraft') }; + }); function relativeTime(iso: string): string { const then = new Date(iso).getTime(); @@ -171,7 +177,7 @@ {/if} - {statusLabel} + {cover.label} @@ -334,20 +340,20 @@ border-radius: 999px; font-size: 10.5px; font-weight: 600; + background: rgba(13, 14, 17, 0.78); + border: 1px solid var(--border-strong); backdrop-filter: blur(4px); } + /* a1: dark capsule over the cover so it stays legible on any image; + the text carries the semantic color (§2.1). */ .st-draft { color: var(--text-2); - background: rgba(27, 30, 37, 0.85); - border: 1px solid var(--border-strong); } .st-progress { color: var(--accent); - background: var(--accent-dim); } .st-done { color: var(--success); - background: var(--success-dim); } .body { @@ -511,14 +517,7 @@ } .menu-item.danger:hover { background: var(--error-dim); - } - - /* restyle reused ui/Button + form primitives inside the darkroom scope */ - .a-card :global(.btn-primary) { - background: var(--accent); - color: var(--accent-contrast); - } - .a-card :global(.field-input) { + } .a-card :global(.field-input) { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); diff --git a/calliope-web/src/lib/components/settings/MemoryPanel.svelte b/calliope-web/src/lib/components/settings/MemoryPanel.svelte index e011d6e6..be843661 100644 --- a/calliope-web/src/lib/components/settings/MemoryPanel.svelte +++ b/calliope-web/src/lib/components/settings/MemoryPanel.svelte @@ -53,15 +53,24 @@ const projectMemories = $derived( ($memoriesQuery.data ?? []).filter((m) => m.scope === 'project'), ); + + const KIND_KEYS: Record = { + preference: 'memory.kindPreference', + convention: 'memory.kindConvention', + correction: 'memory.kindCorrection', + }; + function kindLabel(kind: string): string { + return KIND_KEYS[kind] ? t(KIND_KEYS[kind]) : kind; + } -
-

{t('memory.title')}

-

{t('memory.lead')}

+
+

{t('memory.title')}

+

{t('memory.lead')}

- {#if newScope === 'project'} - {#each ($projectsQuery.data ?? []) as p (p.id)} {/each} {/if} -
diff --git a/calliope-web/src/lib/components/settings/SkillsLibrary.svelte b/calliope-web/src/lib/components/settings/SkillsLibrary.svelte deleted file mode 100644 index 397c872b..00000000 --- a/calliope-web/src/lib/components/settings/SkillsLibrary.svelte +++ /dev/null @@ -1,485 +0,0 @@ - - -
-
-
-

{t('skills.title')}

-

{t('skills.lead')}

-
- -
- - {#if $pathQuery.data?.path} -
- - {$pathQuery.data.path} - -
- {/if} - -
- -
-

{t('skills.howtoTitle')}

-
    -
  1. {@html t('skills.howto1')}
  2. -
  3. {@html t('skills.howto2')}
  4. -
  5. {@html t('skills.howto3')}
  6. -
  7. {@html t('skills.howto4')}
  8. -
-

{@html t('skills.note')}

-
-
- - {#if $skillsQuery.isLoading} -
- - -
- {:else if ($skillsQuery.data ?? []).length === 0} -

{t('skills.noSkills')}

- {:else} -
- {#each $skillsQuery.data ?? [] as skill (skill.dir)} -
-
- -
-
- /{skill.name} - {#if skill.version} - v{skill.version} - {/if} -
- {#if skill.description} -

{skill.description}

- {/if} - {#if Array.isArray(skill.tags) && skill.tags.length > 0} -
- {#each skill.tags as tag (tag)} - {tag} - {/each} -
- {/if} -
-
- {#if expanded === skill.dir} -
-

{t('skills.filesIn')} {skill.dir}/

- {#each filesBySkill[skill.dir] ?? [] as file (file)} - - {:else} - {t('skills.noFiles')} - {/each} -
- {/if} -
- {/each} -
- {/if} - - {#if previewLoading} -

{t('skills.loadingFile')}

- {:else if preview} -
-
- {preview.skill}/{preview.path} - {#if preview.truncated} - {t('skills.truncated')} - {/if} - - -
-
{preview.content}
-
- {/if} -
- - diff --git a/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte b/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte deleted file mode 100644 index 340c14d1..00000000 --- a/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte +++ /dev/null @@ -1,700 +0,0 @@ - - -
-
-
-

{t('wf.title')}

-

{@html t('wf.lead')}

-
-
- {t('wf.countSaved', { count: list.length })} - {t('wf.countImage', { count: imageCount })} - {t('wf.countVideo', { count: videoCount })} -
-
- -
-

{t('wf.analyzeRegister')}

-
{ - e.preventDefault(); - dragging = true; - }} - ondragleave={() => (dragging = false)} - ondrop={onDrop} - onclick={() => document.getElementById('wf-file')?.click()} - onkeydown={(e) => e.key === 'Enter' && document.getElementById('wf-file')?.click()} - > - { - const f = (e.currentTarget as HTMLInputElement).files?.[0]; - if (f) void onFile(f); - }} - /> -
JSON
-
- {t('wf.dropHint')} -

{t('wf.dropSub')}

-
-
- - {#if uploadedFileName} -

{uploadedFileName}

- {/if} - - {#if jsonText} - - - {/if} - - {#if parseError} -
{parseError}
- {/if} - - {#if analyzed} -
-
-

{t('wf.detectedInputs', { count: analyzedInputs.length })}

- {#if analyzedInputs.length === 0} -

{@html t('wf.noInputs')}

- {:else} - {#each analyzedInputs as inp} -
- {inp.kind} - {#if inp.role}{inp.role}{/if} - {inp.label} - #{inp.nodeId} -
- {/each} - {/if} -
-
-

{t('wf.detectedOutputs', { count: analyzedOutputs.length })}

- {#if analyzedOutputs.length === 0} -

{@html t('wf.noOutputs')}

- {:else} - {#each analyzedOutputs as out} -
- {out.kind} - {#if out.role}{out.role}{/if} - {out.label} - #{out.nodeId} -
- {/each} - {/if} -
-
- -
- - -
- - - - {/if} -
- -
-
-

{t('wf.savedWorkflows', { count: list.length })}

-
- - {#if $workflowsQuery.isLoading} -
- {#each [1, 2, 3] as n (n)} -
- -
- - -
-
- {/each} -
- {:else if list.length === 0} -
- {t('wf.noWorkflows')} -

{t('wf.noWorkflowsHint')}

-
- {:else} -
- {#each list as wf (wf.id)} -
- {#if editingId === wf.id} - - - -

{t('wf.jsonLocked')}

-
- - -
- {:else} -
-
- {wf.kind === 'video' ? 'VID' : 'IMG'} -
-
- {wf.name} -
- {wf.kind} - {#if wf.prompt_profile === 'minimax_h3_ref'} - H3-ref - {/if} - {t('wf.inputsCount', { count: wf.input_schema?.length ?? 0 })} - {t('wf.outputsCount', { count: wf.output_schema?.length ?? 0 })} - {#if !wf.is_enabled}{/if} -
- {#if wf.description} -

{wf.description}

- {/if} -
-
-
- - - - -
- {#if detailsId === wf.id} -
-
-

{t('wf.inputs')}

- {#each wf.input_schema ?? [] as inp} -
- {inp.kind} - {#if inp.role}{inp.role}{/if} - {inp.label} -
- {:else} -

{t('wf.noInputsCached')}

- {/each} -
-
-

{t('wf.outputs')}

- {#each wf.output_schema ?? [] as out} -
- {out.kind} - {out.label} -
- {:else} -

{t('wf.noOutputsCached')}

- {/each} -
-
- {/if} - {/if} -
- {/each} -
- {/if} -
-
- - (deleteTarget = null)} -/> - - diff --git a/calliope-web/src/lib/components/shell/AppShell.svelte b/calliope-web/src/lib/components/shell/AppShell.svelte index 3f6df87e..91ef3e30 100644 --- a/calliope-web/src/lib/components/shell/AppShell.svelte +++ b/calliope-web/src/lib/components/shell/AppShell.svelte @@ -1,9 +1,10 @@ @@ -116,8 +136,11 @@
@@ -801,7 +810,15 @@ {/if}
{/if} + {#if installedSkills.length} +
+ {#each installedSkills as skill (skill.dir)} + {@render skillRow( + skill, + [`v${skill.version}`, formatUpdatedAt(skill.updated_at)].filter(Boolean).join(' · '), + )} + {/each} +
+ {/if} {#if editorMode === 'idle'}
@@ -1038,14 +1067,6 @@ min-height: 0; } - .status-chip { - padding: 5px 12px; - border-radius: 999px; - background: var(--surface-3); - color: var(--text-2); - font-size: 11.5px; - white-space: nowrap; - } .cols { display: flex; @@ -1067,13 +1088,16 @@ padding-right: 2px; } .col-title { - font-size: 11.5px; + font-size: 14.5px; font-weight: 600; - letter-spacing: 0.06em; - color: var(--text-3); - text-transform: uppercase; + color: var(--text); margin: 0; } + .col-hint { + font-size: 11px; + color: var(--text-3); + white-space: nowrap; + } .agent-list { display: flex; flex-direction: column; @@ -1145,10 +1169,12 @@ .lib-head { display: flex; align-items: center; - justify-content: space-between; gap: 8px; margin-top: 6px; } + .lib-head .a-btn { + margin-left: auto; + } .skill-lib { display: flex; flex-direction: column; @@ -1220,37 +1246,6 @@ flex-shrink: 0; } - /* Toggle switch (spec §5: 34×19 capsule; on = amber track, dark knob) */ - .switch { - width: 34px; - height: 19px; - border-radius: 999px; - border: 1px solid var(--border-strong); - background: var(--surface-3); - position: relative; - cursor: pointer; - padding: 0; - transition: background-color 150ms, border-color 150ms; - } - .switch .knob { - position: absolute; - top: 2px; - left: 2px; - width: 15px; - height: 15px; - border-radius: 999px; - background: var(--text-3); - transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1), background-color 150ms; - } - .switch.on { - background: var(--accent); - border-color: var(--accent); - } - .switch.on .knob { - transform: translateX(15px); - background: var(--accent-contrast); - } - /* ── 中栏 ─────────────────────────────────────────────── */ .mid { flex: 1; @@ -1382,12 +1377,13 @@ .right-head { display: flex; align-items: center; - justify-content: space-between; + gap: 8px; } .right-head-actions { display: flex; align-items: center; gap: 6px; + margin-left: auto; } .link-btn { display: inline-flex; @@ -1583,58 +1579,6 @@ .editor-actions .link-danger { margin-left: auto; } - - /* ── 通用 ─────────────────────────────────────────────── */ - .a-btn { - display: inline-flex; - align-items: center; - gap: 6px; - min-height: 32px; - padding: 0 14px; - border-radius: 8px; - font-family: inherit; - font-size: 12.5px; - font-weight: 600; - cursor: pointer; - border: 1px solid transparent; - transition: - background-color 150ms cubic-bezier(0.16, 1, 0.3, 1), - border-color 150ms, - transform 100ms; - } - .a-btn.primary { - background: var(--accent); - color: var(--accent-contrast); - } - .a-btn.primary:hover:not(:disabled) { - background: var(--accent-hover); - } - .a-btn.secondary { - background: var(--surface-2); - border-color: var(--border-strong); - color: var(--text); - } - .a-btn.secondary:hover:not(:disabled) { - border-color: rgba(255, 255, 255, 0.24); - } - .a-btn:disabled { - opacity: 0.5; - cursor: default; - } - .a-btn:active:not(:disabled) { - transform: scale(0.98); - } - .a-btn.sm { - min-height: 30px; - padding: 0 11px; - font-size: 12px; - } - .a-btn.xs { - min-height: 24px; - padding: 0 9px; - font-size: 11px; - } - .icon-btn { display: inline-flex; align-items: center; @@ -1691,22 +1635,10 @@ box-shadow: 0 0 0 4px var(--accent-dim); } } - - .a-select { - background: var(--surface-2); - border: 1px solid var(--border-strong); - border-radius: 8px; - color: var(--text); - font-family: inherit; - font-size: 12px; - padding: 5px 8px; + .chat-head-actions .a-select { max-width: 220px; + padding: 5px 8px; } - .a-select:focus-visible { - outline: none; - border-color: var(--accent); - } - .manage-btn { display: none; } diff --git a/calliope-web/src/routes/app.css b/calliope-web/src/routes/app.css index 48ba1623..bdd7ee6d 100644 --- a/calliope-web/src/routes/app.css +++ b/calliope-web/src/routes/app.css @@ -3,66 +3,18 @@ @tailwind utilities; :root { - --bg-primary: #0a0a0c; - --bg-surface: #141418; - --bg-elevated: #1e1e24; - --border: #2a2a32; - --text-primary: #f4f4f5; - --text-secondary: #a1a1aa; - --text-muted: #71717a; - --accent: #8b5cf6; - --accent-hover: #7c3aed; - --accent-glow: rgba(139, 92, 246, 0.25); - --success: #22c55e; - --warning: #f59e0b; - --error: #ef4444; - --info: #3b82f6; - - /* Omni Composer pill tokens */ - --pill-bg: var(--bg-elevated); - --pill-border: var(--border); - --pill-radius: 9999px; - --pill-height: 36px; - --pill-padding: 0 14px; - --pill-font-size: 13px; - - --radius-sm: 6px; - --radius-md: 10px; - --radius-lg: 16px; - - --space-xs: 4px; - --space-sm: 8px; - --space-md: 16px; - --space-lg: 24px; - --space-xl: 32px; - - --font-display: 'Outfit', system-ui, sans-serif; - --font-body: 'IBM Plex Sans', system-ui, sans-serif; - --font-mono: 'JetBrains Mono', ui-monospace, monospace; -} - -body { - background: var(--bg-primary); - color: var(--text-primary); - font-family: var(--font-body); - margin: 0; - min-height: 100vh; -} - -/* ------------------------------------------------------------------ - * A「片场暗房」scoped design tokens — spec-v2 §2 (HEL-603 confirmed). - * Adopted incrementally by new A-style pages via the `.a-darkroom` - * wrapper; graduates to :root when the full A shell (216px nav) lands. - * Values are the single source of truth for A pages — do not hardcode - * colors inside pages, and do not override these with ad-hoc CSS. - * ------------------------------------------------------------------ */ -.a-darkroom { + /* ------------------------------------------------------------------ + * A「片场暗房」design tokens — spec-v2 §2 (HEL-603 confirmed). + * Single source of truth for the whole app: do not hardcode colors in + * pages or components, and do not override these with ad-hoc CSS. + * ------------------------------------------------------------------ */ --bg: #0d0e11; --surface: #14161b; --surface-2: #1b1e25; --surface-3: #22262f; --border: rgba(255, 255, 255, 0.07); --border-strong: rgba(255, 255, 255, 0.14); + --border-hover: rgba(255, 255, 255, 0.24); --text: #edeef0; --text-2: #9ba1ab; --text-3: #5c626c; @@ -71,19 +23,17 @@ body { --accent-contrast: #16130a; --accent-dim: rgba(232, 163, 61, 0.14); --accent-glow: rgba(232, 163, 61, 0.35); + --accent-focus: rgba(232, 163, 61, 0.6); --success: #3fb97f; --success-dim: rgba(63, 185, 127, 0.14); --info: #5b8def; --info-dim: rgba(91, 141, 239, 0.14); --error: #e5484d; --error-dim: rgba(229, 72, 77, 0.14); + --error-border: rgba(229, 72, 77, 0.4); --cloud: #b98be0; --cloud-dim: rgba(185, 139, 224, 0.14); - /* Typography (§2.2) */ - --font-ui: 'Noto Sans SC', 'Noto Sans CJK SC', var(--font-body); - --font-a-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace; - /* Avatar five-color set (§2.1) — five agents only */ --avatar-1: linear-gradient(135deg, #e8a33d, #b96a1b); --avatar-2: linear-gradient(135deg, #5b8def, #3a5fa9); @@ -91,6 +41,52 @@ body { --avatar-4: linear-gradient(135deg, #b98be0, #7a4fa9); --avatar-5: linear-gradient(135deg, #d98e6a, #a95535); + /* Typography (§2.2) */ + --font-ui: 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif; + --font-a-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace; + + /* Radius / spacing (§2.3) */ + --radius-sm: 7px; + --radius-md: 10px; + --radius-lg: 10px; + + --space-xs: 4px; + --space-sm: 8px; + --space-md: 16px; + --space-lg: 24px; + --space-xl: 32px; + + /* Legacy token names used by shared primitives — aliases of the A set, + so every component renders in the same darkroom palette. */ + --bg-primary: var(--bg); + --bg-surface: var(--surface); + --bg-elevated: var(--surface-2); + --text-primary: var(--text); + --text-secondary: var(--text-2); + --text-muted: var(--text-3); + --warning: var(--accent); + --font-display: var(--font-ui); + --font-body: var(--font-ui); + --font-mono: var(--font-a-mono); + + /* Omni Composer pill tokens */ + --pill-bg: var(--surface-2); + --pill-border: var(--border-strong); + --pill-radius: 9999px; + --pill-height: 36px; + --pill-padding: 0 14px; + --pill-font-size: 13px; +} + +body { + background: var(--bg); + color: var(--text); + font-family: var(--font-ui); + margin: 0; + min-height: 100vh; +} + +.a-darkroom { background: var(--bg); color: var(--text); font-family: var(--font-ui); @@ -98,72 +94,233 @@ body { line-height: 1.6; } -.a-darkroom .mono, -.a-darkroom code, -.a-darkroom .kh { +code, +.mono, +.kh { font-family: var(--font-a-mono); font-variant-numeric: tabular-nums; } -h1, -h2, -h3, -.logo { - font-family: var(--font-display); +/* ------------------------------------------------------------------ + * Shared A controls (§5 组件状态全表). The only definitions of these + * looks — `ui/Button.svelte` renders `.a-btn`, pages use the classes + * directly for links / selects. Page styles may only tweak layout + * (width / margin), never re-declare colors. + * ------------------------------------------------------------------ */ +.a-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + min-height: 34px; + padding: 0 16px; + border-radius: 8px; + border: 1px solid transparent; + font-family: inherit; + font-size: 13px; + font-weight: 600; + white-space: nowrap; + text-decoration: none; + cursor: pointer; + box-sizing: border-box; + transition: + background-color 150ms cubic-bezier(0.16, 1, 0.3, 1), + border-color 150ms, + color 150ms, + transform 100ms; +} +.a-btn.sm { + min-height: 30px; + padding: 0 12px; + font-size: 12px; +} +.a-btn.xs { + min-height: 24px; + padding: 0 9px; + font-size: 11px; +} +.a-btn.block { + width: 100%; +} +.a-btn.primary { + background: var(--accent); + color: var(--accent-contrast); +} +.a-btn.primary:hover:not(:disabled) { + background: var(--accent-hover); +} +.a-btn.secondary { + background: var(--surface-2); + border-color: var(--border-strong); + color: var(--text); +} +.a-btn.secondary:hover:not(:disabled) { + border-color: var(--border-hover); +} +.a-btn.ghost { + background: transparent; + color: var(--text-2); +} +.a-btn.ghost:hover:not(:disabled) { + background: var(--surface-3); + color: var(--text); +} +.a-btn.danger { + background: transparent; + border-color: var(--error-border); + color: var(--error); +} +.a-btn.danger:hover:not(:disabled) { + background: var(--error-dim); +} +.a-btn:active:not(:disabled) { + transform: scale(0.98); +} +.a-btn:disabled, +.a-btn[aria-disabled='true'] { + opacity: 0.4; + cursor: not-allowed; } -code, -.mono { - font-family: var(--font-mono); +/* Top-bar status capsule (counts / save state / connection). */ +.status-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 5px 12px; + border-radius: 999px; + background: var(--surface-3); + color: var(--text-2); + font-size: 11.5px; + white-space: nowrap; +} +.status-chip.accent { + background: var(--accent-dim); + color: var(--accent); +} +.status-chip-dot { + width: 6px; + height: 6px; + border-radius: 50%; + flex-shrink: 0; + background: currentColor; +} +.status-chip-dot.ok { + background: var(--success); +} +.status-chip-dot.fail { + background: var(--error); +} +.status-chip-dot.idle { + background: var(--text-3); +} + +/* Card / panel surface (§2.3: 10px radius, 1px border, no shadow). */ +.a-panel { + background: var(--surface); + border: 1px solid var(--border); + border-radius: 10px; + padding: 20px 22px; + box-sizing: border-box; +} +.a-panel-title { + margin: 0; + font-size: 14.5px; + font-weight: 600; + color: var(--text); +} +.a-panel-lead { + margin: 4px 0 0; + font-size: 12px; + line-height: 1.6; + color: var(--text-3); +} + +.a-select, +.a-input, +.a-textarea, +.field-input, +.field-textarea, +.field-select { + box-sizing: border-box; + background: var(--surface-2); + border: 1px solid var(--border-strong); + border-radius: 7px; + color: var(--text); + font-family: inherit; + font-size: 12.5px; + transition: border-color 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.a-select { + padding: 7px 9px; + cursor: pointer; +} +.a-input, +.field-input, +.field-select { + width: 100%; + padding: 8px 11px; +} +.a-textarea, +.field-textarea { + width: 100%; + padding: 9px 11px; + resize: vertical; + min-height: 96px; + line-height: 1.6; +} +.a-select:hover, +.a-input:hover, +.a-textarea:hover, +.field-input:hover, +.field-textarea:hover, +.field-select:hover { + border-color: var(--border-hover); +} +.a-select:focus, +.a-input:focus, +.a-textarea:focus, +.field-input:focus, +.field-textarea:focus, +.field-select:focus { + outline: none; + border-color: var(--accent-focus); +} +.a-input.invalid, +.a-textarea.invalid, +.field-input.invalid { + border-color: var(--error); +} +.a-select option.unavailable { + color: var(--text-3); } .field { display: block; - margin-bottom: var(--space-md); + margin-bottom: 14px; } .field-label { display: block; font-size: 12px; font-weight: 500; - letter-spacing: 0.02em; - color: var(--text-muted); + color: var(--text-2); margin-bottom: 6px; } -.field-input, -.field-textarea, -.field-select { - width: 100%; - box-sizing: border-box; - background: var(--bg-elevated); - border: 1px solid var(--border); - border-radius: var(--radius-sm); - padding: 10px 12px; - color: var(--text-primary); - font-size: 14px; - font-family: inherit; -} -.field-textarea { - resize: vertical; - min-height: 96px; - line-height: 1.5; -} -.field-input:focus, -.field-textarea:focus, -.field-select:focus { - outline: none; - border-color: var(--accent); - box-shadow: 0 0 0 3px var(--accent-glow); -} .field-hint { - margin-top: 6px; - font-size: 12px; - color: var(--text-muted); + margin: 6px 0 0; + font-size: 11.5px; + color: var(--text-3); +} +.field-error { + margin: 6px 0 0; + font-size: 11.5px; + color: var(--error); } /* Dark theme scrollbars (Firefox + Chromium) */ * { scrollbar-width: thin; - scrollbar-color: #3f3f46 transparent; + scrollbar-color: var(--surface-3) transparent; } *::-webkit-scrollbar { @@ -176,14 +333,14 @@ code, } *::-webkit-scrollbar-thumb { - background: #3f3f46; + background: var(--surface-3); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; } *::-webkit-scrollbar-thumb:hover { - background: #52525b; + background: var(--text-3); border: 2px solid transparent; background-clip: padding-box; } diff --git a/calliope-web/src/routes/build-scene/+page.ts b/calliope-web/src/routes/build-scene/+page.ts new file mode 100644 index 00000000..a8f63ebf --- /dev/null +++ b/calliope-web/src/routes/build-scene/+page.ts @@ -0,0 +1,8 @@ +import { redirect } from '@sveltejs/kit'; + +export const ssr = false; +export const prerender = false; + +export function load() { + redirect(308, '/'); +} diff --git a/calliope-web/src/routes/canvas/+page.ts b/calliope-web/src/routes/canvas/+page.ts index 83addb7e..a8f63ebf 100644 --- a/calliope-web/src/routes/canvas/+page.ts +++ b/calliope-web/src/routes/canvas/+page.ts @@ -1,2 +1,8 @@ +import { redirect } from '@sveltejs/kit'; + export const ssr = false; export const prerender = false; + +export function load() { + redirect(308, '/'); +} diff --git a/calliope-web/src/routes/canvas/[id]/+page.ts b/calliope-web/src/routes/canvas/[id]/+page.ts index 83addb7e..a8f63ebf 100644 --- a/calliope-web/src/routes/canvas/[id]/+page.ts +++ b/calliope-web/src/routes/canvas/[id]/+page.ts @@ -1,2 +1,8 @@ +import { redirect } from '@sveltejs/kit'; + export const ssr = false; export const prerender = false; + +export function load() { + redirect(308, '/'); +} diff --git a/calliope-web/src/routes/connections/+page.svelte b/calliope-web/src/routes/connections/+page.svelte index 9d4a2a2c..bb893bf4 100644 --- a/calliope-web/src/routes/connections/+page.svelte +++ b/calliope-web/src/routes/connections/+page.svelte @@ -1,5 +1,6 @@ @@ -520,7 +527,7 @@
{ep.name} - {typeLabel(kind)} + {endpointTypeLabel(kind)} {#if ep.auth_type !== 'none'} {ep.auth_type === 'bearer' ? 'Bearer' : 'Header'} {/if} @@ -613,7 +620,7 @@
-
+

{t('conn.wfTitle')}

{t('conn.wfHint')} @@ -786,25 +793,23 @@ {/if} +
{/if} + + {#if endpoints.length > 0} +
+

{t('conn.targetsTitle')}

+ {#each targetRows as row (row.key)} +
+ {row.label} + + {#if row.kind} + {endpointTypeLabel(row.kind)} + {/if} + {row.value} + + {t('conn.targetChange')} +
+ {/each} +

{t('conn.targetNote')}

+
+ {/if} +
{/if} @@ -983,51 +1008,6 @@ color: var(--error); } - .status-chip { - padding: 5px 12px; - border-radius: 999px; - background: var(--surface-3); - color: var(--text-2); - font-size: 11.5px; - white-space: nowrap; - } - - .a-btn { - display: inline-flex; - align-items: center; - gap: 6px; - min-height: 34px; - padding: 0 16px; - border-radius: 8px; - font-family: inherit; - font-size: 13px; - font-weight: 600; - cursor: pointer; - border: 1px solid transparent; - transition: - background-color 150ms cubic-bezier(0.16, 1, 0.3, 1), - border-color 150ms, - transform 100ms; - } - .a-btn.primary { - background: var(--accent); - color: var(--accent-contrast); - } - .a-btn.primary:hover { - background: var(--accent-hover); - } - .a-btn.secondary { - background: var(--surface-2); - border-color: var(--border-strong); - color: var(--text); - } - .a-btn.secondary:hover { - border-color: rgba(255, 255, 255, 0.24); - } - .a-btn:active { - transform: scale(0.98); - } - .layout { display: flex; gap: 24px; @@ -1420,46 +1400,67 @@ .wf-row .a-select { width: 220px; } - - .a-select { - background: var(--surface-2); - border: 1px solid var(--border-strong); - border-radius: 7px; - padding: 7px 9px; - color: var(--text); - font-family: inherit; - font-size: 12px; - cursor: pointer; - } - .a-select:focus { - outline: none; - border-color: rgba(232, 163, 61, 0.6); - } - /* ---------------- form column ---------------- */ - .form-col { + .side-col { width: 384px; flex-shrink: 0; + display: flex; + flex-direction: column; + gap: 16px; + position: sticky; + top: 24px; + } + .form-col { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px 20px; - position: sticky; - top: 24px; } - .form-idle { + .layout:not(.form-open) .form-col { + display: none; + } + .targets { + padding: 16px 18px 14px; + } + .target-row { display: flex; - flex-direction: column; align-items: center; gap: 10px; - padding: 36px 12px; - color: var(--text-3); - text-align: center; + padding: 10px 0; + border-bottom: 1px solid var(--border); + font-size: 12.5px; } - .form-idle p { - margin: 0; + .target-row:first-of-type { + margin-top: 8px; + border-top: 1px solid var(--border); + } + .target-label { + color: var(--text-2); + flex: 1; + min-width: 0; + } + .target-value { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--text); + } + .target-value strong { + font-weight: 600; + } + .target-link { + color: var(--accent); font-size: 12px; + text-decoration: none; + } + .target-link:hover { + text-decoration: underline; + } + .target-note { + margin: 10px 0 0; + font-size: 11.5px; line-height: 1.6; + color: var(--text-3); } .form-head { display: flex; @@ -1631,34 +1632,6 @@ .need-test.passed { color: var(--success); } - - .page :global(.btn-secondary) { - background: var(--surface-2); - border-color: var(--border-strong); - color: var(--text); - } - .page :global(.btn-secondary:hover:not(:disabled)) { - background: var(--surface-3); - border-color: rgba(255, 255, 255, 0.24); - } - .page :global(.btn-primary) { - background: var(--accent); - color: var(--accent-contrast); - } - .page :global(.btn-primary:hover:not(:disabled)) { - background: var(--accent-hover); - } - .page :global(.btn-ghost) { - color: var(--text-2); - } - .page :global(.btn-ghost:hover:not(:disabled)) { - background: var(--surface-3); - color: var(--text); - } - .page :global(.btn:focus-visible) { - outline-color: var(--accent); - } - .drawer-backdrop { display: none; } @@ -1670,6 +1643,7 @@ } .layout { flex-direction: column; + align-items: stretch; } .form-col { position: fixed; @@ -1691,11 +1665,9 @@ .form-col.open { transform: translateX(0); } - .form-idle { - display: none; - } - .layout:not(.form-open) .form-col { - display: none; + .side-col { + width: 100%; + position: static; } .drawer-backdrop { display: block; diff --git a/calliope-web/src/routes/image/+page.svelte b/calliope-web/src/routes/image/+page.svelte index e0af4c2a..3f7e4128 100644 --- a/calliope-web/src/routes/image/+page.svelte +++ b/calliope-web/src/routes/image/+page.svelte @@ -1,9 +1,5 @@ - - - + diff --git a/calliope-web/src/routes/library/+page.ts b/calliope-web/src/routes/library/+page.ts new file mode 100644 index 00000000..a8f63ebf --- /dev/null +++ b/calliope-web/src/routes/library/+page.ts @@ -0,0 +1,8 @@ +import { redirect } from '@sveltejs/kit'; + +export const ssr = false; +export const prerender = false; + +export function load() { + redirect(308, '/'); +} diff --git a/calliope-web/src/routes/models/+page.svelte b/calliope-web/src/routes/models/+page.svelte index 3b8ba840..4bc03db1 100644 --- a/calliope-web/src/routes/models/+page.svelte +++ b/calliope-web/src/routes/models/+page.svelte @@ -1,5 +1,6 @@ @@ -533,7 +523,7 @@
{profile.name} - {typeLabel(kind)} + {endpointTypeLabel(kind)} {#if isActive} {t('models.defaultBadge')} {/if} @@ -676,14 +666,16 @@

{formMode === 'add' ? t('models.formTitleAdd') : t('models.formTitleEdit')}

- + {#if formMode === 'edit' || !isWideLayout()} + + {/if}
diff --git a/calliope-web/src/routes/tasks/+page.svelte b/calliope-web/src/routes/tasks/+page.svelte index 8ebda6f9..e18cc6b1 100644 --- a/calliope-web/src/routes/tasks/+page.svelte +++ b/calliope-web/src/routes/tasks/+page.svelte @@ -8,6 +8,7 @@ assetUrl, jobsApi, playgroundApi, + projects, workflows, type Job, } from '$lib/api'; @@ -16,6 +17,7 @@ import { handleJobEvent, progressFor } from '$lib/jobProgress'; import { toast } from '$lib/toast'; import { t } from '$lib/i18n.svelte'; + import { isStandaloneJob, jobSourceLabel } from '$lib/jobLabels'; /** * 生成任务页 (spec-v2 §3 nav item, HEL-612): one table summing both @@ -30,6 +32,7 @@ refetchInterval: 5_000, }); const workflowsQuery = createQuery({ queryKey: ['workflows'], queryFn: workflows.list }); + const projectsQuery = createQuery({ queryKey: ['projects'], queryFn: projects.list }); $effect(() => { const off = connectEvents((ev) => { @@ -51,17 +54,6 @@ const shown = $derived(filter === 'all' ? genJobs : genJobs.filter((j) => j.kind === filter)); const activeCount = $derived(genJobs.filter((j) => j.status === 'pending' || j.status === 'running').length); - function sourceLabel(job: Job): string { - const src = job.payload?.source; - if (src === 'studio-image') return t('tasks.sourceStudioImage'); - if (src === 'studio-video') return t('tasks.sourceStudioVideo'); - if (src === 'workbench') return t('tasks.sourceWorkbench'); - if (src === 'playground') return t('tasks.sourcePlayground'); - if (job.scene_id || job.clip_id) return t('tasks.sourceFlow'); - if (!src) return t('tasks.sourceFlow'); - return t('tasks.sourceOther'); - } - function wfName(job: Job): string { return ( ($workflowsQuery.data ?? []).find((w) => w.id === job.workflow_id)?.name ?? @@ -69,6 +61,12 @@ ); } + function projectOf(job: Job): string { + if (isStandaloneJob(job)) return ''; + const title = ($projectsQuery.data ?? []).find((p) => p.id === job.project_id)?.title; + return title ? `《${title}》` : ''; + } + function timeOf(job: Job): string { const ts = parseDbTs(job.created_at); if (!Number.isFinite(ts)) return '—'; @@ -183,7 +181,7 @@
{wfName(job)}
- {sourceLabel(job)} · {timeOf(job)} + {#if projectOf(job)}{projectOf(job)} · {/if}{jobSourceLabel(job)} · {timeOf(job)} {#if (job.output_paths?.length ?? 0) > 0} · {t('tasks.outputs', { n: job.output_paths.length })} {/if} @@ -219,7 +217,7 @@ {t('tasks.cancel')} {/if} - {#if job.payload?.source === 'studio-image' || job.payload?.source === 'studio-video' || job.payload?.source === 'playground'} + {#if isStandaloneJob(job)}