fix(ingest): 入队改到「结果写进节点数据」处,输出节点体本地优先 + 角标
Verify (Gitea) / gate (build · unit · facts) (push) Canceled after 6s

上一版把角标加在了 ResultImg,而它全仓没有调用点(输出节点用的是
ui-node-bodies 的 iwb-out-cell-img),所以用户看不到任何变化。

- runtime-workbench-logic.liveUpsert:每张结果写入节点数据时 enqueue(批量/恢复都走这里)
- ui-node-bodies:输出单元格优先用 ingest 的 localUrl,另加「排队中/下载中/未落地」角标
- app.js onEvent 里补 wThumbBump(),让命令式渲染的节点体跟着重绘
- 棘轮:app 8,895→8,896、Workbench 2,487→2,488
This commit is contained in:
qiqi committed 2026-12-02 12:40:06 +08:00
1 parent a409fa6206
commit 4b7dc6ee40
7 files changed
+19 -6

No files matched your search

+2
View File
@@ -239,6 +239,8 @@
const gn = baseNodes.find((n) => n.id === nodeId)
const cur = gn && Array.isArray(gn.data.result) ? gn.data.result : []
const nextResult = upsertGenerationEntry(cur, entry)
// 2026-12-02:每张结果落地就入队(这里是「结果写进节点数据」的唯一入口,批量/恢复都经过它)
try { if (global.__iwbIngest && entry && entry.url) global.__iwbIngest.enqueue({ url: entry.url, source: 'gen', w: entry.width, h: entry.height }) } catch (eI) { /* 落地失败不得影响出图 */ }
genLatest = baseNodes.map((n) => (n.id === nodeId ? { ...n, data: { ...(n.data || {}), result: nextResult } } : n))
genLatest = commitRunNodes(runWorkspaceId, genLatest)
}
+6 -1
View File
@@ -887,13 +887,18 @@
try { if (wResolveOutSrc) src = (await wResolveOutSrc(r, true)) || r.url } catch (e) { /* 回退远端 */ }
downloadUrl(src, 'image.png')
}
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: true, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '单击选中 · 双击查看原图 · 拖到画布作参考图' : '单击选中 · 双击放大(可左右切换)· 拖到画布作参考图', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onPointerDown: (e) => { e.stopPropagation(); props.onSelect && props.onSelect(node.id) }, onDragStart: (e) => { try { const u = r.url || ''; e.dataTransfer.setData('application/x-iwb-output-ref', u); e.dataTransfer.setData('text/plain', u); e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* 浏览器拒写自定义 MIME 时仍保留 text/plain */ } }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } })
const ingSt = (global.IWBImageIngestView && global.IWBImageIngestView.get(r.url)) || null
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: (ingSt && ingSt.localUrl) || wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: true, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '单击选中 · 双击查看原图 · 拖到画布作参考图' : '单击选中 · 双击放大(可左右切换)· 拖到画布作参考图', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onPointerDown: (e) => { e.stopPropagation(); props.onSelect && props.onSelect(node.id) }, onDragStart: (e) => { try { const u = r.url || ''; e.dataTransfer.setData('application/x-iwb-output-ref', u); e.dataTransfer.setData('text/plain', u); e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* 浏览器拒写自定义 MIME 时仍保留 text/plain */ } }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } })
// 下载浮层:与图库共用同一组 hover token;组件缺失时退回旧的双小按钮(单文件/旧加载顺序)
const DlOv = (typeof global !== 'undefined' && global.IWBResultDownloadOverlay) || null
const actions = DlOv ? null : el('div', { className: 'iwb-out-cell-actions' },
el('button', { className: 'iwb-btn iwb-btn-sm', title: '下载', onClick: doDownload, onPointerDown: stop }, I('download')),
)
const ingBadge = ingSt && (ingSt.status === 'queued' || ingSt.status === 'downloading')
? el('span', { className: 'iwb-out-cell-flag', key: 'ing-flag' }, ingSt.status === 'queued' ? '排队中' : '下载中')
: (ingSt && ingSt.status === 'failed' ? el('span', { className: 'iwb-out-cell-flag iwb-out-cell-flag-err', key: 'ing-flag' }, '未落地') : null)
return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' },
ingBadge,
DlOv ? el(DlOv, { key: 'ov', onDownload: doDownload, icon: I('download'), label: '下载' }, imgEl) : imgEl,
el('div', { className: 'iwb-out-cell-meta' }, (r.width || '?') + '×' + (r.height || '?')),
actions,