From 6721d2ded8892dce109f9133d2d98089de64fe8a Mon Sep 17 00:00:00 2001 From: Tanish Manku Date: Fri, 1 May 2026 01:22:14 -0700 Subject: [PATCH] PageScene: route viewport pointerup through sceneManager useViewportPointer.onPointerUp called editor.mouse_controls.onMouseUp directly. That ran the interaction state machine (gizmo end, FK toggle, selection click) but skipped editor.sceneManager.onMouseUp, which is the only thing that calls check_scene_for_updates. Result: transform, deletion, and userdata edits (color, lock, visibility) never made it into the undo stack, so Ctrl+Z found nothing to undo. Pre-refactor, SceneManager.attachEventListeners attached a window-level mouseup that went through SceneManager.onMouseUp; the canvas-scoped hook lost the same pass-through. Calling sceneManager.onMouseUp here preserves all the mouse_controls behavior (it forwards internally) and restores the post-mouseup undo capture. --- .../app/src/pages/PageScene/hooks/useViewportPointer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/apps/artcraft/app/src/pages/PageScene/hooks/useViewportPointer.ts b/frontend/apps/artcraft/app/src/pages/PageScene/hooks/useViewportPointer.ts index a0b751736b..a03f084f3d 100644 --- a/frontend/apps/artcraft/app/src/pages/PageScene/hooks/useViewportPointer.ts +++ b/frontend/apps/artcraft/app/src/pages/PageScene/hooks/useViewportPointer.ts @@ -43,7 +43,10 @@ export const useViewportPointer = ( }; const onPointerUp = (e: PointerEvent) => { - editor.mouse_controls?.onMouseUp(e); + // Route through sceneManager so check_scene_for_updates fires and + // transforms / deletions / userdata edits get pushed onto the undo + // stack. mouse_controls.onMouseUp is invoked from inside. + editor.sceneManager?.onMouseUp(e as unknown as MouseEvent); }; const onClick = (_e: MouseEvent) => {