fix: 撤销/重做时补发 NODE_PROPERTIES_CHANGE,支持 Vue3 自定义节点属性回滚渲染#2380
Draft
fix: 撤销/重做时补发 NODE_PROPERTIES_CHANGE,支持 Vue3 自定义节点属性回滚渲染#2380
Conversation
|
Co-authored-by: CraneReturn <127602190+CraneReturn@users.noreply.github.com>
Co-authored-by: CraneReturn <127602190+CraneReturn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix node properties change detection on undo operation
fix: 撤销/重做时补发 NODE_PROPERTIES_CHANGE,支持 Vue3 自定义节点属性回滚渲染
Mar 2, 2026
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.
setProperties触发的属性更新可被NODE_PROPERTIES_CHANGE监听,但undo/redo通过graphDataToModel回放历史时会重建 model,未走setProperties链路,导致 Vue3 自定义节点无法感知属性回滚并更新样式。核心修复:在历史回放后补齐属性变更事件
LogicFlow中新增emitNodePropertiesChange(preGraphData, curGraphData)。properties,仅对发生变化的节点发出EventType.NODE_PROPERTIES_CHANGE。id / keys / preProperties / properties。接入点:仅修改 undo/redo 路径
undo()/redo()在执行graphDataToModel(...)前抓取当前图数据快照。emitNodePropertiesChange(...),确保监听NODE_PROPERTIES_CHANGE的自定义节点在撤销/重做时也能收到属性变化通知。覆盖用例:补充历史回放事件行为
packages/core/__tests__/logicflow.test.ts增加用例:setProperties后执行undo(),应收到属性从新值回退的事件;redo(),应收到属性恢复的事件。Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.