Repository navigation
Conversation
Aymericr
left a comment
There was a problem hiding this comment.
Thanks @kruschdev, this fixes #1252 the way the issue asked: the agent-move slide and the refusal now both measure the full door-plus-transom cutout. Clamping with cutout.height and transomHeight cleared means the clampDoorToWall path slides to a span where the whole opening fits, instead of shrinking the transom the way the interactive tool does. The sidelight case keeps the leaf offset right.
I ran packages/core tests locally on this branch. The new #1252 test passes and there are no new failures compared with main (the five pre-existing failures there are unbuilt @pascal-app/core/* subpath imports in my environment).
One optional nit: passing { ...node, transomHeight: undefined } together with cutout.height is a bit indirect. A one-line comment saying the transom is folded into the height on purpose would help the next reader.
LGTM. CI for this fork is waiting on maintainer approval to run.
What does this PR do?
Fixes #1252
When moving an existing door that has a
transomHeightalong a sloped wall (endHeightOffset),planOpeningMovepreviously passed the leaf-onlynode.widthandnode.heighttoclampDoorToWallandrefuseOpeningAboveSlope, then checked the fullcutout.height(leaf + transom) at the unclamped spot and refused withwall_too_loweven when sliding further toward the taller end of the wall cleared the whole opening.I updated
planOpeningMoveinpackages/core/src/agent-operations/move-plan.tsso both the sloped-wall slide (clampDoorToWall) and the slope refusal (refuseOpeningAboveSlope) measure the fullcutoutdimensions while preserving the door leaf's floor-seatedposition[1](node.height / 2) and sidelight offset.How to test
bunx biome check packages/core/src/agent-operations/move-plan.ts packages/core/src/building/wall-openings-slope.test.ts(0 errors, 0 warnings).cd packages/core && bun test src/building/wall-openings-slope.test.ts src/building/wall-openings.test.ts src/agent-operations/move-duplicate.test.ts src/runtime/fixture-parity.test.ts.#1252test cases inwall-openings-slope.test.ts: a2.1 mdoor with a0.4 mtransom moved onto the low stretch of a1 mto3 mrising wall slides tox = 3.45 m(clamped: true,position[1] = 1.05 m), an asymmetric sidelight + transom door slides tox = 3.25 m, and a2.7 massembly that fits nowhere on the wall is refused withwall_too_low.Screenshots / screen recording
0.9 m x 2.1 mdoor with0.4 mtransom moved toward the low end of a1 mto3 msloped wall (clamped: true, slid tox = 3.45 m,position[1] = 1.05 m):0.9 m x 2.1 mdoor with0.2 mleft sidelight and0.2 mtransom in Split 2D/3D view (clamped: true, slid tox = 3.25 m):Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Changes door placement/clamping on sloped walls in
planOpeningMove, which affects editor move behavior but is covered by new regression tests.Overview
Fixes moving doors with transoms (and sidelight assemblies) on sloped walls:
planOpeningMovenow clamps and refuses using the full door cutout size (getDoorOpeningSize) instead of leaf-onlywidth/height.For doors,
clampDoorToWallgetscutout.heightand a node copy withtransomHeightcleared so the clamp slides along the wall until the whole opening fits, rather than shrinking the transom.refuseOpeningAboveSlopeuses the same cutout dimensions. Door floor height (position[1]) and sidelight offset behavior are unchanged.Adds slope tests for transom and sidelight+transom doors (slide when a tall-enough stretch exists,
wall_too_lowwhen the cutout cannot fit anywhere on the wall).Reviewed by Cursor Bugbot for commit 4a50d00. Bugbot is set up for automated code reviews on this repo. Configure here.