Skip to content

[fix] canvas: keep a regenerated node busy until its new result shows - #416

Merged
princepride merged 1 commit into
mainfrom
fix/regenerate-keeps-busy
Nov 20, 2026
Merged

princepride merged 1 commit into
mainfrom
fix/regenerate-keeps-busy

Conversation

@princepride

@princepride princepride commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

修复图片重新生成时旧图闪回的问题:现在节点会一直保持"收尾中"状态,直到新图真正显示出来。

问题。 重新生成时,生成任务一成功,节点的忙碌遮罩就结束了。但画布这时还在下载新结果,节点要等 currentAsset 的内容读完后,才会更新 src 和 backendAssetId。这段空档里遮罩已经消失,露出来的是旧图,过一会儿才切换成新图。2K 图片要下载的数据多,空档也更明显。

改动。

  • creationJobs:成功的生成任务新增 deliveredAssetId。仅当后端已把该任务的结果设为原节点的当前内容(currentAsset(snapshot, originItem) 等于结果素材)时才填写。
  • jobActivities:新增可选参数 nodes。当任务的 deliveredAssetId 与画布节点当前的 data.backendAssetId 不一致时,该节点保持 finishing 阶段,复用工具任务已有的"收尾中"文案和遮罩。
  • 以下情况不会进入该阶段:
    • 节点不在画布上;
    • 结果没有成为当前内容,比如只作为候选;
    • 节点之后被替换或编辑,后端认定的当前内容已经不是这个结果。
  • useWorkspaceRuntime:传入 doc.nodes,并把它加进依赖数组。

生成过程中遮罩下仍显示旧图,这是现有设计,本 PR 不改变。

Linked issue

  • 无对应 issue

Labels

  • Labels applied(type:bug、area:canvas)

Test plan

本地 worktree 基于 main(bf473614),Node.js 24。

检查 命令 结果
前端单测 node --test tests/*.test.ts 935 passed。新增:deliveredAssetId 只在结果为原节点当前内容且任务成功时给出;节点显示旧素材时为 finishing,显示新素材、节点不存在或没有已交付结果时没有活动
类型检查 tsc --noEmit 通过
静态检查 python -m pre_commit run --from-ref upstream/main --to-ref HEAD 通过
  • Left to CI: Release checks。

Evidence that it works

在本地部署上,用无头 Chromium 对一个图片节点(MiniMax-H3-Image,自部署)做了生成和重新生成,每 150ms 记录节点 <img> 的 src 和忙碌遮罩:

遮罩消失 新图显示 旧图闪回
修复前 2.59 s 2.74 s 0.15 s
修复后 2.74 s 2.74 s 无

测试用的是小图,闪回只有 0.15 秒;在一个有 500 条提交记录、使用 2K 图片的真实项目里,用户能明显看到旧图闪回。

  • Media attached(截图稍后补充)

Provider verification

  • 验证时调用的是本机自部署的 MiniMax-H3-Image(vLLM-Omni),没有调用付费服务。单测不调用任何模型服务。

Bilingual UI

  • 没有新增或修改界面文案,复用已有的 generation.activity.finishing。

🤖 Generated with Claude Code

When a regeneration succeeded, the busy overlay ended with the job while the
canvas was still downloading the new media, so the previous image reappeared
until the new one loaded (long for 2K images). A succeeded job now records
the result asset its origin node has adopted, and the node stays in the
finishing phase until the canvas displays that asset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:canvas Canvas, nodes and direct manipulation type:bug Something is broken labels Nov 20, 2026
@princepride
princepride merged commit 0b83f97 into main Nov 20, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant