Repository navigation
core: door and window casing fields are optional, not defaulted - #1198
Merged
Merged
Conversation
Door and window casing (casingFaceA/B, casingWidth) were zod defaults: parsing a saved opening wrote all three, so a scene's load paths no longer agreed and an untouched door changed on save. Like other recent optional fields they are now optional; readers already treat absent faces as uncased and an absent width as 2 in (openingCasingWidth). New openings still write casing on. Co-Authored-By: Claude Opus 5.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.
What does this PR do?
Door and window casing fields (
casingFaceA,casingFaceB,casingWidth, from #1193) were zod defaults, so parsing any saved door or window wrote all three. A scene's load paths then disagreed (the hosted app's client and authority loads compare them), and an untouched opening changed on its next save.They are now optional, like other recent optional node fields: loading adds nothing. Absent faces are uncased; an absent width reads as 2 in through
openingCasingWidth. New doors and windows still write casing on, so behaviour is unchanged.How to test
bun run ci: passes (run locally).Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
This touches persisted door/window schema and load/save parity across client and authority; wrong handling could still mutate legacy scenes or desync casing on merge/move, though behavior is heavily covered by tests.
Overview
Door and window casing (
casingFaceA,casingFaceB,casingWidth) no longer get Zod defaults when a node is parsed, so legacy openings load without those keys and stay uncased until someone turns casing on. Runtime behavior is unchanged: missing faces mean no boards; missing width still resolves to 2 in viaopeningCasingWidth.Tests and round-trip expectations were updated (legacy corpus, scene migration, wall merge, floorplan move commit types) so they assert field absence or
undefinedinstead offalse/ injected defaults. Preview/plan tests now useopeningCasingWidth(node)rather than assumingcasingWidthis always on the node.Reviewed by Cursor Bugbot for commit f80ce2c. Bugbot is set up for automated code reviews on this repo. Configure here.