[Website] Ask before reloading edited Blueprint fragments - #4089
Merged
adamziel merged 3 commits intoJul 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a hashchange confirmation flow so that changing the Blueprint fragment in the URL prompts the user to reload (to boot the new Blueprint) or reverts the URL (to keep the current running Playground consistent).
Changes:
- Introduces
confirmReloadWithNewBlueprintto intercept hash-only URL changes and either reload or restore the previous URL. - Adds a one-time global
hashchangelistener guarded by aSymbol.for(...)patch key. - Adds unit tests covering accept/decline flows and ignoring hash removal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/url/router-hooks.ts | Adds hashchange interception + confirmation/revert logic for Blueprint fragment changes. |
| packages/playground/website/src/lib/state/url/router-hooks.spec.ts | Adds tests for the new hashchange confirmation behavior. |
💡 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.
Changing or removing a Blueprint fragment now asks whether to reload. Without a reload, the address bar can describe a different Blueprint than the running Playground.
Blueprint fragments are read when Playground boots. Before this PR, editing or removing the fragment changed the URL but did nothing to the running instance. Accepting the browser prompt now reloads the page. A replacement fragment boots its Blueprint; removing the fragment boots without a URL Blueprint. Canceling restores the previous URL.
Screencast:
fragment-confirm.mp4
Testing
Open Playground with a Blueprint fragment and replace it with another encoded Blueprint. Cancel and check that the previous URL returns. Repeat and accept to check that the new Blueprint loads. Then remove the fragment and check that accepting the prompt reloads without a URL Blueprint.