Skip to content

[Website] Autosave after dismissing restore prompts - #4035

Merged
adamziel merged 9 commits into
trunkfrom
website-autosave-dismissal
Jul 14, 2026
Merged

[Website] Autosave after dismissing restore prompts#4035
adamziel merged 9 commits into
trunkfrom
website-autosave-dismissal

Conversation

@adamziel

@adamziel adamziel commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

What this does

Treats dismissing an autosave restore prompt as a decision to keep the Playground that is already open.

A pointer press anywhere outside the prompt—including inside the nested WordPress iframe—dismisses it and autosaves the current Playground. The same path backs Keep this Playground and Stop showing autosave prompts; the latter persists the preference only after that autosave succeeds. Failed saves restore the prompt, and a synchronous guard prevents duplicate restore or dismissal actions before React can disable the controls.

The autosave restore prompt shown by this PR

Testing

  • 5 focused Vitest assertions for durable preferences, nested/dynamic iframe events, and listener cleanup
  • 2 Chromium E2E flows covering WordPress-frame dismissal and the durable opt-out across navigation
  • npm exec nx -- run-many -t lint typecheck -p playground-website --parallel=2

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.

Adds “dismiss = keep current Playground” behavior for the autosave restore prompt, including outside-click detection across nested (same-origin) iframes and a durable “don’t notify me” preference.

Changes:

  • Add cross-iframe pointerdown listener utility with MutationObserver-based tracking.
  • Update restore prompt flow to autosave on dismissal and optionally persist an opt-out preference.
  • Add Vitest coverage for the new utilities and Playwright E2E coverage for the new UX flows.

Reviewed changes

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

Show a summary per file
File Description
packages/playground/website/src/components/ensure-playground-site/listen-for-pointer-down-across-iframes.ts New helper to listen for pointer presses across host + nested same-origin iframe documents.
packages/playground/website/src/components/ensure-playground-site/listen-for-pointer-down-across-iframes.spec.ts Unit tests for nested iframe event delivery and cleanup behavior.
packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx Implements autosave-on-dismiss, outside-click dismissal across nested iframes, and durable opt-out UI.
packages/playground/website/src/components/ensure-playground-site/autosave-restore-preference.ts Adds localStorage-backed preference helpers for disabling restore notifications.
packages/playground/website/src/components/ensure-playground-site/autosave-restore-preference.spec.ts Tests for preference persistence and storage-unavailable degradation.
packages/playground/website/playwright/e2e/website-ui.spec.ts E2E tests for opt-out persistence and WordPress-frame outside-click dismissal.

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

@adamziel
adamziel force-pushed the website-site-settings-actions branch from 2ac5593 to 5b015d2 Compare July 13, 2026 20:13
Base automatically changed from website-site-settings-actions to trunk July 14, 2026 12:28
@adamziel
adamziel requested review from a team and zaerl July 14, 2026 12:28
@adamziel
adamziel force-pushed the website-autosave-dismissal branch from 33f1dcd to 11e73a8 Compare July 14, 2026 12:31
@adamziel
adamziel merged commit 95839d6 into trunk Jul 14, 2026
53 checks passed
@adamziel
adamziel deleted the website-autosave-dismissal branch July 14, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment