- 新增 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>
171 lines
4.1 KiB
Svelte
171 lines
4.1 KiB
Svelte
<script lang="ts">
|
||
import Icon from '$lib/components/ui/Icon.svelte';
|
||
import type { WorkflowMeta } from '$lib/comfy/types';
|
||
import { t } from '$lib/i18n.svelte';
|
||
import { usageLabel } from '$lib/components/generate/schema';
|
||
import InputRequirementBadge from './InputRequirementBadge.svelte';
|
||
|
||
/**
|
||
* 挑选台一行 (HEL-683):显示名 + 输入要求徽标 + 用途标签 + 端点/收藏
|
||
* 标注。当前工作流行带取景框角线;键盘/指针悬停行只是背景高亮。
|
||
*/
|
||
interface Props {
|
||
meta: WorkflowMeta;
|
||
current: boolean;
|
||
active: boolean;
|
||
endpoints: Array<{ id: string; name: string }>;
|
||
onPick: () => void;
|
||
onActive: () => void;
|
||
}
|
||
|
||
let { meta, current, active, endpoints, onPick, onActive }: Props = $props();
|
||
|
||
const endpointName = $derived(
|
||
meta.endpoint_id
|
||
? (endpoints.find((e) => e.id === meta.endpoint_id)?.name ?? t('desk.wfDefaultConn'))
|
||
: t('desk.wfDefaultConn'),
|
||
);
|
||
</script>
|
||
|
||
<button
|
||
type="button"
|
||
class="row"
|
||
class:active
|
||
class:current
|
||
role="option"
|
||
aria-selected={active ? 'true' : undefined}
|
||
aria-current={current ? 'true' : undefined}
|
||
onclick={onPick}
|
||
onpointermove={onActive}
|
||
onfocus={onActive}
|
||
>
|
||
<span class="main">
|
||
<span class="name">
|
||
{#if meta.favorite}<span class="fav"><Icon name="star" size={11} /></span>{/if}
|
||
<span class="name-txt">{meta.name}</span>
|
||
{#if current}<span class="cur-mark">{t('desk.wfCurrent')}</span>{/if}
|
||
</span>
|
||
<span class="sub">
|
||
<span class="a-tag">{usageLabel(meta.usage!)}</span>
|
||
<InputRequirementBadge io={meta.media_io} compact />
|
||
</span>
|
||
</span>
|
||
<span class="side">
|
||
<span class="conn" title="{t('studio.connLabel')}:{endpointName}">{endpointName}</span>
|
||
</span>
|
||
</button>
|
||
|
||
<style>
|
||
.row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--sp-3);
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: var(--sp-3) var(--sp-4);
|
||
border: 0;
|
||
border-radius: var(--r-md);
|
||
background: none;
|
||
color: var(--text);
|
||
font: inherit;
|
||
text-align: left;
|
||
cursor: pointer;
|
||
/* 长列表性能:视口外的行不参与布局/绘制。 */
|
||
content-visibility: auto;
|
||
contain-intrinsic-size: auto 52px;
|
||
transition: background-color var(--d-state) ease;
|
||
}
|
||
.row:hover,
|
||
.row.active {
|
||
background: var(--bg-3);
|
||
}
|
||
.row:focus-visible {
|
||
outline: none;
|
||
background: var(--bg-3);
|
||
box-shadow: 0 0 0 1px var(--accent-line);
|
||
}
|
||
.main {
|
||
display: grid;
|
||
gap: 3px;
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
.name {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--sp-2);
|
||
min-width: 0;
|
||
}
|
||
.name-txt {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
font-weight: 500;
|
||
}
|
||
.fav {
|
||
display: inline-flex;
|
||
flex-shrink: 0;
|
||
color: var(--accent);
|
||
}
|
||
.cur-mark {
|
||
flex-shrink: 0;
|
||
color: var(--text-3);
|
||
font-size: var(--fs-mini);
|
||
}
|
||
.sub {
|
||
display: flex;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
gap: var(--sp-1);
|
||
}
|
||
.side {
|
||
flex-shrink: 0;
|
||
}
|
||
.conn {
|
||
max-width: 120px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
color: var(--text-3);
|
||
font-size: var(--fs-mini);
|
||
}
|
||
/* 当前工作流:取景框角线(HEL-680 的内容级选中语言)。 */
|
||
.row.current {
|
||
position: relative;
|
||
}
|
||
.row.current::after {
|
||
content: '';
|
||
position: absolute;
|
||
inset: 2px;
|
||
pointer-events: none;
|
||
background-image:
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0),
|
||
linear-gradient(var(--accent) 0 0);
|
||
background-position:
|
||
left top,
|
||
left top,
|
||
right top,
|
||
right top,
|
||
left bottom,
|
||
left bottom,
|
||
right bottom,
|
||
right bottom;
|
||
background-size:
|
||
var(--frame-arm, 12px) var(--frame-w, 2px),
|
||
var(--frame-w, 2px) var(--frame-arm, 12px),
|
||
var(--frame-arm, 12px) var(--frame-w, 2px),
|
||
var(--frame-w, 2px) var(--frame-arm, 12px),
|
||
var(--frame-arm, 12px) var(--frame-w, 2px),
|
||
var(--frame-w, 2px) var(--frame-arm, 12px),
|
||
var(--frame-arm, 12px) var(--frame-w, 2px),
|
||
var(--frame-w, 2px) var(--frame-arm, 12px);
|
||
background-repeat: no-repeat;
|
||
}
|
||
</style>
|