Skip to content

Save Playgrounds by default#3671

Closed
adamziel wants to merge 1 commit into
trunkfrom
feature/save-playgrounds-by-default-core
Closed

Save Playgrounds by default#3671
adamziel wants to merge 1 commit into
trunkfrom
feature/save-playgrounds-by-default-core

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

What it does

Makes new browser Playgrounds autosave to OPFS by default while keeping reusable setup URLs stable. storage=temp and can-save=no still 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 Unsaved and Autosaved actions, including promoting an autosave to a permanent saved Playground.

The URL router preserves reusable setup parameters and only writes site-slug for explicit saved-site navigation. Autosaves are pruned to the recent set unless promoted.

Testing instructions

Ran:

npm exec nx run playground-website:typecheck
npm exec nx test playground-website --testFile=setup-url.spec.ts

Useful E2E coverage to run before merge:

npm exec playwright -- test --config=packages/playground/website/playwright/playwright.config.ts --project=chromium --grep "Default Playground storage"

@adamziel
Copy link
Copy Markdown
Collaborator Author

Superseded by the smaller draft PR stack:\n\n- #3673\n- #3674\n- #3675\n- #3676

@adamziel
Copy link
Copy Markdown
Collaborator Author

Closing in favor of the smaller draft PR stack linked above.

@adamziel adamziel closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant