Repository navigation
[fix] canvas: keep a regenerated node busy until its new result shows - #416
Merged
Merged
Conversation
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>
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
修复图片重新生成时旧图闪回的问题:现在节点会一直保持"收尾中"状态,直到新图真正显示出来。
问题。 重新生成时,生成任务一成功,节点的忙碌遮罩就结束了。但画布这时还在下载新结果,节点要等
currentAsset的内容读完后,才会更新src和backendAssetId。这段空档里遮罩已经消失,露出来的是旧图,过一会儿才切换成新图。2K 图片要下载的数据多,空档也更明显。改动。
creationJobs:成功的生成任务新增deliveredAssetId。仅当后端已把该任务的结果设为原节点的当前内容(currentAsset(snapshot, originItem)等于结果素材)时才填写。jobActivities:新增可选参数nodes。当任务的deliveredAssetId与画布节点当前的data.backendAssetId不一致时,该节点保持finishing阶段,复用工具任务已有的"收尾中"文案和遮罩。useWorkspaceRuntime:传入doc.nodes,并把它加进依赖数组。生成过程中遮罩下仍显示旧图,这是现有设计,本 PR 不改变。
Linked issue
Labels
type:bug、area:canvas)Test plan
本地 worktree 基于
main(bf473614),Node.js 24。node --test tests/*.test.tsdeliveredAssetId只在结果为原节点当前内容且任务成功时给出;节点显示旧素材时为finishing,显示新素材、节点不存在或没有已交付结果时没有活动tsc --noEmitpython -m pre_commit run --from-ref upstream/main --to-ref HEADEvidence that it works
在本地部署上,用无头 Chromium 对一个图片节点(MiniMax-H3-Image,自部署)做了生成和重新生成,每 150ms 记录节点
<img>的src和忙碌遮罩:测试用的是小图,闪回只有 0.15 秒;在一个有 500 条提交记录、使用 2K 图片的真实项目里,用户能明显看到旧图闪回。
Provider verification
Bilingual UI
generation.activity.finishing。🤖 Generated with Claude Code