fix(combine): 继承态提示词把上游文案与参考图交给组合/连接节点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
组合节点的拼接逻辑不变。断点在「来源判定」:batchSrcText/isBatchSrc 只看节点自身 data.text,而提示词/文本节点在「继承 · 来自 上一级」时 data.text 为空 —— 组合读不到 这一路、nodeRefsOf(combine) 也把它过滤掉(组合→文本/分层节点的参考图随之丢失); 出图侧 resolveNodeTaskValues 走 own||上游,一直是通的,所以出现「能出图、组合是空的」。 - canvas-text: batchSrcText/isBatchSrc 增加可选 (edges, nodes);自身无文案时按 inheritedTextOf 同一套排序取上游第一条(提示词不拼合多路,与节点体显示一致), 只穿透 prompt/textout/relay/batch,组合/LLM/插件节点不越过;不传参保持旧行为 - 组合/连接/端口定位/画布渲染等调用点补传 edges/nodes - 测试:canvas-text 补继承态断言(多路取第一条/接管/停用/环)、plugin-style-node 补组合端到端、iwb-inherit-text 补 DOM 用例(组合行出现并跟随上游)
This commit is contained in:
1 parent
01c922d7e4
commit
9225a76895
9 files changed
+159
-27
No files matched your search
@@ -191,4 +191,25 @@ ok('两张参考图按 X 轴排序:样式节点的图跟节点位置走', () =
|
||||
assert.strictEqual(tasks[0].refs[1].value, 'https://cdn.example.com/right.png')
|
||||
})
|
||||
|
||||
// ── ⑤ 组合节点:继承态提示词的文案与图都要到位(2026-11-23)──────────────
|
||||
ok('样式 → 提示词(继承) → 组合:组合行有文案、下游拿得到参考图', () => {
|
||||
const s1 = styleNode('s1', 0, 0)
|
||||
const p1 = plainPrompt('p1', 300, 0, '')
|
||||
const c1 = { id: 'c1', type: 'combine', x: 700, y: 0, data: { sep: ', ' } }
|
||||
const nodes = [s1, p1, c1, genNode]
|
||||
const edges = [edge('s1', 'p1'), edge('p1', 'c1'), edge('c1', 'g1')]
|
||||
// 组合行:来自 p1(提示词节点本身),文案是它继承的那条(组合的拼接逻辑不改)
|
||||
const pairs = []
|
||||
for (const e of edges) if (e.to === 'c1') { const src = nodes.find((n) => n.id === e.from); pairs.push.apply(pairs, TG.combineSourcePairs(src, e, edges, nodes)) }
|
||||
assert.strictEqual(pairs.length, 1)
|
||||
assert.strictEqual(pairs[0].text, 'a 银发少女 in the rain')
|
||||
// 组合 → 下游(文本节点 / 分层节点走 nodeRefsOf)不能丢图
|
||||
assert.strictEqual(TG.nodeRefsOf(c1, edges, nodes).map((r) => r.id).join(','), 's1:ref')
|
||||
// 生成任务不变:仍是 1 个任务,文案与图都在
|
||||
const tasks = TG.buildGenerationTasksV2(genNode, nodes, edges)
|
||||
assert.strictEqual(tasks.length, 1)
|
||||
assert.strictEqual(tasks[0].text, 'a 银发少女 in the rain')
|
||||
assert.strictEqual(tasks[0].refs.length, 1)
|
||||
})
|
||||
|
||||
console.log('\nplugin-style-node: ' + passed + ' passed')
|
||||
Reference in new issue
Block a user