Skip to content

Fix/move tools#259

Merged
wass08 merged 2 commits intomainfrom
fix/move-tools
Apr 17, 2026
Merged

Fix/move tools#259
wass08 merged 2 commits intomainfrom
fix/move-tools

Conversation

@wass08
Copy link
Copy Markdown
Collaborator

@wass08 wass08 commented Apr 17, 2026

What doe

Fix broken undo/redo behavior across several move tools, and make the stair/roof move tool respect the root building's rotation.

Undo stack fixes

Six tools were writing preview state directly into the scene store during drag while temporal was paused, then resuming + writing the same final state on commit. Because the post-pause state already equalled the commit state, zundo had nothing to diff — undo became a no-op.

Applied the same "restore-then-resume" pattern used by use-draft-node.ts and move-window-tool.tsx: while still paused, restore the original state; then resume, apply the final state, and pause again. This yields exactly one clean original → final undo entry.

Fixed in:

  • MoveWallTool — also combined position + isNew metadata strip into a single updateNodes so it's one undo step.
  • MoveWallEndpointTool
  • CurveWallTool
  • MoveSlabTool
  • MoveCeilingTool

Hole editors (SlabHoleEditor, CeilingHoleEditor) were checked and are already correct — they defer to PolygonEditor, which keeps the drag in local React state and only hits the store once per commit.

Stair/roof building-rotation fix

MoveRoofTool (used for stair, stair-segment, roof, roof-segment) wrote world coordinates into the store and mesh during drag/commit for non-segment nodes. When the building had a rotation, the stair ended up offset and rotated incorrectly.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Apr 17, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed Apr 17, 2026, 9:34 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@wass08 wass08 merged commit 783b2e0 into main Apr 17, 2026
1 check failed
@wass08 wass08 deleted the fix/move-tools branch April 17, 2026 21:34
@open-pascal open-pascal mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant