feat(editor): live floor-stacking previews, unified handle system + hit areas, NaN-safe node mutations#375
Merged
Merged
Conversation
…it areas, NaN-safe node mutations Floor-placed kinds (item, shelf, spawn, column, stair) preview their slab-stacking Y offset live during placement and both move pathways, via a shared core resolver (getFloorPlacedElevation/getFloorStackedPosition; composite footprints for stairs) consumed by the tools and the viewer FloorElevationSystem. Committed positions stay canonical (no double-apply via store/live-transforms/overrides). Unifies the 3D handle system behind one drag pipeline (handles/use-handle-drag) and one visual primitive (handles/handle-arrow); the descriptor renderers and the bespoke group-rotate/wall handles delegate to them, and every handle gains a forgiving invisible hit area. Validates node mutations at the store boundary (sanitizing non-finite/out-of-range numeric fields, incl. the shelf-NaN that produced NaN geometry) and guards the viewer's shadow-light bounds against non-finite values so one bad node can't black out the scene. Composes cleanly with #373: #373 owns X/Z alignment, this owns Y floor-stack preview. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
… MRT scene pass The forgiving invisible hit-areas added with the unified handle system used a colorWrite:false + DoubleSide MeshBasicNodeMaterial with no layer, so they defaulted to SCENE_LAYER and entered the post-processing MRT scene pass — unsafe for such NodeMaterials (no color outputs for the 3-target MRT). That poisoned front/back rendering for FrontSide scene geometry, making floor-slab side walls (and other FrontSide meshes) render see-through. Setting the hit mesh to EDITOR_LAYER inside the shared InvisibleHandleHitArea covers all call sites; raycasting is unaffected (the raycaster already enables EDITOR_LAYER). Visible indicators stay on SCENE_LAYER by design. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Selecting a slab highlights its hole cutouts (indigo, matching wall openings); hovering a hole emphasizes it and clicking it opens the hole editor for manual holes or selects the owning stair/elevator for auto holes. The SlabHoleHighlights overlay portals into the slab's object (so R3F delivers pointer events and the holes inherit the slab transform). Hover/edit state lives in useEditor (hoveredHole alongside editingHole); ToolManager only opens the hole editor for manual holes. The hit box caps its top at the slab surface so the centre thickness handle keeps click priority, and the visible fill/outline render in the scene pass (SCENE_LAYER) so handles sort in front while the invisible hit mesh stays on EDITOR_LAYER (out of the MRT scene pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…olygon move + hole click-out PolygonEditor (slab boundary/edge, slab + ceiling hole, zone/site editors) handles now use the generic indigo interaction states (ARROW_COLOR idle / ARROW_HOVER_COLOR on hover+drag) instead of bespoke green/blue, matching the descriptor, wall, and group handles. The whole-polygon move grip is now the generic cross-arrow with an invisible cylinder hit area (was a sphere). Clicking any node (e.g. the slab surface outside a hole) now clears editingHole, so clicking off a hole onto the slab deselects the hole and keeps the slab selected — the hole's handles/hit mesh stopPropagation, so genuine hole interactions are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #373. Three coordinated improvements to editor interaction and robustness.
1. Live floor-stacking previews for every floor-placed kind
Item, shelf, spawn, column, and stair now preview their slab-stacking Y offset live during placement and both move pathways (cursor-follow move and the 3D move grip) — previously only the GLB
itemdid this. A single core resolver (getFloorPlacedElevation/getFloorStackedPosition, with composite footprints for stairs) is consumed by the placement/move tools and the viewerFloorElevationSystem.Canonical node positions stay at base Y — the offset is presentation-only, so undo/redo, the 2D floor-plan mirror, and live transforms never double-apply it.
2. Unified handle system + forgiving hit areas
handles/use-handle-drag) and the duplicated arrow rendering into one primitive (handles/handle-arrow). The descriptor renderers and the bespokegroup-rotate/ wall handles delegate to them (node-arrow-handles.tsxdrops ~800 lines).3. NaN-safe node mutations
thickness = NaNthat produced a NaNBoxGeometry). Unrelated schema mismatches no longer drop the whole update.Files
floor-placed-elevation.ts(+test),node-mutation-sanitize.test.ts,handles/handle-arrow.tsx,handles/use-handle-drag.ts,floor-stack-preview.ts,shelf/dimensions.ts,stair/floor-stack.ts(+test)Testing
bun run check-typesgreen acrosscore/nodes/viewer/editor.🤖 Generated with Claude Code