Skip to content

[Website] Preserve selected Query API parameters when starting over after an error - #4123

Merged
adamziel merged 1 commit into
trunkfrom
error-recovery-preserve-shell-parameters
Jul 20, 2026
Merged

[Website] Preserve selected Query API parameters when starting over after an error#4123
adamziel merged 1 commit into
trunkfrom
error-recovery-preserve-shell-parameters

Conversation

@adamziel

@adamziel adamziel commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Part of #4099.

Start without a Blueprint previously assigned a new location.href. That reloaded the entire application and discarded the current pathname and parameters used by the surrounding integration along with the failed setup.

The action now builds a fresh Playground URL through PlaygroundRoute.newSite(), restores mode, url, page-title, mcp, mcp-port, and can-save, and passes it to the existing in-app router. All other query parameters, the Blueprint hash, storage selection, and site route remain discarded. Saved-site routing is unchanged.

The affected action is the blue button in the lower-right corner:

Error modal showing Start without a Blueprint

Testing

Trigger an error from a non-root URL containing both retained and setup parameters. Choose Start without a Blueprint and confirm a fresh Playground starts in place, the pathname and retained parameters remain, and the failed setup does not run again.

@adamziel adamziel changed the title [Website] Preserve shell parameters when starting over after an error Jul 20, 2026
@adamziel
adamziel marked this pull request as ready for review July 20, 2026 18:31
@adamziel
adamziel requested review from a team, Copilot and mho22 July 20, 2026 18:31

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.

Updates “Start without a Blueprint” (error recovery) navigation so that it keeps the current pathname and a small set of “shell” Query API parameters, while ensuring setup/blueprint parameters are dropped to avoid re-triggering the failed setup.

Changes:

  • Centralized the list of preserved “shell” query parameters and refactored URL param preservation into a helper.
  • Added PlaygroundRoute.newSitePreservingShell() and updated the error modal recovery action to use it.
  • Added unit test to verify only shell params (and pathname) are preserved during recovery navigation.

Reviewed changes

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

File Description
packages/playground/website/src/lib/state/url/router.ts Introduces shell param key list, newSitePreservingShell, and a helper to copy selected query params.
packages/playground/website/src/lib/state/url/router.spec.ts Adds test coverage for the new recovery URL behavior.
packages/playground/website/src/components/site-error-modal/site-error-modal.tsx Switches “Start without a Blueprint” to use the new route helper.

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

Comment thread packages/playground/website/src/lib/state/url/router.ts Outdated
Comment thread packages/playground/website/src/lib/state/url/router.ts Outdated
@adamziel
adamziel force-pushed the error-recovery-preserve-shell-parameters branch 4 times, most recently from 9ff4bc0 to e4d16c0 Compare July 20, 2026 19:20
…fter an error

"Start without a Blueprint" resets the entire document and drops parameters
owned by the surrounding integration along with the failed setup.

Build a fresh Playground URL from the existing route, restore only the
embedding mode, target URL, page title, MCP connection, and saving policy, then
send it through the in-app router. The failed setup, storage selection, and site
route remain discarded without reloading the application.

Exercise the failed-Blueprint recovery in Playwright and keep a marker on the
current document so the test fails if this turns back into a page navigation.
@adamziel
adamziel force-pushed the error-recovery-preserve-shell-parameters branch from e4d16c0 to 75d54e8 Compare July 20, 2026 19:34
@adamziel
adamziel merged commit 2ebd49d into trunk Jul 20, 2026
102 of 103 checks passed
@adamziel
adamziel deleted the error-recovery-preserve-shell-parameters branch July 20, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment