fix(lists): key 48 loops with verified identity or positional semantics
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
<span class="field-label">{t('attach.projectField')}</span>
|
||||
<select class="field-select" bind:value={projectId}>
|
||||
<option value="">{t('attach.selectProject')}</option>
|
||||
{#each projectList as p}
|
||||
{#each projectList as p (p.id)}
|
||||
<option value={p.id}>{p.title}</option>
|
||||
{/each}
|
||||
</select>
|
||||
@@ -192,7 +192,7 @@
|
||||
<span class="field-label">{t('attach.characterField')}</span>
|
||||
<select class="field-select" bind:value={characterId} disabled={projectId === '' || loadingTargets}>
|
||||
<option value="">{t('attach.selectCharacter')}</option>
|
||||
{#each characters as c}
|
||||
{#each characters as c (c.id)}
|
||||
<option value={c.id}>{c.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
@@ -205,7 +205,7 @@
|
||||
<span class="field-label">{t('attach.locationField')}</span>
|
||||
<select class="field-select" bind:value={locationId} disabled={projectId === '' || loadingTargets}>
|
||||
<option value="">{t('attach.selectLocation')}</option>
|
||||
{#each locations as loc}
|
||||
{#each locations as loc (loc.id)}
|
||||
<option value={loc.id}>{loc.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
@@ -230,7 +230,7 @@
|
||||
<span class="field-label">{t('attach.sceneField')}</span>
|
||||
<select class="field-select" bind:value={sceneId} disabled={projectId === '' || loadingTargets}>
|
||||
<option value="">{t('attach.selectScene')}</option>
|
||||
{#each scenes as s}
|
||||
{#each scenes as s (s.id)}
|
||||
<option value={s.id}>#{s.order_index} {s.heading || t('attach.scene')}</option>
|
||||
{/each}
|
||||
</select>
|
||||
|
||||
@@ -382,7 +382,8 @@
|
||||
}}
|
||||
>
|
||||
<option value="">{t('cdf.chooseAsset')}</option>
|
||||
{#each assetOptions as opt}
|
||||
<!-- Asset paths may repeat; option selection belongs to the parent value. Keep positional reuse. -->
|
||||
{#each assetOptions as opt, i (i)}
|
||||
<option value={opt.path}>{opt.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
@@ -423,7 +424,8 @@
|
||||
}}
|
||||
>
|
||||
<option value="">{t('cdf.chooseAsset')}</option>
|
||||
{#each assetOptions as opt}
|
||||
<!-- Asset paths may repeat; option selection belongs to the parent value. Keep positional reuse. -->
|
||||
{#each assetOptions as opt, i (i)}
|
||||
<option value={opt.path}>{opt.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
@@ -454,7 +456,8 @@
|
||||
}}
|
||||
>
|
||||
<option value="">{t('cdf.chooseAsset')}</option>
|
||||
{#each assetOptions as opt}
|
||||
<!-- Asset paths may repeat; option selection belongs to the parent value. Keep positional reuse. -->
|
||||
{#each assetOptions as opt, i (i)}
|
||||
<option value={opt.path}>{opt.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</script>
|
||||
|
||||
{#if segmented}<div class="mg-options" aria-label={t("common.language")}>
|
||||
{#each languages as [code, label]}<button
|
||||
{#each languages as [code, label] (code)}<button
|
||||
class="mg-option"
|
||||
class:on={language.current === code}
|
||||
aria-pressed={language.current === code}
|
||||
|
||||
@@ -299,7 +299,8 @@
|
||||
role="group"
|
||||
aria-label="本次生成的作品"
|
||||
>
|
||||
{#each outputs as p, i}<button
|
||||
<!-- Output paths may repeat; the button number and outIndex refer to this position. -->
|
||||
{#each outputs as p, i (i)}<button
|
||||
aria-pressed={output === p}
|
||||
onclick={() => (outIndex = i)}
|
||||
aria-label={'查看第 ' + (i + 1) + ' 件作品'}>{i + 1}</button
|
||||
@@ -452,7 +453,8 @@
|
||||
{fileGone ? t('jobst.missingDetail') : st.detail}
|
||||
</p>{/if}
|
||||
<div class="detail-meta">
|
||||
{#each spec as s}<span>{s.label} · {s.value}</span
|
||||
<!-- Display-only spec rows have no local state; preserve their existing positional reuse. -->
|
||||
{#each spec as s, i (i)}<span>{s.label} · {s.value}</span
|
||||
>{/each}{#if endpoint}<span>{endpoint}</span>{/if}
|
||||
</div>
|
||||
{#if inputs.length || prompt}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
<button aria-pressed={usage === 'all'} onclick={() => (usage = 'all')}
|
||||
>全部</button
|
||||
>
|
||||
{#each usages as u}<button
|
||||
{#each usages as u (u)}<button
|
||||
aria-pressed={usage === u}
|
||||
onclick={() => (usage = u!)}>{usageLabel(u!)}</button
|
||||
>{/each}
|
||||
@@ -222,7 +222,7 @@
|
||||
<button aria-pressed={family === 'all'} onclick={() => (family = 'all')}
|
||||
>全部模型</button
|
||||
>
|
||||
{#each families as f}<button
|
||||
{#each families as f (f)}<button
|
||||
aria-pressed={family === f}
|
||||
onclick={() => (family = f!)}>{f}</button
|
||||
>{/each}
|
||||
|
||||
@@ -1356,9 +1356,9 @@
|
||||
<ul>
|
||||
{#if inputs.prompt}<li>
|
||||
画面描述 · {inputs.prompt.required ? '必填' : '可选'}
|
||||
</li>{/if}{#each inputs.slots as slot}<li>
|
||||
</li>{/if}{#each inputs.slots as slot (slot.inp.nodeId)}<li>
|
||||
{slot.label} · {slot.inp.required ? '必填' : '可选'}
|
||||
</li>{/each}{#each inputs.lists as list}<li>
|
||||
</li>{/each}{#each inputs.lists as list (list.nodeId)}<li>
|
||||
{list.label} · {list.required ? '必填' : '可选'}{list.max
|
||||
? ',最多 ' + list.max + ' 个'
|
||||
: ''}
|
||||
@@ -1449,7 +1449,7 @@
|
||||
id="comfy-endpoint"
|
||||
bind:value={paramEndpoint}
|
||||
>{#if !endpoints.length}<option value="">尚未配置服务</option
|
||||
>{/if}{#each endpoints as ep}<option value={ep.id}>{ep.name}</option
|
||||
>{/if}{#each endpoints as ep (ep.id)}<option value={ep.id}>{ep.name}</option
|
||||
>{/each}</select
|
||||
><a href={resolve('/connections')}>配置或检查连接 ↗</a>
|
||||
</div>
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
recentOnly = false;
|
||||
}}><span>全部工具</span><small>{metas.length}</small></button
|
||||
>
|
||||
{#each categories as cat}<button
|
||||
{#each categories as cat (cat)}<button
|
||||
class:active={category === cat}
|
||||
onclick={() => {
|
||||
category = cat;
|
||||
@@ -218,9 +218,9 @@
|
||||
>{/if}{#if source === 'local'}<select aria-label="筛选创作任务" bind:value={usage}
|
||||
><option value="all">所有创作任务</option>{#each [...new Set(metas
|
||||
.map((m) => m.usage)
|
||||
.filter(Boolean))] as u}<option value={u!}>{usageLabel(u!)}</option>{/each}</select
|
||||
.filter(Boolean))] as u (u)}<option value={u!}>{usageLabel(u!)}</option>{/each}</select
|
||||
><select aria-label="筛选模型家族" bind:value={family}
|
||||
><option value="all">全部模型</option>{#each families as f}<option value={f}>{f}</option
|
||||
><option value="all">全部模型</option>{#each families as f (f)}<option value={f}>{f}</option
|
||||
>{/each}</select
|
||||
>{/if}<span>{source === 'local' ? filtered.length : cloudModels.length} 个结果</span>
|
||||
</div>
|
||||
@@ -231,7 +231,7 @@
|
||||
<p>使用已配置模型,在智能体或画布中创作。自定义多媒体接口与技能可在设置中管理。</p>
|
||||
<a href={resolve('/canvas')} class="a-btn primary">打开创作画布 ↗</a>
|
||||
</div>
|
||||
{#each cloudModels as profile}<article class="workflow-card">
|
||||
{#each cloudModels as profile (profile.id)}<article class="workflow-card">
|
||||
<div class="family">{profile.model}<span>已配置模型</span></div>
|
||||
<h3>{profile.name}</h3>
|
||||
<a href={resolve('/agents')} class="tool-link">交给智能体创作 ↗</a>
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
</div>{/if}
|
||||
{#if dock}<div class="media-summary" class:has-slots={hasSlots}>
|
||||
{#if hasSlots}
|
||||
{#each ds.slots.slice(0, 3) as slot}<button
|
||||
{#each ds.slots.slice(0, 3) as slot (slot.inp.nodeId)}<button
|
||||
class="media-token"
|
||||
onclick={openMedia}
|
||||
aria-label={'设置' + slot.label}
|
||||
@@ -313,7 +313,7 @@
|
||||
onchange={(e) => onPickEndpoint(e.currentTarget.value)}
|
||||
>
|
||||
{#if !endpoints.length}<option value="">尚未配置服务</option>{/if}
|
||||
{#each endpoints as ep}<option value={ep.id}>{ep.name}</option
|
||||
{#each endpoints as ep (ep.id)}<option value={ep.id}>{ep.name}</option
|
||||
>{/each}
|
||||
</select><a href={resolve('/connections')} target="_blank" rel="noreferrer"
|
||||
>配置或检查连接 ↗</a
|
||||
@@ -326,7 +326,7 @@
|
||||
>✦ {endpointName}⌄</button
|
||||
>{#each commonInputs
|
||||
.filter((i) => i !== ds.height)
|
||||
.slice(0, 3) as inp}<button
|
||||
.slice(0, 3) as inp (inp.nodeId)}<button
|
||||
class="parameter"
|
||||
onclick={(e) => openParameter(inp, e.currentTarget)}
|
||||
>{inp.label}: {String(
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
];
|
||||
</script>
|
||||
|
||||
{#each pending.filter((item) => kind === "all" || item.kind === kind) as item}<article
|
||||
{#each pending.filter((item) => kind === "all" || item.kind === kind) as item (item.name)}<article
|
||||
class="mg-card pending"
|
||||
>
|
||||
<div class="mg-row">
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
>AIGC{#if expanded}<small>创作工作台</small>{/if}</a
|
||||
>
|
||||
<nav aria-label="主要导航">
|
||||
{#each mainNav as item}<a
|
||||
{#each mainNav as item (item.id)}<a
|
||||
class="nav-item reference-option"
|
||||
use:spotlight
|
||||
href={resolve(item.href)}
|
||||
@@ -202,7 +202,7 @@
|
||||
>{/each}
|
||||
</nav>
|
||||
<nav class="management" aria-label="管理导航">
|
||||
{#each NAV_MANAGE as item}<a
|
||||
{#each NAV_MANAGE as item (item.id)}<a
|
||||
class="nav-item reference-option"
|
||||
use:spotlight
|
||||
href={resolve(item.href)}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
role="group"
|
||||
aria-label="外观主题"
|
||||
>
|
||||
{#each THEMES as item}
|
||||
{#each THEMES as item (item.id)}
|
||||
<button
|
||||
class="choice"
|
||||
class:selected={$theme === item.id}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="block">
|
||||
<span class="k">{t('scriptDrawer.characters')}</span>
|
||||
<div class="chips">
|
||||
{#each scene.characters as c}
|
||||
{#each scene.characters as c (c.id)}
|
||||
<span class="chip">{c.name}</span>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</script>
|
||||
|
||||
<ol class="stepper" data-testid="workbench-stepper">
|
||||
{#each ORDER as key, i}
|
||||
{#each ORDER as key, i (key)}
|
||||
{@const stage = stages.find((s) => s.stage_key === key)}
|
||||
{@const state = stage ? stateOf(stage) : 'todo'}
|
||||
{@const open = stage ? unlocked(stages, key) : i === 0}
|
||||
|
||||
@@ -635,7 +635,7 @@
|
||||
catFilter = "all";
|
||||
}}>全部<small>{rows.length}</small></button
|
||||
>
|
||||
{#each [["image", "图片生成"], ["video", "视频生成"]] as [value, label]}
|
||||
{#each [["image", "图片生成"], ["video", "视频生成"]] as [value, label] (value)}
|
||||
<button
|
||||
class="mg-filter"
|
||||
class:on={kindFilter === value}
|
||||
@@ -647,7 +647,7 @@
|
||||
></button
|
||||
>
|
||||
{/each}
|
||||
{#each categories.filter((c) => c !== "image" && c !== "video") as c}<button
|
||||
{#each categories.filter((c) => c !== "image" && c !== "video") as c (c)}<button
|
||||
class="mg-filter"
|
||||
class:on={catFilter === c}
|
||||
onclick={() => {
|
||||
@@ -665,7 +665,7 @@
|
||||
onclick={() => (familyFilter = "all")}
|
||||
>全部模型<small>{rows.length}</small></button
|
||||
>
|
||||
{#each families as f}<button
|
||||
{#each families as f (f)}<button
|
||||
class="mg-filter"
|
||||
class:on={familyFilter === f}
|
||||
onclick={() => (familyFilter = f)}
|
||||
@@ -733,7 +733,7 @@
|
||||
/></label
|
||||
>
|
||||
<div class="mg-seg workflow-state" aria-label="工作流状态">
|
||||
{#each [["all", "全部"], ["enabled", "可运行"], ["pending", "待配置"], ["problem", "有问题"]] as [value, label]}<button
|
||||
{#each [["all", "全部"], ["enabled", "可运行"], ["pending", "待配置"], ["problem", "有问题"]] as [value, label] (value)}<button
|
||||
class:on={statusFilter === value}
|
||||
aria-pressed={statusFilter === value}
|
||||
onclick={() => (statusFilter = value as typeof statusFilter)}
|
||||
@@ -906,7 +906,7 @@
|
||||
});
|
||||
}}
|
||||
><option value="">待确认</option
|
||||
>{#each WORKFLOW_USAGES as u}<option value={u}
|
||||
>{#each WORKFLOW_USAGES as u (u)}<option value={u}
|
||||
>{usageLabel(u)}</option
|
||||
>{/each}</select
|
||||
><Button
|
||||
@@ -927,7 +927,7 @@
|
||||
<h3>输入映射 <span class="mg-dim">· 节点 → 创作台控件</span></h3>
|
||||
{#if fullPending[row.id]}<p class="mg-dim">
|
||||
正在读取输入…
|
||||
</p>{:else if full}{#each full.input_schema as input}<div
|
||||
</p>{:else if full}{#each full.input_schema as input (input.nodeId)}<div
|
||||
class="mg-map"
|
||||
>
|
||||
<span class="a"
|
||||
@@ -952,7 +952,7 @@
|
||||
endpointId: e.currentTarget.value || null,
|
||||
})}
|
||||
><option value="">跟随默认连接</option
|
||||
>{#each endpoints as ep}<option value={ep.id}>{ep.name}</option
|
||||
>{#each endpoints as ep (ep.id)}<option value={ep.id}>{ep.name}</option
|
||||
>{/each}</select
|
||||
><Switch
|
||||
checked={row.is_enabled}
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
></a
|
||||
>{/if}
|
||||
<section class="refract-tools" aria-label="创作工具">
|
||||
{#each TOOLS as tool}
|
||||
{#each TOOLS as tool (tool.href)}
|
||||
<a href={resolve(tool.href)}
|
||||
><span class="tool-icon"
|
||||
><Icon
|
||||
|
||||
@@ -1396,7 +1396,7 @@
|
||||
: null,
|
||||
)}
|
||||
><option value="">不关联项目</option
|
||||
>{#each $linkableProjectsQuery.data ?? [] as project}<option
|
||||
>{#each $linkableProjectsQuery.data ?? [] as project (project.id)}<option
|
||||
value={project.id}>{project.title}</option
|
||||
>{/each}</select
|
||||
></label
|
||||
@@ -1462,7 +1462,7 @@
|
||||
>
|
||||
</div>{/snippet}
|
||||
<div class="style-grid">
|
||||
{#each agentStyles as style, i}<button
|
||||
{#each agentStyles as style, i (style.name)}<button
|
||||
class="style-card"
|
||||
class:selected={styleDraft === i}
|
||||
aria-pressed={styleDraft === i}
|
||||
@@ -1502,7 +1502,7 @@
|
||||
><b>自由发挥</b><small>本次不指定额外技能。</small></button
|
||||
>{#each applicableSkills.filter((s) => (skillLabel(s.dir) + s.description)
|
||||
.toLowerCase()
|
||||
.includes(skillSearch.toLowerCase())) as skill}<button
|
||||
.includes(skillSearch.toLowerCase())) as skill (skill.dir)}<button
|
||||
class="skill-choice"
|
||||
class:selected={skillDraft === skill.dir}
|
||||
aria-pressed={skillDraft === skill.dir}
|
||||
@@ -1532,7 +1532,7 @@
|
||||
aria-pressed={!modelDraft}
|
||||
onclick={() => (modelDraft = '')}
|
||||
><b>✦ 默认大模型</b><small>使用项目设置中的默认模型连接。</small></button
|
||||
>{#each $settingsQuery.data?.llm_profiles ?? [] as model}<button
|
||||
>{#each $settingsQuery.data?.llm_profiles ?? [] as model (model.id)}<button
|
||||
class="model-choice"
|
||||
class:selected={modelDraft === model.id}
|
||||
aria-pressed={modelDraft === model.id}
|
||||
@@ -1855,7 +1855,7 @@
|
||||
bind:value={resultProject}
|
||||
disabled={resultBusy}
|
||||
><option value={null}>请选择项目</option
|
||||
>{#each $linkableProjectsQuery.data ?? [] as project}<option
|
||||
>{#each $linkableProjectsQuery.data ?? [] as project (project.id)}<option
|
||||
value={project.id}>{project.title}</option
|
||||
>{/each}</select
|
||||
></label
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<ManagementPage active="connections" title="模型与连接">
|
||||
{#snippet tools()}<div class="mg-seg model-tabs" aria-label="模型类型">
|
||||
{#each [["comfy", "ComfyUI 连接"], ["llm", "大语言模型"], ["image", "图片模型 · 后续"], ["video", "视频模型 · 后续"]] as [value, label]}<button
|
||||
{#each [["comfy", "ComfyUI 连接"], ["llm", "大语言模型"], ["image", "图片模型 · 后续"], ["video", "视频模型 · 后续"]] as [value, label] (value)}<button
|
||||
class:on={tab === value}
|
||||
aria-pressed={tab === value}
|
||||
onclick={() =>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
<ManagementPage active="library" title="素材库" scene="gold">
|
||||
{#snippet tools()}<div class="mg-seg asset-tabs" aria-label="素材类型">
|
||||
{#each [["all", "全部"], ["image", "图片"], ["video", "视频"]] as [value, label]}<button
|
||||
{#each [["all", "全部"], ["image", "图片"], ["video", "视频"]] as [value, label] (value)}<button
|
||||
class:on={filter === value}
|
||||
aria-pressed={filter === value}
|
||||
onclick={() => (filter = value as typeof filter)}>{label}</button
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
<section class="mg-field">
|
||||
<h3>任务队列 <span class="mg-tag">规则说明</span></h3>
|
||||
<div class="queue-fields">
|
||||
{#each QUEUE_FIELDS.filter((f) => f.key === "queue_concurrency" || f.key === "queue_poll_timeout_sec") as f}<div
|
||||
{#each QUEUE_FIELDS.filter((f) => f.key === "queue_concurrency" || f.key === "queue_poll_timeout_sec") as f (f.key)}<div
|
||||
class="queue-row"
|
||||
>
|
||||
<label for={"setting-" + f.key}>{t(f.labelKey)}</label>
|
||||
@@ -480,7 +480,7 @@
|
||||
<div class="advanced-grid">
|
||||
<section class="mg-field">
|
||||
<h3>队列高级选项</h3>
|
||||
{#each QUEUE_FIELDS.filter((f) => f.key !== "queue_concurrency" && f.key !== "queue_poll_timeout_sec") as f}{@render numberField(
|
||||
{#each QUEUE_FIELDS.filter((f) => f.key !== "queue_concurrency" && f.key !== "queue_poll_timeout_sec") as f (f.key)}{@render numberField(
|
||||
s,
|
||||
f,
|
||||
)}{/each}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
|
||||
<ManagementPage active="tasks" title="生成任务">
|
||||
{#snippet tools()}<div class="mg-seg task-tabs" aria-label="任务筛选">
|
||||
{#each [["all", "全部"], ["active", "进行中"], ["failed", "失败"], ["image", "图片"], ["video", "视频"]] as [value, label]}<button
|
||||
{#each [["all", "全部"], ["active", "进行中"], ["failed", "失败"], ["image", "图片"], ["video", "视频"]] as [value, label] (value)}<button
|
||||
class:on={filter === value}
|
||||
aria-pressed={filter === value}
|
||||
onclick={() => (filter = value as Filter)}>{label}</button
|
||||
@@ -204,7 +204,7 @@
|
||||
<div class="mg-layout">
|
||||
<aside class="mg-side" aria-label="任务来源">
|
||||
<div class="mg-label">来源</div>
|
||||
{#each [["all", "全部任务"], ["standalone", "创作台"], ["project", "项目"]] as [value, label]}<button
|
||||
{#each [["all", "全部任务"], ["standalone", "创作台"], ["project", "项目"]] as [value, label] (value)}<button
|
||||
class="mg-filter"
|
||||
class:on={sourceFilter === value}
|
||||
onclick={() => (sourceFilter = value)}
|
||||
@@ -290,7 +290,8 @@
|
||||
</div>
|
||||
{#if job.output_paths?.length}<div class="mg-field">
|
||||
<h3>产出 · {job.output_paths.length}</h3>
|
||||
{#each job.output_paths as path}<div class="task-output">
|
||||
<!-- Output paths may repeat. Keep positional video DOM reuse so playback state stays with its original slot. -->
|
||||
{#each job.output_paths as path, i (i)}<div class="task-output">
|
||||
{#if job.kind === "image"}<img
|
||||
src={assetUrl(path)}
|
||||
alt={wfName(job)}
|
||||
|
||||
Reference in New Issue
Block a user