Skip to content

[Website] Keep unfinished Blueprint runs out of Recent and restore suggestions - #4127

Merged
adamziel merged 1 commit into
trunkfrom
exclude-unfinished-blueprint-runs
Jul 21, 2026
Merged

[Website] Keep unfinished Blueprint runs out of Recent and restore suggestions#4127
adamziel merged 1 commit into
trunkfrom
exclude-unfinished-blueprint-runs

Conversation

@adamziel

@adamziel adamziel commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

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
Failed Blueprint run listed under Recent autosaves on desktop Failed Blueprint run omitted from Recent autosaves on desktop

Mobile

Before After
Failed Blueprint run listed under Recent autosaves on mobile Failed Blueprint run omitted from Recent autosaves on mobile

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.

Base automatically changed from blueprint-run-source-lifecycle to trunk July 20, 2026 23:15
@adamziel
adamziel force-pushed the exclude-unfinished-blueprint-runs branch 4 times, most recently from be22f0a to d2e1746 Compare July 20, 2026 23:28
@adamziel
adamziel marked this pull request as ready for review July 20, 2026 23:34
@adamziel
adamziel requested review from a team, ashfame and Copilot July 20, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR prevents unfinished stored Blueprint runs (recovery state) from appearing in Recent autosaves and from being offered as setup-URL restore suggestions until the first OPFS sync succeeds and clears the return target.

Changes:

  • Introduces helpers to classify “restorable autosaves” vs. “unfinished Blueprint runs”.
  • Updates Recent autosaves and matching-setup restore logic to use the new classification.
  • Adds a unit test covering the new classification behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/playground/website/src/lib/state/redux/slice-sites.ts Adds isRestorableAutosavedSite / isUnfinishedBlueprintRun helpers to hide unfinished Blueprint runs from autosave flows.
packages/playground/website/src/lib/state/redux/slice-sites.spec.ts Adds a test ensuring normal autosaves are restorable while unfinished Blueprint runs are not.
packages/playground/website/src/components/saved-playgrounds-panel/index.tsx Switches “Recent” filtering to the new “restorable autosave” predicate.
packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx Prevents matching-setup restore suggestions from using unfinished Blueprint runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/website/src/lib/state/redux/slice-sites.ts
Comment thread packages/playground/website/src/lib/state/redux/slice-sites.ts
Comment thread packages/playground/website/src/lib/state/redux/slice-sites.ts
@adamziel
adamziel force-pushed the exclude-unfinished-blueprint-runs branch from d2e1746 to 6827485 Compare July 20, 2026 23:35
Blueprint runs use autosave persistence before their first OPFS copy succeeds.
Classify those runs separately so Recent and setup-URL restore suggestions only
surface normal autosaves.
@adamziel
adamziel force-pushed the exclude-unfinished-blueprint-runs branch from 6827485 to 2c0b2bc Compare July 20, 2026 23:37
@adamziel
adamziel merged commit 91b3227 into trunk Jul 21, 2026
53 checks passed
@adamziel
adamziel deleted the exclude-unfinished-blueprint-runs branch July 21, 2026 00:02
adamziel added a commit that referenced this pull request Jul 21, 2026
Part of #4099.

Builds on #4127.

A failed OPFS deletion now leaves the Playground in Redux so the
deletion can be retried.

## Background

A stored Playground has files in OPFS and a record in Redux.
`removeSite()` used to catch an OPFS error and then remove the Redux
record anyway. It also treated missing browser storage as a successful
deletion. In both cases, the Playground disappeared from the UI while
its deletion had not succeeded.

## This change

`removeSite()` now checks that browser storage is available and removes
the Redux record only after OPFS deletion succeeds. Otherwise the error
reaches the caller and the record remains.

Autosave pruning is allowed to skip a broken site and keep going. It
catches each deletion failure in the pruning loop, logs it, and tries
the next candidate. This is why the `try/catch` belongs there instead of
in `removeSite()`.

## Testing

There is no practical UI control for forcing these storage failures. The
focused tests cover unavailable browser storage, a rejected OPFS
deletion, and a prune pass where one deletion fails while the next
succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment