editor: fix roof and placement previews - #718
Conversation
Items (e.g. solar panels) can now be placed on sloped roof surfaces. The placement system computes euler rotation from the roof surface normal so items sit flush on the slope instead of going inside. - Add roofStrategy to placement-strategies with enter/move/click/leave - Wire roof:enter/move/click/leave events in the placement coordinator - Add calculateRoofRotation in placement-math using surface normals - Support full 3D cursor rotation for sloped surfaces - Items on roofs are parented to the level with world-space rotation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… github.com:pascalorg/editor
… github.com:pascalorg/editor
| useViewer.setState({ hoveredId: null }) | ||
| } | ||
| return | ||
| } |
There was a problem hiding this comment.
Delete mode blocked by move
High Severity
Delete handling was moved into emitCanvasNodeSelection, but the existing click-to-move early return still runs first. In delete mode, clicking an already-selected movable node picks it up for move and returns before delete can run, so that click never removes the node.
Reviewed by Cursor Bugbot for commit 1f790d3. Configure here.
| editor.tool === 'item' || | ||
| editor.tool === 'lean-to-extension') | ||
| ) | ||
| } |
There was a problem hiding this comment.
Lean-to move double rotation
Medium Severity
isToolOwnedRotation now stands down for lean-to placement, and for moving doors, windows, and items, but not for a moving lean-to-extension. The registry move tool still handles R/T, so a lean-to move with an active selection can apply both the global and move-tool rotations.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1f790d3. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0ed0424. Configure here.
| mode, | ||
| selectedCurvedWall, | ||
| setSelection, | ||
| ]) |
There was a problem hiding this comment.
Duplicate roofs on wall reselect
High Severity
In conical wall-footprint mode, selecting a curved wall always calls createConicalRoofSectorAboveWall whenever the selection is that wall. After creation the selection moves to the new segment and conicalSourceRef clears, so clicking or reselecting the same wall creates another identical roof with no idempotency check.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0ed0424. Configure here.


What does this PR do?
Improves roof, dormer, lean-to, and window placement so cursor rays, ghosts, and committed items resolve to the exact pointer location, including centered freestanding lean-to placement. Transient placement previews now use live overrides during pointer movement, snapping follows the active mode, and shared helpers stay within the correct architecture boundaries.
How to test
bun run checkandbun run check-types.bun test packages/nodes/src/lean-to-extension packages/nodes/src/dormer packages/nodes/src/window packages/editor/src/components/tools/shared/pointer-support-cap.test.ts.bun dev, place and move a freestanding lean-to, dormer window, wall window, and roof-face window; confirm the ghost and final item stay centered under the cursor and follow the same raycast position.The package builds for core, nodes, and viewer pass. The full app production build is currently blocked by the unchanged
react-scandependency's webpack export mismatch; Turbopack also hits an environment process-permission error.Screenshots / screen recording
Not included — visual verification should be performed with the interactive placement steps above.
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Large changes to roof schema, scene migration, placement raycasting, and overlap logic affect how structures are created and cloned; regressions would show up as wrong footprints, mounts, or previews rather than security issues.
Overview
Adds conical as a roof type with sector geometry, surface-height sampling, optional roof-surface mounting (
RoofSupport), and overlap rules so host roofs clip mounted cones. The standalone Build tab roof panel now picks roof type, footprint from (room / curved wall / draw), and still lists feature tiles; selecting a curved wall under conical+wall can spawn a matching sector and select it.The roof tool commits footprints from enclosed rooms (with elevation from enclosing walls), drawn rectangles or diameters, and curved-wall clicks for conical sectors; conical draw uses auto / ground / roof placement (
Pto cycle) with colored ghosts. Dormers migrate legacy inline windows to hostedWindowNodechildren with face-local placement helpers.Editor polish bundled here: orthographic pointer rays stay on the cursor line for top-surface picking; item rotation during placement updates live overrides and floor-plan preview together; linear handles gain
connectionSnap(Alt bypasses);portalTarget/ optionalvisibleon handles; polygon union no longer stitches point-touching branches into bad rings; read-only scenes hide editing chrome; dormer sidebar trees expand to window children. Rootchecksscript runs biome + types.Reviewed by Cursor Bugbot for commit 0ed0424. Bugbot is set up for automated code reviews on this repo. Configure here.