fix(pipeline): 提取闸门按「是否走过正式提取步」显隐,而非 script_entities 存在性

脚本生成期有时也会吐 entities(就是那个不稳的旧来源),若按 script_entities 存在性判断,
闸门会被误隐藏、用户看不到三按钮。改为提取步落库时打 metadata.entities_extracted 标记,
前端据此显隐:没走过正式提取 → 盖蒙版露三按钮;走过 → 露卡片。「重新提取」按钮在有实体或
有资产时显示(老项目也能重提)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-19 18:04:45 +08:00
co-authored by Claude Opus 4.8
parent de29449a76
commit 69163a8f7f
3 changed files with 13 additions and 5 deletions
+5 -5
View File
@@ -2525,11 +2525,11 @@ export function PipelinePage(props: {
|| assetUrl(productCover); // 商品卡显示商品主图,三视图在右侧面板
const triViewGen = `${productName} 商品三视图,从左到右:正面 / 侧面 / 背面,统一光照,白色背景,16:9`;
const runProductTri = () => { setTriPanelOpen(true); setTriPreviewId(null); void genBaseAsset("product", triViewGen, undefined, "tri:product"); };
// 实体提取闸门:进资产趴还没提取(无 script_entities)且没生成任何基础资产 → 盖蒙版 + 三按钮,不自动花钱
const seList = project.metadata?.script_entities;
const extracted = Array.isArray(seList) && seList.length > 0;
// 实体提取闸门:没走过正式提取步(entities_extracted)且没生成任何基础资产 → 盖蒙版 + 三按钮,不自动花钱
// 用 entities_extracted 标记而非 script_entities 存在性:脚本生成期也可能吐过不稳的 entities,那不算正式提取。
const entitiesExtracted = project.metadata?.entities_extracted === true;
const hasAnyAsset = KIND_ORDER.some((k) => groupsByKind(k).length > 0);
const gateVisible = extractState === "running" || (!extracted && !hasAnyAsset);
const gateVisible = extractState === "running" || (!entitiesExtracted && !hasAnyAsset);
return (
<section className="stage active" data-stage-pane="2">
{gateVisible && (
@@ -2587,7 +2587,7 @@ export function PipelinePage(props: {
<strong className="mono">// 人物 +¥0.20/张</strong>
<strong className="mono">// 场景 +¥0.15/张</strong>
<span style={{ color: "var(--black-alpha-48)" }}>()</span>
{extracted && (
{(entitiesExtracted || hasAnyAsset) && (
<button type="button" className="btn btn-ghost btn-sm eg-reextract" disabled={extractState === "running"} data-stop onClick={() => void runExtract("only")}>
{extractState === "running" ? "提取中…" : "重新提取角色 / 场景"}
</button>