- 新增 components/desk/:StudioDesk 取代 StudioGenerate 成为 /image、/video 共用页面;TaskModeRail(真实计数、未覆盖置灰、收藏/最近)、WorkflowBay (搜索、本机/云端分段、模型家族分组、待确认入口、增量渲染)、 WorkflowPreview(输入要求预览)、LibraryRow/LibraryFilters/ InputRequirementBadge - 挑选时中栏 grid 列宽展开、右侧显示预览;选定后收成摘要带; data-reduce 直接跳变;≤1179px 挑选台为全屏浮层,≤760px 任务模式横条 - 挑选侧全部走 view=meta 轻量元数据,完整记录按 id 惰性加载; 云端来源诚实标注未接入;?wf/?mode 深链;五阶段上下文与返回路径不变 - Composer 工作流芯片改为展开挑选台,删除 WorkflowPicker; i18n 29 键 ×7 语言;changelog - e2e/shoot.mjs 适配挑选台键盘链,并修正 7 处 S1 灰阶化后失效的 旧色值/文案断言(定影 + theme-1 灰阶信号色) Co-authored-by: multica-agent <github@multica.ai>
80 lines
2.2 KiB
Svelte
80 lines
2.2 KiB
Svelte
<script lang="ts">
|
|
import Icon from '$lib/components/ui/Icon.svelte';
|
|
import type { WorkflowMediaIO } from '$lib/comfy/types';
|
|
import { t } from '$lib/i18n.svelte';
|
|
|
|
/**
|
|
* 输入要求徽标 (HEL-683):一个工作流真实声明 的进出媒介,
|
|
* 来自 S2 元数据——图标+文字双编码,只报真实接线,不虚构输入。
|
|
*/
|
|
interface Props {
|
|
io: WorkflowMediaIO | null | undefined;
|
|
/** Compact form for row summaries (no out side when empty-in). */
|
|
compact?: boolean;
|
|
}
|
|
|
|
let { io, compact = false }: Props = $props();
|
|
|
|
type Medium = 'image' | 'video' | 'audio';
|
|
|
|
const LABELS: Record<Medium, string> = {
|
|
image: 'wl.mediaImage',
|
|
video: 'wl.mediaVideo',
|
|
audio: 'wl.mediaAudio',
|
|
};
|
|
|
|
const inList = $derived(((io?.in ?? []) as Medium[]).filter((m) => m in LABELS));
|
|
const outList = $derived(((io?.out ?? []) as Medium[]).filter((m) => m in LABELS));
|
|
</script>
|
|
|
|
{#if inList.length || outList.length}
|
|
<span class="req" aria-label={t('desk.bayReqAria')}>
|
|
{#each inList as m (m)}
|
|
<span class="pill in" title="{t(LABELS[m])} · {t('wl.mediaIn')}">
|
|
<Icon name={m === 'image' ? 'image' : m === 'video' ? 'film' : 'music'} size={12} />
|
|
{#if !compact}<span class="lbl">{t(LABELS[m])}</span>{/if}
|
|
</span>
|
|
{/each}
|
|
{#if inList.length && outList.length}<span class="arrow">→</span>{/if}
|
|
{#each outList as m (m)}
|
|
<span class="pill out" title="{t(LABELS[m])} · {t('wl.mediaOut')}">
|
|
<Icon name={m === 'image' ? 'image' : m === 'video' ? 'film' : 'music'} size={12} />
|
|
{#if !compact}<span class="lbl">{t(LABELS[m])}</span>{/if}
|
|
</span>
|
|
{/each}
|
|
</span>
|
|
{:else if !compact}
|
|
<span class="pill none" title={t('desk.promptOnly')}><span class="lbl">{t('desk.promptOnly')}</span></span>
|
|
{/if}
|
|
|
|
<style>
|
|
.req {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 3px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.pill {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 3px;
|
|
height: 18px;
|
|
padding: 0 5px;
|
|
border-radius: var(--r-sm);
|
|
background: var(--bg-4);
|
|
color: var(--text-2);
|
|
font-size: var(--fs-mini);
|
|
white-space: nowrap;
|
|
}
|
|
.pill.in {
|
|
color: var(--text);
|
|
}
|
|
.pill.none .lbl {
|
|
color: var(--text-3);
|
|
}
|
|
.arrow {
|
|
color: var(--text-3);
|
|
font-size: var(--fs-mini);
|
|
}
|
|
</style>
|