[Website] Avoid autosave prompts in embedded Playground#3707
Merged
Conversation
a615945 to
56e9174
Compare
56e9174 to
d416d96
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Hides autosave/save UI and skips autosave site creation when the Playground shell is in seamless mode or embedded in an iframe, in addition to the existing can-save=no query parameter check.
Changes:
- Replaced
isSaveDisabledByQueryParam()with a broaderisSiteSavingDisabled(url, win)helper that also detectsmode=seamlessand iframe embedding (including cross-origin parents). - Updated all call sites (
BrowserChrome,TemporarySiteNotice,EnsurePlaygroundSiteIsSelected) to use the new helper. - Added unit tests for the new helper and Playwright tests verifying the save status indicator is hidden in seamless and embedded shells.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/url/router.ts | Renames/extends saving-disabled check to include seamless mode and iframe embedding. |
| packages/playground/website/src/lib/state/url/router.spec.ts | Adds unit tests covering the new conditions. |
| packages/playground/website/src/components/site-manager/temporary-site-notice/index.tsx | Updates import/usage to new helper. |
| packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx | Uses new helper when deciding to use a temporary site; updates comments. |
| packages/playground/website/src/components/browser-chrome/index.tsx | Hides SaveStatusIndicator based on new helper. |
| packages/playground/website/playwright/e2e/website-ui.spec.ts | Adds e2e tests for seamless and iframe-embedded shells. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 changed
Don't offer restoring an autosaved Playground in Playgrounds:
?mode=seamless?can-save=noThere's no way to manage Playgrounds under those circumstances and the user expectation is just getting a fresh Playground instance.
Screenshots
Before, the browser-saving status/action is visible:
After, the save/autosave status is hidden when saving is disabled by the shell:
Testing
git diff --check HEAD^ HEADnpm exec -- nx test playground-website -- --testFile=router.spec.ts