Save Playgrounds by default#3671
Closed
adamziel wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Closing in favor of the smaller draft PR stack linked above. |
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 new browser Playgrounds autosave to OPFS by default while keeping reusable setup URLs stable.
storage=tempandcan-save=nostill opt out.Fresh setup URLs continue to show the original query parameters instead of being replaced by
site-slug. Recent autosaves are tracked separately from intentionally saved Playgrounds, and matching autosaves can be restored from a non-blocking nudge.Rationale
Users lose work when a default Playground stays temporary, but replacing setup URLs with saved-site URLs breaks the workflow where refreshing the same URL starts from the same setup parameters.
Autosaving by default preserves user changes without turning setup URLs into one-off site links. The restore nudge handles the case where a user returns to the same setup URL and may want the previous autosaved state.
Implementation
Adds site metadata for persistence, recency, pending OPFS sync, and setup URL fingerprints. The selection flow now creates a temporary setup site first, looks for a recent matching autosave, and autosaves only after the user keeps the fresh site or after the default-save path is safe to persist.
The saved Playgrounds overlay now separates recent autosaves from explicitly saved Playgrounds. The save status indicator owns the
UnsavedandAutosavedactions, including promoting an autosave to a permanent saved Playground.The URL router preserves reusable setup parameters and only writes
site-slugfor explicit saved-site navigation. Autosaves are pruned to the recent set unless promoted.Testing instructions
Ran:
Useful E2E coverage to run before merge: