Files
editor/packages
Wassim SAMADandClaude Opus 4.7 713ef5009e Floor-plan registry: snap, real-SVG move, commit on pointerup, placement events
Four issues in one pass:

1. Move snaps to grid

   MoveOverlay's cursor is now snapped via snapPointToGrid([m.x, m.y],
   GRID_STEP=0.5). Matches the 3D shelf tool's placement step so 2D
   and 3D placement feel identical.

2. Move translates the actual rendered SVG, not a ghost

   MoveOverlay no longer portals a 50%-opacity ghost. Instead it finds
   the rendered [data-node-id] <g> inside the floor-plan scene and sets
   its `transform` attribute imperatively each pointermove. The inner
   group's translate(px pz) rotate(deg) stays untouched — the outer
   transform composes as a pure delta. Same "smooth move" pattern as
   the 3D MoveRegistryNodeTool: no React re-renders, no zundo bloat,
   the actual shape follows the cursor with full fidelity.

3. Click commits the position (previously did nothing)

   Switched from `window click` (with capture + composedPath check)
   to `window pointerup`. Pointerup fires reliably regardless of
   click-vs-drag semantics in the floor-plan panel's pointer-down
   handlers (which can preventDefault on certain modes and suppress
   the synthesized click). Target check uses
   `target.closest('[data-floorplan-scene]')` instead of composedPath
   for cross-browser SVG reliability.

4. Clicking in floor plan with shelf tool active creates a shelf

   Root cause: `isFloorplanGridInteractionActive` is a hardcoded OR of
   build/move modes that doesn't include registry kinds, so the panel
   never emits `grid:click` / `grid:move` for them. Shelf tool listens
   on those events; without them, clicks were silently dropped.

   Fix: new `isRegistryToolBuildActive` derived from
   `mode === 'build' && tool != null && nodeRegistry.has(tool)` — added
   to the OR chain. Future Phase 5 kinds (fence, item, etc.) inherit
   floor-plan placement automatically the moment they register a tool.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 11:35:15 -04:00
..
2026-01-21 10:03:29 +09:00
2026-02-05 08:35:09 +09:00
2026-02-26 22:09:40 -05:00