Save Playgrounds by default#3655
Draft
adamziel wants to merge 47 commits into
Draft
Conversation
bb825ab to
1861daa
Compare
…playgrounds # Conflicts: # packages/playground/website/src/lib/state/redux/boot-site-client.ts
This was referenced May 19, 2026
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 it does
Makes browser Playgrounds save by default without changing reusable setup URLs.
A fresh visit to
playground.wordpress.net/?php=8.3&plugin=...now creates an autosaved OPFS Playground, keeps the original setup URL in the address bar, and shows anAutosavedstatus menu.storage=tempandcan-save=nostill opt out.If a matching recent autosave exists, Playground starts a new site immediately and shows a non-blocking restore nudge. Choosing
Restoreopens the previous autosave. ChoosingKeep newstarts autosaving the new site.Rationale
Autosave prevents accidental data loss, but replacing setup URLs with
site-slugbroke a core Playground workflow: refreshing the same URL to start again with the same parameters.This keeps both properties:
The restore nudge avoids blocking WordPress startup. New Playgrounds also stay temporary until the user chooses whether to restore or keep them, so a discarded fresh site does not consume one of the last 5 autosave slots.
Implementation
Adds autosave metadata for persistence state, last-used time, and setup URL fingerprinting. The fingerprint ignores transient parameters such as
site-slug, modal state, and cache busters.The site selection flow now:
site-slugwhen presentKeep newAutosaves are kept as the last 5 recent autosaves unless the user chooses
Store permanently.The saved Playgrounds UI was adjusted around that model: autosaves appear first, the status indicator owns
Unsaved/Autosavedactions, creation buttons are intent-driven, and GitHub import opens its modal before creating a site.Supporting storage changes let new OPFS Playgrounds become usable before the full initial file copy finishes while still flushing queued writes in the background.
Testing instructions
Automated coverage:
GitHub CI passed on
edcc8ed93with 48 jobs.