editor: stabilize floorplan and camera interactions#545
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>
Stream live headings in 2D and 3D, and defer restoring the compositor rotation preview until the committed floor-plan state is ready to paint so pointer release cannot snap back.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc86bdd. Configure here.
|
|
||
| useLayoutEffect(() => { | ||
| flushFloorplanRotationPresentationRestore(pendingFloorplanRotationRestoreRef) | ||
| }) |
There was a problem hiding this comment.
Rotation restore needs re-render
Medium Severity
Replacing synchronous SVG transform cleanup in commitFloorplanRotation with queueFloorplanRotationPresentationRestore plus a layout-effect flush means the preview transform is only cleared when React re-renders. If both setFloorplanUserRotationDeg and setViewport no-op because values are unchanged, no render runs and the queued restore never flushes, leaving compositor rotation styles on the SVG.
Reviewed by Cursor Bugbot for commit bc86bdd. Configure here.


What does this PR do?
How to test
bun test packages/editor/src/components/editor-2d/floorplan-render-context.test.ts packages/editor/src/components/editor-2d/renderers/floorplan-registry-layer.test.ts packages/editor/src/store/use-interaction-scope.test.ts packages/nodes/src/wall/floorplan-affordances.test.ts.bun run check-types,bun run check, andbun run build.Screenshots / screen recording
To be added — this PR contains visual and interactive editor fixes.
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Touches interaction scope, floor plan navigation/camera sync, and rendering paths used on every edit; regressions could affect reshape tools, split view, or 2D/3D camera alignment.
Overview
Improves 2D floor plan rotation and 2D↔3D navigation so the compass and camera stay aligned from first load, including sub-degree headings and live updates while the floor plan panel is hidden. Camera pose publishing now runs on initial mount and when programmatic interpolation ends, and the sync bridge no longer quantizes azimuth to whole degrees or defers 3D→2D heading until the panel is visible.
Rotation presentation uses an overscan view box and larger background rect so rotated plans do not show white corners; the SVG allows overflow, compass rotation is driven imperatively each frame, and CSS transform preview is cleared only after React commits rotation state.
Interaction scope gains a
driveronreshaping(toolvsfloorplan). Floor plan affordances setfloorplansoToolManagerskips duplicate 3D boundary/endpoint/curve tools during 2D handle drags; wall curve commits are covered by a new affordance test.Floor plan zoom scale is exposed via
subscribe+useFloorplanStaticUnitsPerPixel(useSyncExternalStore), with scale updates inuseLayoutEffect, so handle radii and overlays re-render when zoom changes without prop-drillingunitsPerPixelthrough registry entries.Viewer: merged outline pass no longer disables during camera dragging, so selection outlines stay visible while orbiting/panning/zooming.
Reviewed by Cursor Bugbot for commit bc86bdd. Bugbot is set up for automated code reviews on this repo. Configure here.