Skip to content

core: reconcile room surfaces after wall topology edits - #624

Merged
wass08 merged 40 commits into
pascalorg:mainfrom
sudhir9297:t3code/fix-agentation-module-error
Aug 11, 2026
Merged

core: reconcile room surfaces after wall topology edits#624
wass08 merged 40 commits into
pascalorg:mainfrom
sudhir9297:t3code/fix-agentation-module-error

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Moves wall insertion and split planning into atomic core topology operations so crossings, T-junctions, attachments, and boundary-wall replacements commit together.
  • Reconciles auto slabs, ceilings, spaces, and wall-side classifications after room splits, moves, merges, curved-wall edits, corridor enclosure, and level cascades while preserving compatible customization, openings, and hosted children.
  • Uses a per-level topology index to limit work to affected wall components, with full-detector equivalence coverage and remote-commit baseline handling.

Fixes #544
Incorporates the implementation and review feedback discussed in #554.

How to test

  1. Run bun run check-types, bun run build, bun run check, and bun test; all should pass.
  2. Run bun dev, open a saved scene, switch to 2D, create a four-wall room, and customize its auto slab thickness, elevation, or material.
  3. Draw a divider from one boundary wall to the opposite wall. Expect both boundary walls to split atomically and the room to contain two auto slabs and two auto ceilings with the compatible customization preserved.
  4. Move or delete the divider and use undo/redo. Expect the surfaces to reshape or merge without duplicates, missing surfaces, or unrelated-room churn.
  5. Apply the same wall edit through a remote/host patch. Expect the receiving client to adopt the transmitted generated surfaces without minting different IDs.

Screenshots / screen recording

Not included — this changes topology reconciliation behavior rather than visual styling. The browser steps above reproduce the interactive result.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

High Risk
Touches core room detection, auto surface lifecycle, and collaborative commit boundaries—bugs could duplicate/miss slabs, corrupt openings, or desync remote clients.

Overview
Introduces planWallInsertion and planWallSplitAtPoint in core so wall draws can commit crossings, host splits, attachment moves, curved intersections, and terrain rebasing as one atomic change set instead of piecemeal edits.

Space detection now keeps a per-level RoomTopologyIndex and, when a commit reports changed wall IDs, reconciles only the connected wall component: spaces, wall sides, zones, and auto slabs/ceilings. Incompatible merged auto surfaces are demoted to manual rather than forced together; compatible merges/splits preserve materials, holes (including clipped stair/elevator openings), recessed slab settings, and ceiling children with reparent plans. Scenes loaded without auto surfaces no longer get backfilled slabs/ceilings on later reshapes; user-deleted generated surfaces stay suppressed.

Scene mutations record changedNodeIds on commits (runWithSceneCommitNodeIds in node actions) so detection runs in the same history step as the wall edit and remote/load baselines resync via commit subscription. Large test coverage compares indexed vs full reconciliation and wall-topology edge cases.

Reviewed by Cursor Bugbot for commit 5567070. Bugbot is set up for automated code reviews on this repo. Configure here.

sudhir9297 and others added 30 commits May 19, 2026 02:59
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>
@wass08
wass08 merged commit dd12ef3 into pascalorg:main Aug 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants