mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-19 08:05:20 +00:00
SelectionBridge.lockUnlockObject toggled userData.locked AND attached/detached the gizmo, but HistoryContext.setLocked only did the userData write. After Ctrl+Z the lock flag reverted but the gizmo state stayed wrong. Extract the side-effect chain (setObjectLocked + gizmo attach/detach + updateSelectedUI) into a private SelectionBridge.applyLockState helper. Both lockUnlockObject (toggle path) and the new setLockState (history-replay path) call it. Add a SceneUtils direct-set helper (setObjectLocked) so applyLockState can target a specific state instead of toggling. Wire HistoryContext.setLocked through selection.setLockState so undo of a lock toggle re-runs the gizmo attach/detach. The recordLockChange dep stays for now; it moves to the call site in a later commit when the action layer migrates to LockAction.