editor: keep room surfaces in sync with wall topology - #554
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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b010bb1. Configure here.
| if (conflictingMergeSlabIds.has(slab.id)) { | ||
| slabDemotions.push({ id: slab.id, data: { autoFromWalls: false } }) | ||
| continue | ||
| } |
There was a problem hiding this comment.
Suppression deletes restored auto surfaces
High Severity
Suppressed room signatures are excluded from matching in detected, but orphan cleanup still measures coverage against detectedAll. An auto slab or ceiling that still exists for a suppressed room—most commonly after undo restores a deleted generated surface while level autoSurfaceSuppressions remain—never rematches and is deleted as a merge orphan, so undo cannot bring the surface back.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b010bb1. Configure here.
| start: segmentStart, | ||
| end: vertices[index + 1]!, | ||
| }), | ||
| ) |
There was a problem hiding this comment.
Crossing splits mint sliver walls
Medium Severity
Interior crossing splits use a 1e-6 parametric epsilon and then create every [resolvedStart, ...splitPoints, resolvedEnd] segment with no WALL_MIN_LENGTH check. A crossing near an existing endpoint can split the host and divider into sub-minimum sliver walls, unlike endpoint splitting which rejects splits within WALL_SPLIT_ENDPOINT_EPSILON.
Reviewed by Cursor Bugbot for commit b010bb1. Configure here.
| // decision in split and 2D-only views. It clears the published chain | ||
| // start whenever it stops drafting (loop close, room close, | ||
| // T-junction, single). Mirror that here instead of chaining the 2D | ||
| // draft from a dead point. |
There was a problem hiding this comment.
Failed 2D commits abort wall chains
Medium Severity
In 2D-only mode, a null createWallOnCurrentLevel result now hits shouldStopWallDraftAfterCommit and clears the draft. Previously the viewIs2DOnly guard skipped that branch, so a rejected commit kept the chain alive. Duplicate or fully covered segment attempts therefore discard an in-progress wall chain.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b010bb1. Configure here.


What does this PR do?
Splits divider walls and connected boundary walls into correct topology.
Adds accurate support for dividers connected to curved walls.
Creates one generated slab and ceiling for every detected room.
Preserves slab customization when a room is split.
Preserves ceiling customization when a room is split.
Handles slab and ceiling merges without losing user intent.
Keeps deliberately deleted generated surfaces deleted.
Improves room detection across boundary sizes and shapes.
Keeps 2D and mounted wall-tool continuation behavior aligned.
Adds regression coverage for the complete workflow.
How to test
bun run check-types,bun run check,bun run lint, andbun run build; all commands should pass.bun dev, create a closed four-wall room, and confirm the tree contains one generated slab and one generated ceiling.Screenshots / screen recording
Browser-verified locally. A screenshot or short recording can be added during review if needed.
Checklist
bun devbun checkto verify)mainbranchNote
High Risk
Touches core scene graph reconciliation, level metadata persistence, and wall commit/split behavior—bugs could corrupt rooms, resurrect deleted surfaces, or misplace attachments.
Overview
Keeps auto slabs and ceilings aligned when rooms split, merge, or when users delete generated surfaces. Planners now inherit materials, elevations/heights, and partition or union openings across splits and compatible merges; conflicting merged finishes are demoted to manual instead of forced into one surface. Deleted auto surfaces are recorded on the level as
autoSurfaceSuppressionsso they are not recreated on later wall edits or after reinitializing sync. Room detection no longer drops very small or very large closed loops.Space detection sync waits for coalesced scene commits (skipping mid-transaction store updates) so divider commits that split walls and add segments do not reconcile against half-written topology.
Wall commits can emit multiple segments when a draft crosses existing walls (splitting hosts at intersections), with curved-wall splits preserving arc geometry and migrating doors/windows by arc length. 2D floor-plan drafting uses
shouldStopWallDraftAfterCommitso chain termination matches the mounted wall tool.Reviewed by Cursor Bugbot for commit b010bb1. Bugbot is set up for automated code reviews on this repo. Configure here.