Skip to content

[Website] Delay autosave nudge until dismissal can save the new Playground - #3823

Merged
adamziel merged 1 commit into
trunkfrom
autosave-restore-nudge-boot
Jul 7, 2026
Merged

[Website] Delay autosave nudge until dismissal can save the new Playground#3823
adamziel merged 1 commit into
trunkfrom
autosave-restore-nudge-boot

Conversation

@adamziel

@adamziel adamziel commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What it does

Delays the autosave restore nudge until the fresh matching Playground can be saved, so No, thanks no longer runs before the new Playground has an active client.

The site-selection flow and popover actions are unchanged. This PR only gates rendering of the nudge until the active site:

  • is not the autosave being offered for restore;
  • has a PlaygroundClient;
  • matches the nudge’s setup URL fingerprint.

Rationale

When a matching autosave exists, the restore nudge could appear before the fresh temporary Playground had an active PlaygroundClient. If the user clicked No, thanks during that window, autosaveTemporarySite() tried to save before persistTemporarySite() could find a client.

That produced:

must have an active client to be saved

and left the user at the same restore prompt.

Waiting to show the nudge keeps the fix local to the popover display and avoids changing the app’s site-selection flow.

Testing instructions

npm exec nx run playground-website:lint
npm exec nx run playground-website:typecheck

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.

Adjusts the restore-autosave nudge flow so users can’t dismiss it (“No, thanks”) before the fresh temporary Playground has fully booted, avoiding autosave attempts without an active client.

Changes:

  • Capture the temporarySiteSlug from createNewTemporarySite() and store it in autosaveNudge state.
  • Use the captured temporarySiteSlug when calling autosaveTemporarySite() on nudge dismissal.
  • Add a Playwright regression test covering immediate dismissal of the restore nudge after reloading a setup URL.

Reviewed changes

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

File Description
packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx Gate nudge rendering until a temporary site is created; autosave the correct site slug on dismissal.
packages/playground/website/playwright/e2e/website-ui.spec.ts Add Chromium-only regression test for immediate restore-nudge dismissal behavior.

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

Comment thread packages/playground/website/playwright/e2e/website-ui.spec.ts Outdated
Comment thread packages/playground/website/playwright/e2e/website-ui.spec.ts Outdated
@adamziel adamziel changed the title [Website] Gate autosave restore nudge on fresh Playground boot Jun 24, 2026
@adamziel
adamziel force-pushed the autosave-restore-nudge-boot branch from b8d72d0 to 9474f97 Compare June 24, 2026 08:34
@adamziel adamziel changed the title [Website] Wait for new Playground before showing autosave restore prompt Jun 24, 2026
@adamziel
adamziel force-pushed the autosave-restore-nudge-boot branch 9 times, most recently from ce0d8bb to ad16e0b Compare July 7, 2026 18:44
@adamziel
adamziel force-pushed the autosave-restore-nudge-boot branch 4 times, most recently from e4044dd to bbabfcd Compare July 7, 2026 20:31
@adamziel adamziel changed the title [Website] Keep autosave restore prompt usable while Playground boots Jul 7, 2026
@adamziel
adamziel force-pushed the autosave-restore-nudge-boot branch 2 times, most recently from 5c757bf to c32a3d9 Compare July 7, 2026 22:24
@adamziel adamziel changed the title [Website] Queue autosave dismissal until the new Playground can be saved Jul 7, 2026
@adamziel
adamziel force-pushed the autosave-restore-nudge-boot branch from c32a3d9 to 01d331e Compare July 7, 2026 23:08
@adamziel adamziel changed the title [Website] Delay autosave nudge until the new Playground can be saved Jul 7, 2026
@adamziel
adamziel merged commit f4cf855 into trunk Jul 7, 2026
53 checks passed
@adamziel
adamziel deleted the autosave-restore-nudge-boot branch July 7, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment