Skip to content

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

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

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
Contributor

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
Contributor 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.

@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.

[Maintainer] LGTM at 4a50d00. Thanks @kruschdev.

This fixes #1252: moving a door with a transom (or sidelights) on a sloped wall was clamped as if the leaf were the opening, so a move could be refused even when the full opening fit. The door is now clamped on its full cutout height (transomHeight folded into cutout.height on purpose, with the transom stripped from the node passed to clampDoorToWall), the Y stays at height / 2 as before for doors, and the refusal message now reports the cutout size. The new test covers three cases: slide to the first x where door plus transom fits, the same with a sidelight, and a refusal (wall_too_low) when no stretch of the wall clears the opening. Small, correct, no security surface.

Status: GitHub Actions have not run on this head (fork workflows are waiting for maintainer approval), so it is not merge-ready until CI is green.

@Aymericr Aymericr added the bot:bugs label Dec 2, 2026 — with Cursor
Aymericr added a commit that referenced this pull request Dec 2, 2026
* core: slide door with transom to full opening height on sloped walls

Ported from #1304 (head 4a50d00).

Co-authored-by: kruschdev <249158235+kruschdev@users.noreply.github.com>

* viewer,editor: defer wall T-junction repair to export preparation

Ported from #1309 (head b063e9c).

Co-authored-by: kruschdev <249158235+kruschdev@users.noreply.github.com>

* i18n: tighten placeholder, tag, and ICU select validation

Ported from #1344 (head 32ec36e).

Co-authored-by: kruschdev <249158235+kruschdev@users.noreply.github.com>

* core(i18n): apply per-fallback-locale plural rules in PascalI18n

Ported from #1345 (head 03da2d2).

Co-authored-by: kruschdev <249158235+kruschdev@users.noreply.github.com>

* Revert "core(i18n): apply per-fallback-locale plural rules in PascalI18n"

This reverts commit f936404.

Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: kruschdev <249158235+kruschdev@users.noreply.github.com>
Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>

Aymericr commented Dec 2, 2026

Copy link
Copy Markdown
Member

Thanks @kruschdev! This landed on main in #1347 (squash 4047d44), with you credited as co-author. Fork CI couldn't run here, so we ported it to a branch where it could. Closing this one as merged via #1347.

@Aymericr Aymericr closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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