feat(editor): roof/stair/elevator snapping migration + no-angle footprint draft

Migrate roof/stair/elevator draft tools + the 2D floorplan move overlay off the
legacy Shift/Alt=bypass model onto mode-driven snapping (isGridSnapActive /
isMagneticSnapActive); Alt dropped (no validity gate). stair/elevator now use the
live grid step.

These three are placed as footprints, not directional draws, so the angle-lock
mode was meaningless: add NodeDefinition.snapDraftDirectional (default true; false
for roof/stair/elevator) so their draft resolves to the no-angle 'polygon' context
(grid / lines / off). snapContextOf takes an injected draftDirectionalOf, like
profileOf. Add toolHints to stair/elevator so they route through the contextual
HUD and show the snapping chip. Fix one stale Alt-bypass comment in the item
placement coordinator (#9: already force-only). +snapping-mode test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-25 12:23:00 -04:00
co-authored by Claude Opus 4.8
parent 8e9a45a9d5
commit bbf9291c2d
13 changed files with 142 additions and 48 deletions
+11
View File
@@ -986,6 +986,17 @@ export type NodeDefinition<S extends ZodObject<any>> = {
*/
snapProfile?: SnapProfile
/**
* For `structural` kinds: does drafting this kind set a DIRECTION (so the
* angle-lock snapping mode is meaningful)? Wall/fence/slab/ceiling drafting
* draws directed edges → `true` (the default). Roof/stair/elevator are placed
* as axis-aligned footprints, not directional draws → `false`, so their
* drafting uses the no-angle `polygon` snap context (grid / lines / off)
* instead of the angle-bearing `wall` context. Ignored for `item` kinds
* (their context never carries an angle lock).
*/
snapDraftDirectional?: boolean
/**
* Optional translucent preview of the node — used by the move tool to
* show where the node will land, and by the placement tool's cursor.