[Website] Track Blueprint runs until their first OPFS copy succeeds - #4126
Merged
Conversation
adamziel
force-pushed
the
error-recovery-preserve-shell-parameters
branch
from
July 20, 2026 19:34
e4d16c0 to
75d54e8
Compare
adamziel
force-pushed
the
blueprint-run-source-lifecycle
branch
from
July 20, 2026 19:34
e0b0fe3 to
13c0f07
Compare
Base automatically changed from
error-recovery-preserve-shell-parameters
to
trunk
July 20, 2026 20:30
adamziel
force-pushed
the
blueprint-run-source-lifecycle
branch
from
July 20, 2026 20:30
13c0f07 to
214ac91
Compare
A failed Blueprint run needs a stored Playground it can return to. Record that target when the run is created and carry it through retries. Clear the return target in the same metadata write that completes the first OPFS copy. Failed and interrupted copies keep it.
adamziel
force-pushed
the
blueprint-run-source-lifecycle
branch
from
July 20, 2026 21:06
214ac91 to
45489f0
Compare
adamziel
marked this pull request as ready for review
July 20, 2026 22:51
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds persistent “return target” metadata for Blueprint runs so retries/failures can recover back to the original stored Playground until the first MEMFS→OPFS copy succeeds.
Changes:
- Extends stored site metadata with
siteSlugToReturnToIfBlueprintFailsand threads it through stored-site creation. - Clears the return target on successful initial OPFS sync (in the same metadata write that marks
initialOpfsSyncPending: false). - Updates Blueprint editor + tests to preserve the original return target across reruns and cleanup behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/redux/slice-sites.ts | Adds the return-target field to stored site creation options and SiteMetadata. |
| packages/playground/website/src/lib/state/redux/slice-sites.spec.ts | Updates stored-site-creation expectations to include the new metadata field. |
| packages/playground/website/src/lib/state/redux/boot-site-client.ts | Passes the return target into initial OPFS sync and clears it after first successful sync. |
| packages/playground/website/src/lib/state/redux/boot-site-client.spec.ts | Adds a test asserting the return target is cleared after initial OPFS copy completes. |
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.tsx | Persists/propagates the return target when rerunning unfinished Blueprint runs; adjusts autosave pruning exclusions. |
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.spec.tsx | Updates run behavior tests to assert the original return target is preserved. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+482
to
+485
| excludeSlugs: [ | ||
| siteSlugToReturnToIfBlueprintFails, | ||
| newSite.slug, | ||
| ], |
| }, | ||
| }); | ||
| const state = createState(site); | ||
| const dispatch = createDispatch(state); |
Comment on lines
+604
to
+606
| ...(siteSlugToReturnToIfBlueprintFails | ||
| ? { siteSlugToReturnToIfBlueprintFails: undefined } | ||
| : {}), |
adamziel
added a commit
that referenced
this pull request
Jul 21, 2026
…ggestions (#4127) Part of #4099. Builds on #4126. An unfinished stored Blueprint run is recovery state, not a normal autosave. Keep it out of Recent and setup-URL restore suggestions until its first OPFS sync succeeds and clears the return target. Both comparisons use the same stored Playground and the same failed run, created with unavailable WordPress version `999.9`. Before this change, reloading lists the failed run under Recent autosaves. After this change, only the Playground that launched it remains visible. ### Desktop | Before | After | | --- | --- | | <img width="440" alt="Failed Blueprint run listed under Recent autosaves on desktop" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/dfe5d4913c/before-recent-desktop.png"> | <img width="440" alt="Failed Blueprint run omitted from Recent autosaves on desktop" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/dfe5d4913c/after-recent-desktop.png"> | ### Mobile | Before | After | | --- | --- | | <img width="260" alt="Failed Blueprint run listed under Recent autosaves on mobile" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/dfe5d4913c/before-recent-narrow.png"> | <img width="260" alt="Failed Blueprint run omitted from Recent autosaves on mobile" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/dfe5d4913c/after-recent-narrow.png"> | ## Testing Run a stored Playground's Blueprint with an unavailable WordPress version. Reload and confirm the unfinished run is not offered in Recent or as an autosave to restore.
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.
Running a stored Blueprint creates another OPFS-backed Playground before
WordPress boots. Until its first MEMFS-to-OPFS copy succeeds, a failed run
needs to know which stored Playground it should return to.
This records that return target when the run is created, carries it through
retries, and clears it in the same metadata write that completes the first
OPFS copy. Failed and interrupted copies keep the target. Abandoned runs
remain eligible for normal autosave cleanup.
There is no UI change here. Follow-up work uses the return target to keep
unfinished runs out of Recent and offer explicit recovery.
Testing
Run a Blueprint from a stored Playground and confirm the new Playground boots
and saves normally. Retry before its first save finishes and confirm the same
stored Playground remains the return target.