Carry collections through Save Build / Load Build - #783
Open
chiliec wants to merge 1 commit into
Open
Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: b2126f81-7fc5-4800-9c2c-d21556b11d63 |
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?
Fixes #734 — Save Build / Load Build dropped collections on both sides. Same shape as #729 (materials):
handleSaveBuildnow includescollectionsin the savedsceneData.validateBuildJsongets acollectionspass: each entry is checked against theCollectionshape (id,name,nodeIds: string[], optionalcolor/controlNodeId); invalid entries are skipped with aninvalid_collectionswarning that names the skipped ids, a non-objectcollectionsis ignored with a warning. Valid entries land onparsed.collections.handleConfirmImportpassesparsed.collectionsthrough tosetScene(which already acceptedextra.collections).How to test
bun --cwd packages/core run test— 4 new tests invalidate-build-json.test.tsundercollections(carry-through, per-entry skip with warning, non-object warning, absent → omitted fromparsed).validate-build-json.tschange makes 3 of those tests fail; with it they pass. Fullpackages/coresuite: 1430 pass / 0 fail.packages/editortests: 836 pass / 0 fail,tsc --noEmitforpackages/editorclean.Screenshots / screen recording
n/a — no UI change, only the saved file contents and the import pass.
Checklist
bun dev(verified via the package test suites +tsc --noEmitinstead; happy to add a clip if you'd like one)bun checkto verify)mainbranchNote
Low Risk
Scoped to build JSON validation and settings-panel save/import wiring; no auth or security paths, and invalid collection data is warn-and-skip rather than hard-failing import.
Overview
Fixes collections being dropped on Save Build and Load Build, mirroring the existing materials round-trip.
Save Build now writes
collectionsfrom the scene store into the exported JSON alongside nodes, materials, and plugins. Load Build passesparsed.collectionsintosetSceneafter import validation.validateBuildJsongains a collections pass: valid entries (requiredid,name,nodeIds: string[], optionalcolor/controlNodeId) appear onparsed.collections; bad entries are skipped with aninvalid_collectionswarning that lists skipped ids; a non-objectcollectionsfield is ignored with a warning; absent collections stay omitted fromparsed. Four unit tests cover carry-through, partial skip, invalid top-level shape, and omission when missing.Reviewed by Cursor Bugbot for commit fc5bf17. Bugbot is set up for automated code reviews on this repo. Configure here.