diff --git a/calliope-web/src/lib/components/desk/InputRequirementBadge.svelte b/calliope-web/src/lib/components/desk/InputRequirementBadge.svelte new file mode 100644 index 00000000..63b135fa --- /dev/null +++ b/calliope-web/src/lib/components/desk/InputRequirementBadge.svelte @@ -0,0 +1,79 @@ + + +{#if inList.length || outList.length} + + {#each inList as m (m)} + + + {#if !compact}{t(LABELS[m])}{/if} + + {/each} + {#if inList.length && outList.length}→{/if} + {#each outList as m (m)} + + + {#if !compact}{t(LABELS[m])}{/if} + + {/each} + +{:else if !compact} + {t('desk.promptOnly')} +{/if} + + diff --git a/calliope-web/src/lib/components/desk/LibraryFilters.svelte b/calliope-web/src/lib/components/desk/LibraryFilters.svelte new file mode 100644 index 00000000..950a995d --- /dev/null +++ b/calliope-web/src/lib/components/desk/LibraryFilters.svelte @@ -0,0 +1,124 @@ + + +
+ +
+ + +
+ + {resultHint} +
+ + diff --git a/calliope-web/src/lib/components/desk/LibraryRow.svelte b/calliope-web/src/lib/components/desk/LibraryRow.svelte new file mode 100644 index 00000000..dd322f63 --- /dev/null +++ b/calliope-web/src/lib/components/desk/LibraryRow.svelte @@ -0,0 +1,170 @@ + + + + + diff --git a/calliope-web/src/lib/components/studio/StudioGenerate.svelte b/calliope-web/src/lib/components/desk/StudioDesk.svelte similarity index 65% rename from calliope-web/src/lib/components/studio/StudioGenerate.svelte rename to calliope-web/src/lib/components/desk/StudioDesk.svelte index 1a0b1e1c..dd85c4f1 100644 --- a/calliope-web/src/lib/components/studio/StudioGenerate.svelte +++ b/calliope-web/src/lib/components/desk/StudioDesk.svelte @@ -2,7 +2,7 @@ import { createQuery, useQueryClient } from '@tanstack/svelte-query'; import { toStore } from 'svelte/store'; import { tick, untrack } from 'svelte'; - import { SvelteSet } from 'svelte/reactivity'; + import { SvelteMap, SvelteSet } from 'svelte/reactivity'; import { page } from '$app/state'; import Icon from '$lib/components/ui/Icon.svelte'; import Modal from '$lib/components/ui/Modal.svelte'; @@ -20,6 +20,7 @@ listPaths, missingMedia, schemaDefaults, + usageLabel, validateForm, type BlockReason, type DeskKind, @@ -27,8 +28,18 @@ type FormValues, } from '$lib/components/generate/schema'; import { matchesFilter, type FeedFilter } from '$lib/components/generate/takes'; + import InputRequirementBadge from './InputRequirementBadge.svelte'; + import TaskModeRail from './TaskModeRail.svelte'; + import WorkflowBay from './WorkflowBay.svelte'; + import WorkflowPreview from './WorkflowPreview.svelte'; import { apiErrorMessage, assetUrl, comfy, jobsApi, playgroundApi, projects, settings, workflows } from '$lib/api'; - import { USAGE_BY_KIND, type Job, type Workflow } from '$lib/comfy/types'; + import { + USAGE_BY_KIND, + type Job, + type Workflow, + type WorkflowMeta, + type WorkflowUsage, + } from '$lib/comfy/types'; import { compactInputValues } from '$lib/comfy/promptInput'; import { connectEvents } from '$lib/events'; import { handleJobEvent } from '$lib/jobProgress'; @@ -38,11 +49,11 @@ import { t } from '$lib/i18n.svelte'; /** - * 生成台 (spec-v2 §3.3, HEL-650 C 批): one desk for images and video — the - * take feed with the composer below and the inspector on the right. - * `/image` and `/video` only preselect: the default workflow comes from - * that kind's usages and the feed opens filtered to it. Slots and params - * follow the selected workflow's JSON (see generate/schema.ts). + * 三段式生成台 (HEL-683, HEL-674 §二 / HEL-679 融合样稿): 左栏任务 + * 模式、中部工作流挑选台(挑选时展开,选定后收成摘要带)、右侧沿用 + * 参数与结果组件。`/image` 与 `/video` 共用本台,`kind` 决定任务模式, + * `?wf=` 深链指定工作流、`?mode=` 预选任务模式。项目五阶段 + * 的上下文条与返回路径保持不变(回流属 S5,不在本卡)。 */ interface Props { kind: DeskKind; @@ -56,7 +67,10 @@ // Data // ------------------------------------------------------------------ const settingsQuery = createQuery({ queryKey: ['settings'], queryFn: settings.get }); - const workflowsQuery = createQuery({ queryKey: ['workflows'], queryFn: workflows.list }); + // HEL-683: the desk browses S2's lightweight metadata (view=meta, no + // workflow_json). Full records are fetched per id on demand — the whole + // list (~7.6MB at 150+ rows) never loads here. + const metaQuery = createQuery({ queryKey: ['workflows-meta'], queryFn: workflows.listMeta }); const jobsQuery = createQuery({ queryKey: ['playground-jobs'], queryFn: playgroundApi.jobs, @@ -77,13 +91,75 @@ const activeId = $derived($settingsQuery.data?.comfyui_active_id ?? endpoints[0]?.id ?? ''); const dryRun = $derived($settingsQuery.data?.dry_run === true); - // HEL-636/638: only confirmed usages with a settled output mapping. - const deskWorkflows = $derived( - ($workflowsQuery.data ?? []).filter((w) => w.is_enabled && (w.usage ?? null) !== null && !w.needs_mapping), + // Picker-side metadata: runnable rows of this kind + honest pending count. + const allMetas = $derived($metaQuery.data ?? []); + const metaById = $derived(new Map(allMetas.map((m) => [m.id, m]))); + const deskMetas = $derived( + allMetas.filter((m) => m.is_enabled && m.usage !== null && !m.needs_mapping && m.kind === kind), ); - const workflowById = $derived(new Map(($workflowsQuery.data ?? []).map((w) => [w.id, w]))); - const workflowOf = (job: Job): Workflow | undefined => - job.workflow_id != null ? workflowById.get(job.workflow_id) : undefined; + const pendingCount = $derived(allMetas.filter((m) => m.needs_mapping && m.kind === kind).length); + + // Full records, lazily fetched per id (selected workflow, feed jobs' + // workflows, the bay's preview row) and cached until invalidated. + const details = new SvelteMap(); + const inflight = new Set(); + + async function ensureDetail(id: number): Promise { + const hit = details.get(id); + if (hit) return hit; + if (inflight.has(id)) return null; + inflight.add(id); + try { + const wf = await workflows.get(id); + details.set(id, wf); + return wf; + } catch { + return null; + } finally { + inflight.delete(id); + } + } + + const neededIds = $derived.by(() => { + const ids = new Set(); + if (workflowId != null) ids.add(workflowId); + if (bayOpen && bayActiveId != null) ids.add(bayActiveId); + for (const j of allJobs) if (j.workflow_id != null) ids.add(j.workflow_id); + return ids; + }); + + $effect(() => { + for (const id of neededIds) { + if (!details.has(id)) void ensureDetail(id); + } + }); + + /** + * A job's workflow: the full record when loaded, else a metadata stub + * (name/kind/usage render instantly; input-dependent views stay empty + * until the record lands). Undefined only when the row is truly gone — + * the 工作流已删除 tag stays honest. + */ + function stubFromMeta(m: WorkflowMeta): Workflow { + return { + id: m.id, + name: m.name, + kind: m.kind, + usage: m.usage, + is_enabled: m.is_enabled, + input_schema: [], + workflow_json: {}, + description: m.description, + prompt_profile: m.prompt_profile, + } as unknown as Workflow; + } + const workflowOf = (job: Job): Workflow | undefined => { + if (job.workflow_id == null) return undefined; + const full = details.get(job.workflow_id); + if (full) return full; + const m = metaById.get(job.workflow_id); + return m ? stubFromMeta(m) : undefined; + }; const allJobs = $derived($jobsQuery.data ?? []); @@ -136,6 +212,61 @@ return off; }); + // ------------------------------------------------------------------ + // Bay (挑选台) state — mode, deep links, open/collapse + // ------------------------------------------------------------------ + type TaskMode = WorkflowUsage | 'all'; + let mode = $state(untrack(initMode)); + function initMode(): TaskMode { + const q = page.url.searchParams.get('mode'); + return q && USAGE_BY_KIND[kind].includes(q as WorkflowUsage) ? (q as WorkflowUsage) : 'all'; + } + + let bayOpen = $state(false); + let bayActiveId = $state(null); + let bay = $state(null); + + const modeMetas = $derived(mode === 'all' ? deskMetas : deskMetas.filter((m) => m.usage === mode)); + + function openBay() { + bayActiveId = workflowId; + bayOpen = true; + } + + function closeBay() { + bayOpen = false; + } + + function pickWorkflow(id: number) { + bayOpen = false; + if (id !== workflowId) workflowId = id; + void tick().then(() => promptEl?.focus()); + } + + // ?wf= deep link: preselect once the metadata is in (invalid → ignored). + let wfDeepLinkDone = false; + $effect(() => { + if (wfDeepLinkDone) return; + const raw = Number(page.url.searchParams.get('wf')); + if (!Number.isInteger(raw) || raw <= 0) { + wfDeepLinkDone = true; + return; + } + if ($metaQuery.isLoading) return; + wfDeepLinkDone = true; + if (deskMetas.some((m) => m.id === raw)) workflowId = raw; + }); + + async function toggleFavorite(id: number, fav: boolean) { + try { + await workflows.update(id, { favorite: fav }); + await client.invalidateQueries({ queryKey: ['workflows-meta'] }); + await client.invalidateQueries({ queryKey: ['workflows'] }); + } catch (err) { + toast.error(apiErrorMessage(err)); + } + } + // ------------------------------------------------------------------ // Form state // ------------------------------------------------------------------ @@ -150,7 +281,7 @@ let promptEl = $state(null); let pickerFor = $state(null); - const currentWorkflow = $derived(deskWorkflows.find((w) => w.id === workflowId) ?? null); + const currentWorkflow = $derived(workflowId != null ? (details.get(workflowId) ?? null) : null); const schema = $derived(currentWorkflow?.input_schema ?? []); const ds = $derived(classifySchema(schema, currentWorkflow?.kind ?? kind)); @@ -161,16 +292,13 @@ endpointId = currentWorkflow?.endpoint_id ?? activeId ?? ''; }); - // Default workflow: this entry's usages in priority order, runnable ones first. + // Default workflow: this entry's usages in priority order (metadata-side; + // error-level warnings surface through the block reason once loaded). $effect(() => { - if (workflowId != null && deskWorkflows.some((w) => w.id === workflowId)) return; + if (workflowId != null && (details.has(workflowId) || deskMetas.some((m) => m.id === workflowId))) return; const usages = USAGE_BY_KIND[kind]; - const runnable = deskWorkflows.filter((w) => !(w.warnings ?? []).some((x) => x.level === 'error')); - const pick = - usages.map((u) => runnable.find((w) => w.usage === u)).find(Boolean) ?? - deskWorkflows.find((w) => usages.includes(w.usage!)) ?? - runnable[0] ?? - deskWorkflows[0]; + const candidates = deskMetas.filter((m) => m.usage != null && usages.includes(m.usage)); + const pick = usages.map((u) => candidates.find((m) => m.usage === u)).find(Boolean) ?? candidates[0] ?? null; workflowId = pick?.id ?? null; }); @@ -328,6 +456,10 @@ openParams(); return; } + if (b.target === 'desk-wf') { + openBay(); + return; + } await tick(); const el = b.target ? document.getElementById(b.target) : null; if (el && !el.getClientRects().length) { @@ -372,6 +504,8 @@ else if (!narrow) inspOpen = true; await client.invalidateQueries({ queryKey: ['playground-jobs'] }); await client.invalidateQueries({ queryKey: ['jobs'] }); + // 最近使用由后端在入队时记录 (queue/manager);这里只刷新轻量列表。 + void client.invalidateQueries({ queryKey: ['workflows-meta'] }); } catch (err) { toast.error(t('studio.submitFailedToast', { detail: apiErrorMessage(err) })); } finally { @@ -494,9 +628,14 @@ } /** Fill the composer back with a past take's values (on its own workflow). */ - function reuse(job: Job) { - const wf = deskWorkflows.find((w) => w.id === job.workflow_id); - if (!wf) { + async function reuse(job: Job) { + const id = job.workflow_id; + if (id == null) { + toast.error(t('studio.reuseMissingWf')); + return; + } + const wf = (details.get(id) ?? (await ensureDetail(id))) as Workflow | null; + if (!wf || !(wf.input_schema ?? []).length) { toast.error(t('studio.reuseMissingWf')); return; } @@ -594,8 +733,9 @@ } // ------------------------------------------------------------------ - // 键盘 (§四.8): Ctrl/⌘+Enter 生成 · / 聚焦提示词 · ↑↓/J/K 切换记录 - // (即时无动画)· 空格播放/暂停 · Delete 删选中 · ] 检视区 · Esc 关浮层 + // 键盘 (§四.8): Ctrl/⌘+Enter 生成 · / 聚焦搜索/提示词 · ↑↓/J/K 切换 + // (挑选台打开时游走挑选行,否则切换记录)· 空格播放/暂停 · Delete 删 + // 选中 · ] 检视区 · Esc 关挑选台/浮层 // ------------------------------------------------------------------ function typing(target: EventTarget | null): boolean { const el = target as HTMLElement | null; @@ -615,6 +755,19 @@ function onKeydown(e: KeyboardEvent) { if (e.defaultPrevented || pickerFor || inLayer(e.target)) return; + if (e.key === 'Escape' && bayOpen) { + e.preventDefault(); + closeBay(); + return; + } + // 挑选台开着时,键盘归挑选台(其容器自己处理 ↑↓/Enter/Esc)。 + if (bayOpen) { + if (e.key === '/' && !typing(e.target)) { + e.preventDefault(); + bay?.focusSearch(); + } + return; + } if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { e.preventDefault(); void submit(); @@ -652,6 +805,14 @@ inspOpen = false; } } + + // ------------------------------------------------------------------ + // Band (选定后的摘要带) helpers + // ------------------------------------------------------------------ + const currentMeta = $derived(allMetas.find((m) => m.id === workflowId) ?? null); + const previewMeta = $derived(allMetas.find((m) => m.id === bayActiveId) ?? null); + const previewFull = $derived(bayActiveId != null ? (details.get(bayActiveId) ?? null) : null); + const picking = $derived(bayOpen && wide); @@ -685,82 +846,131 @@ {/snippet} -
-
- selectTake(job, 'pointer')} - onReuse={reuse} - onRetry={retry} - onCancel={cancel} - onDelete={requestDelete} +
+ (mode = m)} onPickWorkflow={pickWorkflow} /> + +
+ - {#if !$workflowsQuery.isLoading && !deskWorkflows.length} -
- - {t('desk.noWorkflows')} - {t('studio.wfEmptyGo')} +
+ +
+ {#if !bayOpen} +
+
{/if} - (workflowId = wf.id)} - onPickEndpoint={(id) => { - endpointTouched = true; - endpointId = id; - }} - onSubmit={submit} - onReveal={reveal} - onOpenParams={openParams} - onFromResults={(nodeId) => (pickerFor = nodeId)} - /> + + {#if picking} + pickWorkflow(bayActiveId ?? workflowId ?? 0)} + onToggleFav={(fav) => previewMeta && toggleFavorite(previewMeta.id, fav)} + /> + {/if} + +
+
+ selectTake(job, 'pointer')} + onReuse={reuse} + onRetry={retry} + onCancel={cancel} + onDelete={requestDelete} + /> + {#if !$metaQuery.isLoading && !deskMetas.length} +
+ + {t('desk.noWorkflows')} + {t('studio.wfEmptyGo')} +
+ {/if} + { + endpointTouched = true; + endpointId = id; + }} + onSubmit={submit} + onReveal={reveal} + onOpenParams={openParams} + onFromResults={(nodeId) => (pickerFor = nodeId)} + /> +
+ +
-
@@ -779,17 +989,48 @@ diff --git a/calliope-web/src/lib/components/desk/TaskModeRail.svelte b/calliope-web/src/lib/components/desk/TaskModeRail.svelte new file mode 100644 index 00000000..eb52b8d8 --- /dev/null +++ b/calliope-web/src/lib/components/desk/TaskModeRail.svelte @@ -0,0 +1,310 @@ + + + + + diff --git a/calliope-web/src/lib/components/desk/WorkflowBay.svelte b/calliope-web/src/lib/components/desk/WorkflowBay.svelte new file mode 100644 index 00000000..a4a71c49 --- /dev/null +++ b/calliope-web/src/lib/components/desk/WorkflowBay.svelte @@ -0,0 +1,488 @@ + + +{#if open} + + +{/if} + +
+
+

+ + {t('desk.pickWorkflow')} +

+ +
+ +
+ (search = v)} + onSetSource={(s) => (source = s)} + onToggleFav={() => (favOnly = !favOnly)} + /> +
+ + {#if source === 'cloud'} +
+ +

{t('desk.bayCloudTitle')}

+

{t('desk.bayCloudBody')}

+
+ {:else if !metas.length} +
+

{t('desk.noWorkflows')}

+ {t('studio.wfEmptyGo')} +
+ {:else} + +
+ {#each windowed as g (g.key)} + {#if g.visible.length} + + {#each g.visible as m (m.id)} +
+ onPick(m.id)} + onActive={() => (activeId = m.id)} + /> +
+ {/each} + {/if} + {:else} +

{t('desk.wfNoMatch')}

+ {/each} + {#if visibleCount < flat.length} + + {/if} +
+ + {/if} +
+ + diff --git a/calliope-web/src/lib/components/desk/WorkflowPreview.svelte b/calliope-web/src/lib/components/desk/WorkflowPreview.svelte new file mode 100644 index 00000000..db31983f --- /dev/null +++ b/calliope-web/src/lib/components/desk/WorkflowPreview.svelte @@ -0,0 +1,247 @@ + + +
+ {#if meta} +
+

{meta.name}

+ +
+
+ {#if meta.usage}{usageLabel(meta.usage)}{/if} + {#if meta.model_family}{meta.model_family}{/if} + {#if meta.category && CATEGORY_LABELS[meta.category]} + {t(CATEGORY_LABELS[meta.category])} + {/if} + {#if isCurrent}{t('desk.pvCurrent')}{/if} + {#if broken}{t('desk.wfBroken')}{/if} +
+ + {#if meta.description} +

{meta.description}

+ {/if} + +
+

{t('desk.bayReqTitle')}

+
+ +
+ {#if full} +

{slotSummary(full)}

+ {:else} +

{t('desk.pvSlotsLoading')}

+ {/if} +
+ +
+
+
{t('studio.connLabel')}
+
{endpointName}
+
+ {#if meta.last_used_at} +
+
{t('desk.pvLastUsed')}
+
{new Date(meta.last_used_at).toLocaleString()}
+
+ {/if} + {#if (full?.input_schema ?? []).length} +
+
{t('desk.pvParamCount')}
+
{(full?.input_schema ?? []).length}
+
+ {/if} +
+ +
+ + {#if broken}

{t('studio.errWfBroken')}

{/if} +
+ {:else} +
+ +

{t('desk.pvEmpty')}

+
+ {/if} +
+ + diff --git a/calliope-web/src/lib/components/generate/Composer.svelte b/calliope-web/src/lib/components/generate/Composer.svelte index 65faae9e..00367cbe 100644 --- a/calliope-web/src/lib/components/generate/Composer.svelte +++ b/calliope-web/src/lib/components/generate/Composer.svelte @@ -5,7 +5,6 @@ import { t } from '$lib/i18n.svelte'; import ParamChip from './ParamChip.svelte'; import SlotTray from './SlotTray.svelte'; - import WorkflowPicker from './WorkflowPicker.svelte'; import { chipValue, type BlockReason, type DeskSchema, type FormValue, type FormValues } from './schema'; /** @@ -13,11 +12,12 @@ * row of chips — workflow, connection, common params, 参数 — ending in * 生成 with its reason line. The whole composer takes dropped files. * ≤760px it collapses to one line and rises as a bottom sheet on focus. + * HEL-683: the workflow chip no longer opens a dropdown — it expands the + * desk's middle picker bay (StudioDesk WorkflowBay), the single picker. */ interface Props { ds: DeskSchema; values: FormValues; - workflows: Workflow[]; current: Workflow | null; endpoints: Array<{ id: string; name: string }>; endpointId: string; @@ -32,7 +32,7 @@ slotBusy?: boolean; promptEl?: HTMLTextAreaElement | null; onSet: (nodeId: string, value: FormValue) => void; - onPickWorkflow: (wf: Workflow) => void; + onOpenBay: () => void; onPickEndpoint: (id: string) => void; onSubmit: () => void; onReveal: () => void; @@ -43,7 +43,6 @@ let { ds, values, - workflows, current, endpoints, endpointId, @@ -57,7 +56,7 @@ slotBusy = $bindable(false), promptEl = $bindable(null), onSet, - onPickWorkflow, + onOpenBay, onPickEndpoint, onSubmit, onReveal, @@ -165,7 +164,18 @@ {/if}
- +
+ +
- (query = '')} - > - -
- -
- {#each groups as g (g.usage)} -
{usageLabel(g.usage)} · {g.items.length}
- {#each g.items as r (r.wf.id)} - {@const cur = r.wf.id === current?.id} - - {/each} - {:else} -

{t('desk.wfNoMatch')}

- {/each} -
-
- - - {t('desk.wfImport')} - - - ↑↓{t('desk.keySelect')} - Enter{t('desk.keyUse')} - Esc{t('desk.keyClose')} - -
-
-
-
- - diff --git a/calliope-web/src/lib/i18n/de.ts b/calliope-web/src/lib/i18n/de.ts index 0cf78850..bb2989c2 100644 --- a/calliope-web/src/lib/i18n/de.ts +++ b/calliope-web/src/lib/i18n/de.ts @@ -2081,6 +2081,36 @@ export const de: Dict = { 'desk.wfUntested': 'Nicht getestet', 'desk.workflow': 'Workflow', 'desk.yesterday': 'Gestern', + // --- Dreispaltige Desk (HEL-683) --- + 'desk.bandChange': "Workflow wechseln", + 'desk.bayCloudBody': "Cloud-Modelle für Bild / Video (gpt-image2, nano-banana, Jimeng, Kling, …) sind noch nicht angebunden. Nach der Anbindung erscheinen sie mit ihren echten Fähigkeiten — nie als unbenutzbare Einträge.", + 'desk.bayCloudTitle': "Cloud-Generierung nicht angebunden", + 'desk.bayCount': "{n} / {total} Workflows", + 'desk.bayFavOnly': "Favoriten", + 'desk.bayMore': "{n} weitere anzeigen", + 'desk.bayNoFamily': "Modell unbekannt", + 'desk.bayPending': "{n} offen (Zweck / Ausgabe ungeklärt)", + 'desk.bayReqAria': "Eingabeanforderungen", + 'desk.bayReqTitle': "Eingabeanforderungen", + 'desk.baySearchPh': "Name, Beschreibung, Modell, Zweck suchen…", + 'desk.baySourceCloud': "Cloud", + 'desk.baySourceLabel': "Generierungsquelle", + 'desk.baySourceLocal': "Lokal", + 'desk.modeAll': "Alle", + 'desk.modeEmpty': "Für diesen Modus gibt es noch keinen nutzbaren Workflow", + 'desk.modeRailAria': "Aufgabenmodi", + 'desk.modeRailTitle': "Aufgabenmodi", + 'desk.pvBackCreate': "Zurück zum Erstellen", + 'desk.pvCurrent': "Aktueller Workflow", + 'desk.pvEmpty': "Links einen Workflow wählen, um die Eingaben zu sehen", + 'desk.pvFav': "Zu Favoriten", + 'desk.pvLastUsed': "Zuletzt genutzt", + 'desk.pvParamCount': "Parameter", + 'desk.pvSlotsLoading': "Eingabeslots werden gelesen…", + 'desk.pvUnfav': "Aus Favoriten entfernen", + 'desk.pvUse': "Diesen Workflow verwenden", + 'desk.railFav': "Favoriten", + 'desk.railRecent': "Zuletzt", 'wfd.stepParse': 'JSON parsen', 'wfd.stepNodes': 'Knoten erkennen', 'wfd.stepModels': 'Modelle prüfen', diff --git a/calliope-web/src/lib/i18n/en.ts b/calliope-web/src/lib/i18n/en.ts index 6827823b..02f11ebd 100644 --- a/calliope-web/src/lib/i18n/en.ts +++ b/calliope-web/src/lib/i18n/en.ts @@ -2080,6 +2080,36 @@ export const en = { 'desk.wfUntested': 'Not tested', 'desk.workflow': 'Workflow', 'desk.yesterday': 'Yesterday', + // --- Three-section desk (HEL-683) --- + 'desk.bandChange': "Change workflow", + 'desk.bayCloudBody': "Cloud image / video models (gpt-image2, nano-banana, Jimeng, Kling, …) are not connected to this product yet. Once integrated they will be listed with their real capabilities — never as unusable entries.", + 'desk.bayCloudTitle': "Cloud generation not connected", + 'desk.bayCount': "{n} / {total} workflows", + 'desk.bayFavOnly': "Favorites", + 'desk.bayMore': "Show {n} more", + 'desk.bayNoFamily': "Unrecognized model", + 'desk.bayPending': "{n} pending confirmation (usage / output unsettled)", + 'desk.bayReqAria': "Input requirements", + 'desk.bayReqTitle': "Input requirements", + 'desk.baySearchPh': "Search name, description, model, usage…", + 'desk.baySourceCloud': "Cloud", + 'desk.baySourceLabel': "Generation source", + 'desk.baySourceLocal': "Local", + 'desk.modeAll': "All", + 'desk.modeEmpty': "No runnable workflow for this mode yet", + 'desk.modeRailAria': "Task modes", + 'desk.modeRailTitle': "Task modes", + 'desk.pvBackCreate': "Back to creating", + 'desk.pvCurrent': "Current workflow", + 'desk.pvEmpty': "Pick a workflow on the left to see its input requirements", + 'desk.pvFav': "Add to favorites", + 'desk.pvLastUsed': "Last used", + 'desk.pvParamCount': "Parameters", + 'desk.pvSlotsLoading': "Loading input slots…", + 'desk.pvUnfav': "Remove from favorites", + 'desk.pvUse': "Use this workflow", + 'desk.railFav': "Favorites", + 'desk.railRecent': "Recent", 'wfd.stepParse': 'Parse JSON', 'wfd.stepNodes': 'Identify nodes', 'wfd.stepModels': 'Verify models', diff --git a/calliope-web/src/lib/i18n/es.ts b/calliope-web/src/lib/i18n/es.ts index b33d3850..1690e47d 100644 --- a/calliope-web/src/lib/i18n/es.ts +++ b/calliope-web/src/lib/i18n/es.ts @@ -2081,6 +2081,36 @@ export const es: Dict = { 'desk.wfUntested': 'Sin probar', 'desk.workflow': 'Flujo', 'desk.yesterday': 'Ayer', + // --- Escritorio de tres secciones (HEL-683) --- + 'desk.bandChange': "Cambiar flujo", + 'desk.bayCloudBody': "Los modelos de nube para imagen / vídeo (gpt-image2, nano-banana, Jimeng, Kling, …) aún no están conectados a este producto. Al integrarse se listarán con sus capacidades reales, nunca como entradas inutilizables.", + 'desk.bayCloudTitle': "Generación en la nube no conectada", + 'desk.bayCount': "{n} / {total} flujos", + 'desk.bayFavOnly': "Favoritos", + 'desk.bayMore': "Mostrar {n} más", + 'desk.bayNoFamily': "Modelo no identificado", + 'desk.bayPending': "{n} pendientes de confirmar (uso / salida sin fijar)", + 'desk.bayReqAria': "Requisitos de entrada", + 'desk.bayReqTitle': "Requisitos de entrada", + 'desk.baySearchPh': "Buscar nombre, descripción, modelo, uso…", + 'desk.baySourceCloud': "Nube", + 'desk.baySourceLabel': "Origen de generación", + 'desk.baySourceLocal': "Local", + 'desk.modeAll': "Todos", + 'desk.modeEmpty': "Aún no hay flujo utilizable para este modo", + 'desk.modeRailAria': "Modos de tarea", + 'desk.modeRailTitle': "Modos de tarea", + 'desk.pvBackCreate': "Volver a crear", + 'desk.pvCurrent': "Flujo actual", + 'desk.pvEmpty': "Elige un flujo a la izquierda para ver sus requisitos", + 'desk.pvFav': "Añadir a favoritos", + 'desk.pvLastUsed': "Último uso", + 'desk.pvParamCount': "Parámetros", + 'desk.pvSlotsLoading': "Leyendo ranuras de entrada…", + 'desk.pvUnfav': "Quitar de favoritos", + 'desk.pvUse': "Usar este flujo", + 'desk.railFav': "Favoritos", + 'desk.railRecent': "Recientes", 'wfd.stepParse': 'Analizar JSON', 'wfd.stepNodes': 'Identificar nodos', 'wfd.stepModels': 'Verificar modelos', diff --git a/calliope-web/src/lib/i18n/fr.ts b/calliope-web/src/lib/i18n/fr.ts index 0483b4d3..bdf2f50c 100644 --- a/calliope-web/src/lib/i18n/fr.ts +++ b/calliope-web/src/lib/i18n/fr.ts @@ -2081,6 +2081,36 @@ export const fr: Dict = { 'desk.wfUntested': 'Non testé', 'desk.workflow': 'Workflow', 'desk.yesterday': 'Hier', + // --- Bureau en trois sections (HEL-683) --- + 'desk.bandChange': "Changer de flux", + 'desk.bayCloudBody': "Les modèles cloud d'image / vidéo (gpt-image2, nano-banana, Jimeng, Kling, …) ne sont pas encore connectés à ce produit. Une fois intégrés, ils seront listés avec leurs capacités réelles — jamais en entrées inutilisables.", + 'desk.bayCloudTitle': "Génération cloud non connectée", + 'desk.bayCount': "{n} / {total} flux", + 'desk.bayFavOnly': "Favoris", + 'desk.bayMore': "Afficher {n} de plus", + 'desk.bayNoFamily': "Modèle non identifié", + 'desk.bayPending': "{n} à confirmer (usage / sortie non fixés)", + 'desk.bayReqAria': "Exigences d'entrée", + 'desk.bayReqTitle': "Exigences d'entrée", + 'desk.baySearchPh': "Rechercher nom, description, modèle, usage…", + 'desk.baySourceCloud': "Cloud", + 'desk.baySourceLabel': "Source de génération", + 'desk.baySourceLocal': "Local", + 'desk.modeAll': "Tous", + 'desk.modeEmpty': "Aucun flux utilisable pour ce mode pour l'instant", + 'desk.modeRailAria': "Modes de tâche", + 'desk.modeRailTitle': "Modes de tâche", + 'desk.pvBackCreate': "Retour à la création", + 'desk.pvCurrent': "Flux actuel", + 'desk.pvEmpty': "Choisissez un flux à gauche pour voir ses exigences d'entrée", + 'desk.pvFav': "Ajouter aux favoris", + 'desk.pvLastUsed': "Dernière utilisation", + 'desk.pvParamCount': "Paramètres", + 'desk.pvSlotsLoading': "Lecture des emplacements d’entrée…", + 'desk.pvUnfav': "Retirer des favoris", + 'desk.pvUse': "Utiliser ce flux", + 'desk.railFav': "Favoris", + 'desk.railRecent': "Récents", 'wfd.stepParse': 'Analyser le JSON', 'wfd.stepNodes': 'Identifier les nœuds', 'wfd.stepModels': 'Vérifier les modèles', diff --git a/calliope-web/src/lib/i18n/ja.ts b/calliope-web/src/lib/i18n/ja.ts index 70d72bd4..82a681c1 100644 --- a/calliope-web/src/lib/i18n/ja.ts +++ b/calliope-web/src/lib/i18n/ja.ts @@ -2079,6 +2079,36 @@ export const ja: Dict = { 'desk.wfUntested': '未テスト', 'desk.workflow': 'ワークフロー', 'desk.yesterday': '昨日', + // --- 三段構成デスク (HEL-683) --- + 'desk.bandChange': "ワークフローを変更", + 'desk.bayCloudBody': "クラウドの画像/動画モデル(gpt-image2、nano-banana、即夢、Kling など)はまだ本製品に接続されていません。接続後は実際の機能とともに一覧表示され、使えない項目が並ぶことはありません。", + 'desk.bayCloudTitle': "クラウド生成は未接続", + 'desk.bayCount': "{n} / {total} 件のワークフロー", + 'desk.bayFavOnly': "お気に入り", + 'desk.bayMore': "さらに {n} 件表示", + 'desk.bayNoFamily': "モデル未識別", + 'desk.bayPending': "確認待ち {n} 件(用途/出力未確定)", + 'desk.bayReqAria': "入力要件", + 'desk.bayReqTitle': "入力要件", + 'desk.baySearchPh': "名前・説明・モデル・用途を検索…", + 'desk.baySourceCloud': "クラウド", + 'desk.baySourceLabel': "生成ソース", + 'desk.baySourceLocal': "ローカル", + 'desk.modeAll': "すべて", + 'desk.modeEmpty': "このモードで利用できるワークフローはまだありません", + 'desk.modeRailAria': "タスクモード", + 'desk.modeRailTitle': "タスクモード", + 'desk.pvBackCreate': "作成に戻る", + 'desk.pvCurrent': "現在のワークフロー", + 'desk.pvEmpty': "左でワークフローを選ぶと入力要件が表示されます", + 'desk.pvFav': "お気に入りに追加", + 'desk.pvLastUsed': "最終使用", + 'desk.pvParamCount': "パラメータ数", + 'desk.pvSlotsLoading': "入力スロットを読み込み中…", + 'desk.pvUnfav': "お気に入りから外す", + 'desk.pvUse': "このワークフローを使う", + 'desk.railFav': "お気に入り", + 'desk.railRecent': "最近の使用", 'wfd.stepParse': 'JSON を解析', 'wfd.stepNodes': 'ノードを識別', 'wfd.stepModels': 'モデルを確認', diff --git a/calliope-web/src/lib/i18n/ko.ts b/calliope-web/src/lib/i18n/ko.ts index d3decc7b..411a7f5f 100644 --- a/calliope-web/src/lib/i18n/ko.ts +++ b/calliope-web/src/lib/i18n/ko.ts @@ -2079,6 +2079,36 @@ export const ko: Dict = { 'desk.wfUntested': '테스트 안 함', 'desk.workflow': '워크플로', 'desk.yesterday': '어제', + // --- 3단 구성 데스크 (HEL-683) --- + 'desk.bandChange': "워크플로 변경", + 'desk.bayCloudBody': "클라우드 이미지 / 동영상 모델(gpt-image2, nano-banana, 지멍, 클링 등)은 아직 이 제품에 연결되지 않았습니다. 연결 후 실제 기능과 함께 표시되며, 사용할 수 없는 항목은 나타나지 않습니다.", + 'desk.bayCloudTitle': "클라우드 생성 미연결", + 'desk.bayCount': "{n} / {total}개 워크플로", + 'desk.bayFavOnly': "즐겨찾기", + 'desk.bayMore': "{n}개 더 보기", + 'desk.bayNoFamily': "미식별 모델", + 'desk.bayPending': "확인 대기 {n}개(용도 / 출력 미확정)", + 'desk.bayReqAria': "입력 요구 사항", + 'desk.bayReqTitle': "입력 요구 사항", + 'desk.baySearchPh': "이름, 설명, 모델, 용도 검색…", + 'desk.baySourceCloud': "클라우드", + 'desk.baySourceLabel': "생성 소스", + 'desk.baySourceLocal': "로컬", + 'desk.modeAll': "전체", + 'desk.modeEmpty': "이 모드에서 사용 가능한 워크플로가 아직 없습니다", + 'desk.modeRailAria': "작업 모드", + 'desk.modeRailTitle': "작업 모드", + 'desk.pvBackCreate': "만들기로 돌아가기", + 'desk.pvCurrent': "현재 워크플로", + 'desk.pvEmpty': "왼쪽에서 워크플로를 선택하면 입력 요구 사항이 표시됩니다", + 'desk.pvFav': "즐겨찾기에 추가", + 'desk.pvLastUsed': "최근 사용", + 'desk.pvParamCount': "매개변수 수", + 'desk.pvSlotsLoading': "입력 슬롯 읽는 중…", + 'desk.pvUnfav': "즐겨찾기에서 제거", + 'desk.pvUse': "이 워크플로 사용", + 'desk.railFav': "즐겨찾기", + 'desk.railRecent': "최근 사용", 'wfd.stepParse': 'JSON 파싱', 'wfd.stepNodes': '노드 식별', 'wfd.stepModels': '모델 확인', diff --git a/calliope-web/src/lib/i18n/zh.ts b/calliope-web/src/lib/i18n/zh.ts index fa72b02e..f5dbbcca 100644 --- a/calliope-web/src/lib/i18n/zh.ts +++ b/calliope-web/src/lib/i18n/zh.ts @@ -2079,6 +2079,36 @@ export const zh: Dict = { 'desk.wfUntested': '未试运行', 'desk.workflow': '工作流', 'desk.yesterday': '昨天', + // --- 三段式生成台 (HEL-683) --- + 'desk.bandChange': "更换工作流", + 'desk.bayCloudBody': "云端生图 / 生视频模型(gpt-image2、nano-banana、即梦、可灵等)尚未接入本产品。接入后这里会按真实能力列出,不会展示无法使用的条目。", + 'desk.bayCloudTitle': "云端生成未接入", + 'desk.bayCount': "{n} / {total} 个工作流", + 'desk.bayFavOnly': "收藏", + 'desk.bayMore': "再显示 {n} 个", + 'desk.bayNoFamily': "未识别模型", + 'desk.bayPending': "{n} 个待确认(用途 / 输出未定)", + 'desk.bayReqAria': "输入要求", + 'desk.bayReqTitle': "输入要求", + 'desk.baySearchPh': "搜索名称、说明、模型、用途…", + 'desk.baySourceCloud': "云端", + 'desk.baySourceLabel': "生成来源", + 'desk.baySourceLocal': "本机", + 'desk.modeAll': "全部", + 'desk.modeEmpty': "该模式暂无可用工作流", + 'desk.modeRailAria': "任务模式", + 'desk.modeRailTitle': "任务模式", + 'desk.pvBackCreate': "返回创作", + 'desk.pvCurrent': "当前工作流", + 'desk.pvEmpty': "在左侧选择一个工作流查看输入要求", + 'desk.pvFav': "加入收藏", + 'desk.pvLastUsed': "最近使用", + 'desk.pvParamCount': "参数项", + 'desk.pvSlotsLoading': "正在读取输入槽位…", + 'desk.pvUnfav': "取消收藏", + 'desk.pvUse': "使用此工作流", + 'desk.railFav': "收藏", + 'desk.railRecent': "最近使用", 'wfd.stepParse': '解析 JSON', 'wfd.stepNodes': '识别节点', 'wfd.stepModels': '核对模型', diff --git a/calliope-web/src/routes/image/+page.svelte b/calliope-web/src/routes/image/+page.svelte index 3f7e4128..315901be 100644 --- a/calliope-web/src/routes/image/+page.svelte +++ b/calliope-web/src/routes/image/+page.svelte @@ -1,5 +1,5 @@ - + diff --git a/calliope-web/src/routes/video/+page.svelte b/calliope-web/src/routes/video/+page.svelte index 47613a0f..6d97f24f 100644 --- a/calliope-web/src/routes/video/+page.svelte +++ b/calliope-web/src/routes/video/+page.svelte @@ -1,5 +1,5 @@ - + diff --git a/docs/changelogs/2026-10-11-hel683-s4-desk-console.md b/docs/changelogs/2026-10-11-hel683-s4-desk-console.md new file mode 100644 index 00000000..a5dc840a --- /dev/null +++ b/docs/changelogs/2026-10-11-hel683-s4-desk-console.md @@ -0,0 +1,46 @@ +# S4:三段式图片 / 视频生成台(HEL-683) + +按 HEL-679 已确认的三张融合样稿,把 `/image` 与 `/video` 两个入口接入同一 +个三段式生成台。本批只动 `calliope-web`,生成后端与项目回流(S5)零改动。 + +## 三段式布局(新增 `components/desk/`) + +- `StudioDesk.svelte` 取代 `StudioGenerate.svelte` 成为 `/image`、`/video` + 的共用页面(薄壳不变,`kind` 决定任务模式);右栏沿用既有 + `Composer / SlotTray / Inspector / TakeFeed / ContextBar`,仅重排布局。 +- 左栏 `TaskModeRail.svelte`:任务模式按真实工作流统计计数,未覆盖模式置灰; + 底部收藏 / 最近使用直达;≤760px 退化为横向模式条。 +- 中栏挑选台 `WorkflowBay.svelte`(含 `LibraryFilters / LibraryRow / + InputRequirementBadge`):搜索、本机 / 云端来源分段、按模型家族分组、 + 收藏过滤、待确认计数与入口;长列表增量渲染(48/批)+ `content-visibility`, + 键盘 ↑↓/J/K 游走、Enter 使用、Esc 关闭。 +- 挑选时中栏展开(grid 列宽动画,`data-reduce` 下直接跳变),右侧显示 + `WorkflowPreview.svelte` 输入要求预览(S2 元数据 + 按需加载的槽位摘要); + 选定后收成摘要带(band),一键重新展开。≤1179px 挑选台为全屏浮层。 +- 云端来源是诚实占位:明确标注「云端生成未接入」,不造可点击的虚假能力; + 数据结构按 `source: 'comfy' | 'cloud'` 预留。 + +## 数据与路由 + +- 挑选台 / 任务模式 / 摘要带全部走 `GET /api/workflows?view=meta` 轻量元数据 + (150+ 条不下载 workflow_json);完整记录改为按 id 惰性加载(当前工作流、 + 记录流里出现的工作流、预览行),feed 名称先用元数据桩、schema 到位后补全, + 「工作流已删除」判定以元数据为准,不在加载期误报。 +- 新增查询参数:`?wf=` 深链指定工作流、`?mode=` 预选任务模式; + 五阶段 `deskHref` 的 `from=workbench` 上下文条与返回路径保持不变。 +- Composer 的工作流芯片从 380px 下拉弹层改为展开挑选台(`#desk-wf` 语义 + 不变,仍是缺工作流时的定位目标);`WorkflowPicker.svelte` 删除。 +- 最近使用沿用后端入队时写入的 `last_used_at`(queue/manager 原有逻辑), + 提交后刷新轻量列表即可。 + +## 验证 + +- `npm run check`(0 错误,2 条基线既有警告)、`npm run test`、`npm run build` + 通过;prettier 对本批文件通过(仓库 lint 基线因 prettier 3.9 全量重排 + + 无 eslint 配置本就不可用,未扩面修复)。 +- `e2e/shoot.mjs` 全绿:挑选台键盘链(展开→搜索→↑↓→Enter→调参→提交)、 + SSE 状态语义、删除撤销、任务页、窄屏无溢出、减动效;同时把 7 处 S1 灰阶 + 化后未更新的旧色值断言修正为 theme-1 实际值(定影文案 + 灰阶信号色)。 +- `e2e/lastframe.mjs` 全绿(视频检视、尾帧导出、手机弹层无回归)。 +- 手工走查:`?wf` / `?mode` / `from=workbench` 上下文预填与返回、1024/390 + 无横向溢出,截图见 `e2e/shots/hel683-*.png`。 diff --git a/e2e/shoot.mjs b/e2e/shoot.mjs index 17c7addc..cf70850e 100644 --- a/e2e/shoot.mjs +++ b/e2e/shoot.mjs @@ -69,14 +69,15 @@ const run = async () => { const page = await ctx.newPage(); page.on('pageerror', (e) => console.log('PAGEERROR:', e.message)); - // ---------- 工作流选择器:↑↓ 高亮 + Enter 使用 ---------- + // ---------- 挑选台(HEL-683 三段式):摘要带展开 → ↑↓ 高亮 + Enter 使用 ---------- await page.goto('http://127.0.0.1:5173/image'); await page.waitForSelector('#desk-prompt', { timeout: 15000 }); - await page.click('#desk-wf'); - await page.waitForSelector('.shell-pop'); - const activeRows = page.locator('.shell-pop .row.active'); + await page.click('.bay-band .band-hit'); + await page.waitForSelector('.bay .row.active', { timeout: 10000 }); + await page.waitForSelector('.bay .search-input'); + const activeRows = page.locator('.bay .row.active'); const nActive = await activeRows.count(); - ok('工作流面板有默认高亮行', nActive === 1); + ok('挑选台有默认高亮行', nActive === 1); await page.keyboard.press('ArrowDown'); await page.keyboard.press('ArrowDown'); const label1 = await activeRows.first().textContent(); @@ -86,15 +87,19 @@ const run = async () => { const chipBefore = await page.locator('#desk-wf .lbl').textContent(); await page.keyboard.press('Enter'); await page.waitForTimeout(400); + ok('Enter 使用高亮的工作流(挑选台收起)', (await page.locator('.bay.open').count()) === 0); const chipAfter = await page.locator('#desk-wf .lbl').textContent(); - ok('Enter 使用高亮的工作流', chipBefore !== chipAfter || (await activeRows.count()) === 0, `${chipBefore} → ${chipAfter}`); - await page.screenshot({ path: `${SHOTS}/01-picker-roving.png` }); + ok('输入台芯片跟随选中工作流', chipBefore !== chipAfter, `${chipBefore} → ${chipAfter}`); + await page.screenshot({ path: `${SHOTS}/01-bay-roving.png` }); - // 回到文生图工作流 - await page.click('#desk-wf'); - await page.fill('.shell-pop .search-input', '文生图'); + // 回到文生图工作流(搜索唯一命中「回归」) + await page.click('.bay-band .band-hit'); + await page.waitForSelector('.bay .search-input'); + await page.fill('.bay .search-input', '回归'); + await page.waitForSelector('.bay .row.active'); await page.keyboard.press('Enter'); await page.waitForTimeout(300); + ok('搜索后 Enter 选中文生图工作流', (await page.locator('#desk-wf .lbl').textContent()).includes('文生图')); // ---------- 提交 → 完成(绿标签 + 自动切结果页) ---------- setMode({ mode: 'ok', delay_sec: 0 }); @@ -116,9 +121,9 @@ const run = async () => { // 绿标签 const doneCard = page.locator('.take', { hasText: '柴犬' }).first(); const doneTag = await doneCard.locator('.state .a-tag').first().textContent(); - ok('完成态为绿色「完成」标签(非金色)', (doneTag || '').includes('完成'), doneTag); + ok('完成态为「定影」标签(HEL-680 灰阶语义)', (doneTag || '').includes('定影'), doneTag); const tagColor = await doneCard.locator('.state .a-tag').first().evaluate((el) => getComputedStyle(el).color); - ok('完成标签用信号绿 rgb(73,203,144)', tagColor === 'rgb(73, 203, 144)', tagColor); + ok('完成标签用灰阶信号色 rgb(221,221,215)', tagColor === 'rgb(221, 221, 215)', tagColor); await page.screenshot({ path: `${SHOTS}/02-desk-done.png` }); // ---------- 慢任务:排队灰 + 运行青 + 进度条 ---------- @@ -130,9 +135,9 @@ const run = async () => { await page.click('.a-btn.primary'); // 第二个:queued 灰 await page.waitForTimeout(4000); const runTag = await stateTag(page, '观察进度').textContent(); - ok('运行中为青色「生成中」', /生成中|执行/.test(runTag || ''), runTag); + ok('运行中为「生成中/执行中」', /生成中|执行/.test(runTag || ''), runTag); const runTagColor = await stateTag(page, '观察进度').evaluate((el) => getComputedStyle(el).color); - ok('运行标签用信号青 rgb(84,223,210)', runTagColor === 'rgb(84, 223, 210)', runTagColor); + ok('运行标签用灰阶信号色 rgb(184,182,172)', runTagColor === 'rgb(184, 182, 172)', runTagColor); const hasBar = (await page.locator('.take', { hasText: '观察进度' }).locator('.a-progress').count()) > 0; ok('运行中卡片有进度条', hasBar); const queueTag = await stateTag(page, '第二个任务').textContent(); @@ -175,7 +180,7 @@ const run = async () => { const failTag = await failCard.locator('.state .a-tag').first().textContent(); ok('失败为红色「失败」标签', (failTag || '').includes('失败'), failTag); const failColor = await failCard.locator('.state .a-tag').first().evaluate((el) => getComputedStyle(el).color); - ok('失败标签用信号红 rgb(240,100,90)', failColor === 'rgb(240, 100, 90)', failColor); + ok('失败标签用信号红 rgb(208,122,107)(灰阶底上的红)', failColor === 'rgb(208, 122, 107)', failColor); const errLine = failCard.locator('.err-txt'); ok('失败自动展开一行中文结论', (await errLine.count()) === 1 && (await errLine.textContent()).length > 4); await errLine.click(); @@ -199,7 +204,7 @@ const run = async () => { const undoBtn = page.locator('.toast .action', { hasText: '撤销' }); ok('出现带「撤销」的 Toast', (await undoBtn.count()) === 1); const undoColor = await undoBtn.evaluate((el) => getComputedStyle(el).color); - ok('撤销动作按钮为金色文字 rgb(242,199,132)', undoColor === 'rgb(242, 199, 132)', undoColor); + ok('撤销动作按钮为强调白文字 rgb(245,244,238)', undoColor === 'rgb(245, 244, 238)', undoColor); await page.screenshot({ path: `${SHOTS}/05-undo-toast.png` }); const countDeleted = await cardCount(page); ok('删除后行立即收起', countDeleted === countBefore - 1, `${countBefore} → ${countDeleted}`); @@ -237,7 +242,7 @@ const run = async () => { const goneTag = await goneCard.locator('.state .a-tag').first().textContent(); ok('文件缺失为琥珀「文件缺失」', (goneTag || '').includes('文件缺失'), goneTag); const goneColor = await goneCard.locator('.state .a-tag').first().evaluate((el) => getComputedStyle(el).color); - ok('缺失标签用琥珀 rgb(240,180,92)', goneColor === 'rgb(240, 180, 92)', goneColor); + ok('缺失标签用信号琥珀 rgb(163,145,95)', goneColor === 'rgb(163, 145, 95)', goneColor); ok('缺失态给「用相同参数重做」', (await goneCard.getByRole('button', { name: '用相同参数重做' }).count()) === 1); ok('缺失态给「移除记录」', (await goneCard.getByRole('button', { name: '移除记录' }).count()) === 1); await goneCard.getByRole('button', { name: '用相同参数重做' }).click(); @@ -284,7 +289,7 @@ const run = async () => { ok('任务页筛选芯片组(含失败/进行中)', (await chips.count()) === 5); // 默认「全部」选中即金色文字(accent-soft 底) const selChipColor = await chips.first().evaluate((el) => getComputedStyle(el).color); - ok('选中筛选芯片为金色文字', selChipColor === 'rgb(242, 199, 132)', selChipColor); + ok('选中筛选芯片为强调白文字', selChipColor === 'rgb(245, 244, 238)', selChipColor); const failedChipColor = await chips.nth(3).evaluate((el) => getComputedStyle(el).color); await chips.nth(3).click(); // 失败 await page.waitForTimeout(300);