Skip to content

editor: fix preset double-commit ghosts, show compass in all view modes#393

Merged
wass08 merged 2 commits into
mainfrom
fix/preset-double-commit
Jun 10, 2026
Merged

editor: fix preset double-commit ghosts, show compass in all view modes#393
wass08 merged 2 commits into
mainfrom
fix/preset-double-commit

Conversation

@wass08

@wass08 wass08 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Two placement/navigation fixes:

  • Guard preset placement against double commit. A single physical click reached MoveRegistryNodeTool.commitAtCursor twice: node clicks (slab:click, …) are synthesized on pointerup (use-node-events), while grid:click rides the native click event from a canvas DOM listener (use-grid-events) that deliberately ignores stopPropagation — and the tool's effect stays subscribed until React re-renders after the first commit exits move mode. The second pass found the fresh draft already deleted, took the orphan re-create path, and minted a permanent hidden ghost copy (plus a second placement SFX, plus abandoning the re-armed repeat-placement clone as another ghost). An early return on the existing committed flag stops the duplicate pass.
  • Compass visible in 2D / 3D / split. The floorplan compass now portals onto the always-visible viewer-area container (same bottom-left spot) instead of living inside the floorplan pane, which is display:none in 3D. The 2D/3D navigation poses already sync through navigationSyncPose, so the needle tracks the 3D camera and align-to-north rotates it — no behavior rewrite needed.

How to test

  1. bun dev, open a project with a room (floor slab), and click a shelf preset in the catalog to arm placement.
  2. Click once inside the room to place it: the placement sound plays once, one shelf is placed, and the scene graph shows no extra hidden copies (one armed clone for repeat placement is expected while placement stays armed; Esc removes it).
  3. Repeat-drop a few copies back to back, and also move an existing shelf across a slab — still one sound per drop.
  4. Switch view mode to 3D: the compass shows bottom-left; orbit the camera and watch the needle track. Click it — the camera rotates to face north.
  5. Check 2D and split modes: the compass sits in the same place and align-to-north still straightens the floorplan.

Screenshots / screen recording

N/A — will add a quick clip if helpful; behavior is easiest to verify with the steps above (listen for the single SFX, watch the scene graph).

Checklist

  • I've tested this locally with bun dev (verified via typecheck + lint; runtime pass pending)
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

🤖 Generated with Claude Code

wass08 and others added 2 commits June 10, 2026 08:38
…k events

A single physical click reaches commitAtCursor twice: node clicks are
synthesized on pointerup (use-node-events) while grid:click rides the
native click event from a canvas DOM listener (use-grid-events) that
deliberately ignores stopPropagation. The second pass found the fresh
draft already deleted and took the orphan re-create path, minting a
hidden ghost copy, replaying the placement SFX, and abandoning the
re-armed clone as a second ghost.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The floorplan compass now portals onto the always-visible viewer area
instead of living inside the (display:none in 3D) floorplan pane. The
2D/3D navigation poses already sync through navigationSyncPose, so the
needle and align-to-north stay correct in 2d, 3d, and split alike.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
pascal 🔴 Failed Jun 10, 2026, 1:02 PM

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

@wass08 wass08 merged commit 7539387 into main Jun 10, 2026
1 of 2 checks passed
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