From 64c1116bca1150e413ab51151bade6844f1ec914 Mon Sep 17 00:00:00 2001 From: leefer Date: Thu, 22 Oct 2026 01:51:42 +0800 Subject: [PATCH] fix(HEL-730): preserve shared pins and sample icon geometry Co-authored-by: multica-agent --- .../components/manage/ComfyConnections.svelte | 55 +------ .../lib/components/manage/LlmModels.svelte | 15 +- .../src/lib/components/manage/management.css | 28 ++++ .../src/lib/components/ui/Icon.svelte | 52 +++---- calliope-web/src/lib/components/ui/icons.ts | 145 +++++++++--------- .../workflows/WorkflowLibrary.svelte | 72 +++++---- calliope-web/src/routes/library/+page.svelte | 3 - calliope-web/src/routes/settings/+page.svelte | 52 ------- calliope-web/src/routes/tasks/+page.svelte | 23 +-- calliope-web/static/themes.css | 3 + .../2026-10-22-hel730-management.md | 2 +- scripts/verify-hel730.mjs | 62 ++++++++ 12 files changed, 246 insertions(+), 266 deletions(-) diff --git a/calliope-web/src/lib/components/manage/ComfyConnections.svelte b/calliope-web/src/lib/components/manage/ComfyConnections.svelte index ab91309a..a13c49e9 100644 --- a/calliope-web/src/lib/components/manage/ComfyConnections.svelte +++ b/calliope-web/src/lib/components/manage/ComfyConnections.svelte @@ -12,23 +12,10 @@ import Button from "$lib/components/ui/Button.svelte"; import ConfirmDialog from "$lib/components/ui/ConfirmDialog.svelte"; import Icon from "$lib/components/ui/Icon.svelte"; - import EmptyState from "$lib/components/ui/EmptyState.svelte"; - import { - apiErrorMessage, - comfy, - settings, - workflows, - type ComfyEndpoint, - type WorkflowMeta, - } from "$lib/api"; + import { comfy, settings, workflows, type ComfyEndpoint } from "$lib/api"; import { toast } from "$lib/toast"; import { t } from "$lib/i18n.svelte"; - import { - classifyEndpoint, - endpointTypeLabel, - type EndpointKind, - } from "$lib/endpointKind"; const client = useQueryClient(); @@ -375,51 +362,11 @@ }, }); - // ------------------------------------------------------------------ - // Helpers - // ------------------------------------------------------------------ - function formatTime(at: number): string { - return new Date(at).toLocaleTimeString([], { - hour: "2-digit", - minute: "2-digit", - }); - } - function tokenTail(ep: ComfyEndpoint): string { const tail = ep.token_tail ?? ""; return tail ? `****${tail}` : ""; } - function endpointName(id: string | null | undefined): string | null { - if (!id) return null; - return endpoints.find((ep) => ep.id === id)?.name ?? null; - } - - // 任务使用目标 (a6): where each kind of job actually runs — a workflow's - // own binding first, otherwise the default connection. - function kindTarget(kind: "image" | "video" | null): { - value: string; - kind: EndpointKind | null; - } { - const wfs: WorkflowMeta[] = ($wfMetaQuery.data ?? []).filter( - (w) => kind === null || w.kind === kind, - ); - const ids = new Set( - wfs.map((w) => w.endpoint_id || activeId).filter(Boolean), - ); - if (wfs.length === 0) ids.add(activeId); - if (ids.size === 1) { - const ep = endpoints.find((e) => e.id === [...ids][0]); - if (ep) return { value: ep.name, kind: classifyEndpoint(ep.base_url) }; - } - return { value: t("conn.targetMixed", { n: ids.size }), kind: null }; - } - const targetRows = $derived.by(() => [ - { key: "image", label: t("conn.targetImage"), ...kindTarget("image") }, - { key: "video", label: t("conn.targetVideo"), ...kindTarget("video") }, - { key: "flow", label: t("conn.targetFlow"), ...kindTarget(null) }, - ]); - loadTests(); $effect(() => { // prune stale test records once the endpoint list is known diff --git a/calliope-web/src/lib/components/manage/LlmModels.svelte b/calliope-web/src/lib/components/manage/LlmModels.svelte index d7fec3a6..50f3ec7a 100644 --- a/calliope-web/src/lib/components/manage/LlmModels.svelte +++ b/calliope-web/src/lib/components/manage/LlmModels.svelte @@ -11,12 +11,10 @@ import Button from "$lib/components/ui/Button.svelte"; import ConfirmDialog from "$lib/components/ui/ConfirmDialog.svelte"; import Icon from "$lib/components/ui/Icon.svelte"; - import EmptyState from "$lib/components/ui/EmptyState.svelte"; import { settings, type LlmProfile, type Settings } from "$lib/api"; import { randomId } from "$lib/ids"; import { toast } from "$lib/toast"; import { t } from "$lib/i18n.svelte"; - import { classifyEndpoint, endpointTypeLabel } from "$lib/endpointKind"; const client = useQueryClient(); @@ -503,16 +501,6 @@ $assignMutation.mutate({ [role]: value === "" ? null : value }); } - // ------------------------------------------------------------------ - // Helpers - // ------------------------------------------------------------------ - function formatTime(at: number): string { - return new Date(at).toLocaleTimeString([], { - hour: "2-digit", - minute: "2-digit", - }); - } - function keyTail(profile: LlmProfile): string { const tail = profile.api_key_tail ?? ""; return tail ? `sk-****${tail}` : ""; @@ -546,8 +534,7 @@ 正在读取模型…

{:else if !$settingsQuery.data}{:else}{@const s = $settingsQuery.data}{@const profiles = - s.llm_profiles}{@const activeId = s.llm_active_id} +

{:else}{@const s = $settingsQuery.data}{@const profiles = s.llm_profiles}
{#each profiles as profile (profile.id)}{@const rec = tests[profile.id]}
diff --git a/calliope-web/src/lib/components/manage/management.css b/calliope-web/src/lib/components/manage/management.css index 5631b2f3..b874db65 100644 --- a/calliope-web/src/lib/components/manage/management.css +++ b/calliope-web/src/lib/components/manage/management.css @@ -1,5 +1,6 @@ /* HEL-726 approved management primitives. Geometry and colours use theme tokens. */ .management-header { + --icon-stroke: var(--manage-icon-stroke); letter-spacing: var(--manage-header-letter-spacing); box-sizing: border-box; --button-weight: var(--manage-control-weight); @@ -31,6 +32,7 @@ white-space: nowrap; } .management-page { + --icon-stroke: var(--manage-icon-stroke); box-sizing: border-box; --button-weight: var(--manage-control-weight); --button-primary-weight: var(--manage-control-weight); @@ -724,3 +726,29 @@ textarea.f-input { .mg-card .mg-muted { font-size: 12px; } + +.mg-pin { + width: var(--manage-pin-size); + height: var(--manage-pin-size); + padding: 0; + border: 0; + border-radius: var(--manage-pin-radius); + display: grid; + place-items: center; + color: var(--tx-3); + background: transparent; + cursor: pointer; + transition: + color var(--t-fast), + background var(--t-fast); +} +.mg-pin:hover { + background: rgb(var(--ink) / 0.08); + color: var(--tx-1); +} +.mg-pin[aria-pressed="true"] { + color: var(--gold); +} +.mg-pin[aria-pressed="true"] svg { + fill: currentColor; +} diff --git a/calliope-web/src/lib/components/ui/Icon.svelte b/calliope-web/src/lib/components/ui/Icon.svelte index acd7024b..5185957d 100644 --- a/calliope-web/src/lib/components/ui/Icon.svelte +++ b/calliope-web/src/lib/components/ui/Icon.svelte @@ -1,37 +1,37 @@ {#if content} - + {/if} diff --git a/calliope-web/src/lib/components/ui/icons.ts b/calliope-web/src/lib/components/ui/icons.ts index 59260404..d469b93f 100644 --- a/calliope-web/src/lib/components/ui/icons.ts +++ b/calliope-web/src/lib/components/ui/icons.ts @@ -4,76 +4,81 @@ * Each entry is SVG inner content rendered by Icon.svelte via {@html}. */ export const icons = { - // Navigation - home: '', - story: - '', - assets: - '', - script: - '', - video: - '', - queue: - '', - settings: - '', - playground: - '', - // Actions - plus: '', - link: '', - 'link-off': - '', - trash: - '', - edit: '', - retry: - '', - close: '', - download: - '', - upload: - '', - paperclip: - '', - copy: - '', - search: '', - 'external-link': - '', - 'zoom-in': - '', - // Media transport - play: '', - pause: - '', - stop: '', - // Status - check: '', - star: '', - alert: - '', - info: '', - clock: '', - sparkle: - '', - // Media - image: - '', - film: '', - music: - '', - folder: - '', - file: '', - // Chevrons - 'chevron-left': '', - 'chevron-right': '', - 'chevron-up': '', - 'chevron-down': '', - // Misc - drag: '', + "search-manage": '', + "upload-manage": '', + "film-manage": + '', + "arrow-right": '', + pin: '', + // Navigation + home: '', + story: + '', + assets: + '', + script: + '', + video: + '', + queue: + '', + settings: + '', + playground: + '', + // Actions + plus: '', + link: '', + "link-off": + '', + trash: + '', + edit: '', + retry: + '', + close: '', + download: + '', + upload: + '', + paperclip: + '', + copy: '', + search: '', + "external-link": + '', + "zoom-in": + '', + // Media transport + play: '', + pause: + '', + stop: '', + // Status + check: '', + star: '', + alert: + '', + info: '', + clock: '', + sparkle: + '', + // Media + image: + '', + film: '', + music: + '', + folder: + '', + file: '', + // Chevrons + "chevron-left": '', + "chevron-right": '', + "chevron-up": '', + "chevron-down": '', + // Misc + drag: '', } as const satisfies Record; export type IconName = keyof typeof icons; diff --git a/calliope-web/src/lib/components/workflows/WorkflowLibrary.svelte b/calliope-web/src/lib/components/workflows/WorkflowLibrary.svelte index c9065cfb..16c48b2b 100644 --- a/calliope-web/src/lib/components/workflows/WorkflowLibrary.svelte +++ b/calliope-web/src/lib/components/workflows/WorkflowLibrary.svelte @@ -1,4 +1,6 @@ @@ -604,7 +621,7 @@ .length} 个{/snippet} {#snippet actions()}导入工作流{/snippet}
{/snippet} {#snippet actions()}