Skip to content

core: modern and half-louvered doors have a leaf - #1009

Closed
AxiomeCG wants to merge 6 commits into
pascalorg:mainfrom
AxiomeCG:fix/door-leaves
Closed

AxiomeCG wants to merge 6 commits into
pascalorg:mainfrom
AxiomeCG:fix/door-leaves

Conversation

@AxiomeCG

@AxiomeCG AxiomeCG commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Modern and half-louvered doors have a leaf again.

  • Modern: the preset was a single empty segment, which the door system draws as no leaf, so every modern door rendered as an open frame. It is now a flush panel over the whole leaf.

  • Half-louvered: the preset built its slats from empty rows, leaving a hole over its top half. The slats are now ten raised bars (about 7 cm tall, 2.2 cm proud, 2.8 cm apart), deep and narrow enough to read.

  • Panels on both faces: a panel segment's raised inner panel was drawn on the front face only, so a door seen from the hall was flat. It is now mirrored on the back face, for every panelled style (the shaped-top path is unchanged).

  • The same styles by hand: a person picks the same styles from the panel or while placing; the agent and the panel write the same fields. The door and window panels gain a Style row under Type (it shows the style a door or window reads back as, or Custom when its leaf or panes match none), and the standalone editor's door and window tools gain the chips [O] Type and [L] Style, which the placed door or window takes. The door panel's Type logic moves into core (doorTypeFields, doorTypeChange), so the row, the chips and agents write the same fields; a style the person chose survives a type change.

  • Type and style: Changing a door's Type keeps a Style the person chose (a modern door made sliding stays modern); a door still on its type's own leaf takes the new type's (hinged → French gets the French glazing).

  • Renamed export (npm consumers of @pascal-app/core/building): getDoorStyleOverrides(style) is replaced by doorStyleLook(style), which returns the whole look (segments and contentPadding) where the old function returned only the fields a style changed ({} for panel). A door parsed from either is the same for every style. Its one caller in the hosted app moves in pascalorg/private-editor#846.

New viewer tests check that every door style's closed leaf covers its opening, and that six-panel, shaker and half-louvered doors show their panels on both faces.

How to test

  1. By hand: place a door, select it, and set its Style to Modern in the door panel: a closed flush leaf. Set Half-louvered: ten slats on top, a panel below; orbit to the other side: the panels show there too. In the standalone editor's door tool, L cycles styles and O types before placing.
  2. bun test packages/viewer/src/systems/door/door-styles.test.ts: 13 pass. Without this change, the modern and half-louvered leaf cases fail, and the three both-faces cases fail on the one-sided panels.
  3. Over the MCP (or in a chat using these tools), ask for a modern door: add_door with style: 'modern' builds a flat leaf, not an open frame. Then a half-louvered door: ten slats on top, a panel below, no hole. Orbit to the other side: the panels show there too.
  4. bun run ci is green.

Merge: merge this PR with a merge commit (not squash), so pascalorg/private-editor#846's submodule pin stays reachable; then #846.

Screenshots / screen recording

Not added yet.

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

🤖 Generated with Claude Code


Note

Medium Risk
Touches door mesh generation and shared opening presets used by editor, agents, and a breaking doorStyleLook API rename; behavior is covered by new tests but placement and type/style merging affect many code paths.

Overview
Fixes modern and half-louvered doors so a closed leaf actually fills the opening (flush slab vs empty segments; slats as raised bars), and mirrors panel geometry on the back face so panelled styles read from either side.

Centralizes door/window type and style in @pascal-app/core/building: doorTypeFields / doorTypeChange (type changes keep a user-chosen style when it isn’t the type’s default leaf), doorStyleLook (replaces getDoorStyleOverrides with full segments + contentPadding), doorStylesOf / windowStylesOf, and windowTypeFields. Door and window panels get a Style row; placement tools share Type / Style chips (O / L) via new placement stores so previews, panel edits, and add_door stay aligned.

Adds core and viewer tests for type changes, style round-trips, leaf coverage, and double-sided panels.

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

AxiomeCG and others added 3 commits October 6, 2026 18:46
The modern preset was one 'empty' segment, which the door system draws as no
leaf: run 4's front door rendered as an open frame. Half-louvered built its
slats from empty rows, a hole over its top half. Modern is now a flush panel
over the whole leaf, the slats thin panel rows. A viewer test checks every
door style's closed leaf covers its opening.

Slice: F1
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…show their panels on both faces

The half-louvered preset's slats were too shallow to read: the door system
always raises a panel by |panelDepth|, so a slat shows only when it is deep
and narrow against its gap. Ten bars about 7 cm tall, 2.2 cm proud, 2.8 cm
apart. A panel segment's raised inner panel was drawn on the front face
only, so a door seen from the hall was flat; it is now mirrored on the back
face, for every panelled style (the shaped-top path is unchanged). A test
checks the panels are on both faces for six-panel, shaker and half-louvered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Door and window styles (modern, shaker, six-panel… single, double-hung,
transom…) existed only for add_door, add_window and create_room; a person
looking for Modern in the door panel could not find it. Each panel gains a
Style row under its Type row, showing the style a door or window reads back
as, or Custom when its segments or panes match none. The door and window
tools gain the chips [O] Type and [L] Style, and the placed door or window
takes both.

The door panel's Type row moves into core (doorTypeFields, doorTypeChange)
so the row, the chips and later agents write the same fields. A style the
person chose survives a type change; a door with its type's own leaf takes
the new type's. A style's look is now whole (segments and margin), so a
panel door after a modern one gets its margin back.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AxiomeCG
AxiomeCG marked this pull request as ready for review October 6, 2026 19:23

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread packages/core/src/building/wall-openings.ts
AxiomeCG and others added 2 commits October 6, 2026 22:43
…irs, pascalorg#996 hosted service contracts) into the doors fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es or codes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a6cf208. Configure here.

Comment thread packages/core/src/building/window-types.ts
The window tool merges the chips' fields into its draft, and only Bay and Bow
wrote a sill (false), so a Fixed or Louvered window cycled past them was
placed without one. The tool has no sill control, so the type now always says
whether there is a sill. The panel's Type row and add_window are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AxiomeCG
AxiomeCG marked this pull request as draft October 6, 2026 21:34
AxiomeCG added a commit to AxiomeCG/editor that referenced this pull request Oct 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AxiomeCG

AxiomeCG commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #1014, the sync bundle that brings this PR's content (with its review fixes and docs) together with the rest of the tested work, tested there by the owner. This PR stays as the review map for its part.

@AxiomeCG AxiomeCG closed this Oct 7, 2026
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.

1 participant