Skip to content

core: slide door with transom to full opening height on sloped walls - #1304

Open
kruschdev wants to merge 2 commits into
pascalorg:mainfrom
kruschdev:fix/sloped-wall-transom-move
Open

kruschdev wants to merge 2 commits into
pascalorg:mainfrom
kruschdev:fix/sloped-wall-transom-move

Conversation

@kruschdev

@kruschdev kruschdev commented Nov 22, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #1252

When moving an existing door that has a transomHeight along a sloped wall (endHeightOffset), planOpeningMove previously passed the leaf-only node.width and node.height to clampDoorToWall and refuseOpeningAboveSlope, then checked the full cutout.height (leaf + transom) at the unclamped spot and refused with wall_too_low even when sliding further toward the taller end of the wall cleared the whole opening.

I updated planOpeningMove in packages/core/src/agent-operations/move-plan.ts so both the sloped-wall slide (clampDoorToWall) and the slope refusal (refuseOpeningAboveSlope) measure the full cutout dimensions while preserving the door leaf's floor-seated position[1] (node.height / 2) and sidelight offset.

How to test

  1. Run bunx biome check packages/core/src/agent-operations/move-plan.ts packages/core/src/building/wall-openings-slope.test.ts (0 errors, 0 warnings).
  2. Run 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.
  3. Verify the new #1252 test cases in wall-openings-slope.test.ts: a 2.1 m door with a 0.4 m transom moved onto the low stretch of a 1 m to 3 m rising wall slides to x = 3.45 m (clamped: true, position[1] = 1.05 m), an asymmetric sidelight + transom door slides to x = 3.25 m, and a 2.7 m assembly that fits nowhere on the wall is refused with wall_too_low.

Screenshots / screen recording

0.9 m x 2.1 m door with 0.4 m transom moved toward the low end of a 1 m to 3 m sloped wall (clamped: true, slid to x = 3.45 m, position[1] = 1.05 m):

Door with 0.4 m transom slid to x = 3.45 m on 1 m to 3 m sloped wall

0.9 m x 2.1 m door with 0.2 m left sidelight and 0.2 m transom in Split 2D/3D view (clamped: true, slid to x = 3.25 m):

Door with 0.2 m left sidelight and 0.2 m transom slid to x = 3.25 m

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

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: planOpeningMove now clamps and refuses using the full door cutout size (getDoorOpeningSize) instead of leaf-only width/height.

For doors, clampDoorToWall gets cutout.height and a node copy with transomHeight cleared so the clamp slides along the wall until the whole opening fits, rather than shrinking the transom. refuseOpeningAboveSlope uses 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_low when 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.

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kruschdev

Copy link
Copy Markdown
Author

Thanks @Aymericr! I added that one-line comment above clampDoorToWall in 4a50d00 explaining that transomHeight is intentionally folded into cutout.height so the door slides to clear the full opening instead of shrinking the transom.

This branch has not been deployed

No deployments
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.

[Maintainer] Sloped walls: moving a door with a transom can be refused even when it fits further up the slope

2 participants