[Website] Bind copied Blueprint bundles to their new Playground - #4115
Merged
Conversation
adamziel
force-pushed
the
copied-blueprint-bundle-ownership
branch
from
July 20, 2026 14:10
0ac4c66 to
6a53b15
Compare
adamziel
marked this pull request as ready for review
July 20, 2026 14:16
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR ensures that when a stored Playground is created from an editable Blueprint bundle, the newly created Playground immediately references its own copied bundle backend (under the destination slug), preventing edits from mutating the source Playground’s draft before a reload.
Changes:
- Load the persisted Blueprint bundle backend for the destination slug and store it in the new site’s metadata.
- Update tests to mock and assert the new
loadPersistedBlueprintBundle()behavior. - Clarify the code comment to describe the “copy then bind” behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/redux/slice-sites.ts | Load the destination-slug persisted bundle backend before writing site metadata so the new Playground owns its copied bundle immediately. |
| packages/playground/website/src/lib/state/redux/slice-sites.spec.ts | Update mocks/expectations to validate the new persisted-bundle load step and metadata binding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A stored site created from an editable Blueprint copies the bundle into the new slug, but kept the source backend in metadata until reload. Editing the new Playground in the same session could still write to the source bundle. Return the destination backend from persistBlueprintBundle and store it in the new site's metadata. This avoids reopening the OPFS directory and keeps the bundle write ordered before the site record.
adamziel
force-pushed
the
copied-blueprint-bundle-ownership
branch
from
July 20, 2026 14:20
6a53b15 to
358ab61
Compare
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.
Part of #4099.
Stored Playgrounds created from editable Blueprint bundles kept the source bundle backend in their metadata until the page reloaded. Editing the new Playground during the same session could therefore modify the source Playground's Blueprint.
persistBlueprintBundle()now returns the destination OPFS backend after copying the bundle, andcreateStoredSite()records that backend in the new site's metadata. The bundle is still written before the site record.Testing
Run a stored Playground's Blueprint, edit the new Playground before reloading, then return to the source Playground and confirm its Blueprint did not change.