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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1f790d3. Configure here.
| 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.


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
High Risk
Touches roof schema, scene migration, CSG/dormer geometry, and placement raycasting—areas that affect saved scenes and structural editing correctness.
Overview
Adds
conicalas a roof segment type with mesh/surface/print support, optionalRoofNode.supportfor level vs roof-surface mounting, andresolveConicalRoofPlacement(auto / ground / roof). The roof tool draws circular footprints, cycles placement with P, and tints ghosts when roof-only placement fails.Dormers move from inline parametric windows to
WindowNodechildren on wall faces (with scene load migration and sidebar tree expansion). CSG and cuts use hosted window geometry;shedHighSidecontrols shed pitch direction.Lean-to schema grows richer hosting (
hostKind, slab edges, conical base),omittedPostSlotswhen managed posts are deleted, and handleconnectionSnap(Alt bypass) for structural edge joining. Roof overlap logic treats mounted conicals so hosts clip towers in plan.Editor / UX: orthographic pointer rays no longer drift off-cursor; item placement rotation stays aligned on parent-hosted surfaces; registry tools get
isCameraDraggingand a widerRegistryToolProvider; read-only scenes hide mutating chrome; Delete mode removes floorplan picks; Build tab roof-feature tiles only highlight the matching accessory (not the plain roof tool). Keyboard R/T defer to lean-to and item placement tools.Reviewed by Cursor Bugbot for commit 1f790d3. Bugbot is set up for automated code reviews on this repo. Configure here.