UI编辑器撤销回退功能 #261
Reference in New Issue
Block a user
Delete Branch "feat/ui-editor-edit-history"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
整理已有的 UI树的改变操作, 把其中的高频改变(如拖动, 颜色选取) 改为最后时提交
撤销和回退的实现:
简单地对整个树进行快照
close #260
Genarrative 自动审查(head sha:
e4680d6f7013f06739819da15d92535ebe87c743)P2 — 批量绑定产生多个撤销步骤
文件:
apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts:1031bindComponents是一次用户触发的批量绑定操作,但每个 batch 都调用editor.replaceState(current);replaceState默认会把每次调用都压入 undo 栈并清空 redo 栈。因此素材超过一个 batch 时,点击一次“绑定组件”会产生多个撤销步骤,撤销一次只能回退最后一个 batch,甚至可能达到 100 条历史上限而无法恢复到操作前的完整状态。建议整个批处理结束后只提交一次历史快照(中间调用使用history: 'skip',最后一次使用默认记录)。本次审查 head sha:
e4680d6f7013f06739819da15d92535ebe87c743。发现 1 个非阻塞问题,已通过 PR 总评论回写(ID 3255)。bindComponents每个 batch 都调用editor.replaceState(current),而replaceState默认记录历史。因此一次批量绑定会产生多个撤销步骤;请在批处理期间使用history: 'skip',最后统一记录一次。本次审查 head sha:
9fd160efc5fa5f2b6ea8db041f6b0c92168d7898。已检查该 head 相对 base 的代码变更,并运行 UI 编辑器相关测试(15/15 通过)及 ai-game-creator-shell typecheck(通过)。未发现明确问题。本次审查 head sha: 。
已检查完整 diff,并运行 UI 编辑器相关测试(15/15 通过)及 ai-game-creator-shell typecheck(通过)。
未发现明确问题。
本次审查 head sha:
51b7d51d019855c4b64b771cc9eb1d24a2ee668d。已检查该 head 相对 base
d5e05d79fed5af57f7afa44d2916992487aff0ed的完整 diff(12 个文件),并结合现有 UI 编辑器代码、测试和配置审查;已运行 UI 编辑器相关测试(15/15 通过)及ai-game-creator-shelltypecheck(通过)。未发现明确问题。
本次审查未发现明确问题。
本次审查 head sha:
b7641f94b724fafe3aca0a84727cac82696a1af8。未发现明确问题。