fix(core): slab-sourced wall drafts are never coerced to a ground base - #702
Open
wass08 wants to merge 1 commit into
Open
fix(core): slab-sourced wall drafts are never coerced to a ground base#702wass08 wants to merge 1 commit into
wass08 wants to merge 1 commit into
Conversation
Fixes #699. In a fresh scene the newly drawn slab is the only registered top surface, so the pointer resolver hands the wall tool a node-top sourceNodeId; the tool then treated ANY source as flatConstructionBase and resolveWallConstruction force-elected 'ground', stamping the level height and the slab elevation as supportOffset — walls on slabs in new projects persisted terrain-hosted. Scenes with pre-existing geometry route the ray differently, which is why seeded fixtures never showed it. The fix is deliberately narrow: a construction source that IS a slab suppresses the flat-base ground coercion, nothing more — normal capped support election picks the underlying slab, caller-supplied preferences stay authoritative, and genuine terrain drafts keep their by-design explicit height/offset stamping. (A first attempt pinned the source slab as preferredSlabId; review caught that it would break cross-slab walls, now covered by tests: majority-coverage slab wins, a grazing source slab is not pinned, and the fresh-scene shape stays plane-bound with live election resolving the slab.) Acceptance: private-editor's e2e wall-plane-bound spec (fresh org project, currently test.fixme'd on this bug) passes twice with the fix; wall-hover and undo-redo e2e unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #699 — walls drawn on a slab in fresh scenes committed terrain-hosted (
height= level height,supportOffset= slab elevation,supportSlabId: "ground") while rendering correctly on the slab. Mechanism and scene-structure discriminator are in the issue.The fix (deliberately narrow)
resolveWallConstruction: aconstructionSourceNodeIdthat resolves to a slab suppresses theflatConstructionBaseground coercion — nothing more. Normal capped support election then finds the underlying slab; caller-suppliedpreferredSupportSlabIdsemantics are untouched; genuine terrain drafts (no slab source) keep their by-design explicit height/offset stamping (#630 rule).A first iteration also fed the source slab into
preferredSlabId; the independent review pass caught that this would pin the first-click slab across cross-slab walls (overriding per-commit re-election and the elevation cap, and diverging from the 2D path). The narrowed version ships with tests for exactly those shapes.Evidence
Expected "slab_fresh_floor" / Received "ground"); the two review-derived tests (cross-slab majority wins; grazing source not pinned) failed on the broad first patch and pass on the narrowed one. Focused suites 35/35, fullturbo test13/13.wall-plane-boundun-fixme'd passes 2× (28.0s / 22.4s). It shipstest.fixme'd over there and gets un-fixme'd in the submodule-bump PR after this merges.resolveWallConstructionhas one production caller (wall-drafting), reached from the 3D wall tool and the floorplan panel; column/fence/stair flows don't pass these options. The floorplan path has no equivalent coercion (parity checked perwiki/architecture/tools.md).🤖 Generated with Claude Code
Note
Medium Risk
Touches wall support-host persistence, which can change committed geometry, but the change is a small, well-tested guard in one resolver.
Overview
Walls started on a slab in
resolveWallConstructionno longer getflatConstructionBasetreated as a ground host. That was committing fresh-scene slab drafts as terrain-hosted (GROUND_SUPPORT_IDplus stamped height/offset) even though they rendered on the slab.The source slab is only used to suppress that coercion. Support still re-elects under the existing cap, so a first-click slab is not pinned across a longer wall. Genuine terrain drafts without a slab source keep explicit height/offset stamping.
Tests cover the fresh-scene slab case, majority support on a cross-slab span, and a grazing source that must not override the elevation cap.
Reviewed by Cursor Bugbot for commit 3ec8388. Bugbot is set up for automated code reviews on this repo. Configure here.