Repository navigation
fix(hub-ui): keep dock selection and restored routes in sync - #497
Open
webfansplz wants to merge 1 commit into
Open
webfansplz wants to merge 1 commit into
webfansplz wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "f57377b0e8124bac1a4903f73d124da1b87a2836",
"result": {
"overallSummary": "Fixes a bug where switching docks (e.g. Vite → Vite Task) and reloading could restore the old dock's saved URL into the new dock's panel. The fix clears the stored route whenever the selected dock ID changes, and on restore only accepts a saved route if it matches the newly selected iframe dock's origin and path (with proper slash-boundary checks to avoid collisions between similarly named docks).",
"groups": [
{
"key": "dock-route-sync",
"label": "Dock route sync fix",
"summary": "Clears the previously selected dock's saved route before switching dock IDs, and validates that a restored route's origin/path actually belongs to the selected iframe dock before reusing it, falling back to the dock's default URL otherwise.",
"category": "core",
"filePaths": [
"packages/hub-ui/src/client/state/context.ts"
],
"critical": true,
"lineNotes": [
{
"path": "packages/hub-ui/src/client/state/context.ts",
"side": "additions",
"line": 112,
"text": "Resetting selectedDockRoute to null on dock change is the core fix: prevents a stale route saved under the old dock from leaking into the newly selected dock on reload."
},
{
"path": "packages/hub-ui/src/client/state/context.ts",
"side": "additions",
"line": 765,
"text": "Boot route is only reused if its origin matches and its path equals or is a sub-path of the dock's base path (slash-boundary check), avoiding false matches between similarly named docks like `vite` and `vite-task`."
}
]
},
{
"key": "tests",
"label": "Dock route persistence tests",
"summary": "Adds regression tests covering route clearing on dock switch and boot-route restoration validation across same/different origin, path-prefix collisions, and malformed URLs.",
"category": "tests",
"filePaths": [
"packages/hub-ui/src/client/state/context.test.ts"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-11-18T07:11:45.164Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
This branch has not been deployed
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.
Problem
The hub remembers the selected dock and the URL its iframe was on (
selectedDockId/selectedDockRoutein session storage), so a reload reopens the same dock at the same page.When the user switches from one iframe dock to another, the new dock ID is saved right away, but the route is only updated after the new iframe mounts. If the page reloads in between, session storage ends up with dock B's ID and dock A's URL. On the next load the hub restores dock B with dock A's URL, so dock B's panel shows dock A's page. Because existing iframe panes are reused, the wrong page stays there until session storage is cleared.
Reproduction
Fix
/boundary, so a dock at/foo/does not accept a route from/foo-bar/.Tests
Added regression cases to
context.test.ts: switching docks clears the route, valid deep links are restored, and routes from other docks, similarly named paths, other ports or protocols, and invalid URLs are rejected. 5 of them fail without the fix; all 26 tests in the suite pass with it.pnpm lint,pnpm knip,pnpm typecheckandpnpm buildpass. In the fullpnpm test, 3 diagnostic type export snapshots fail indevframe,@devframes/plugin-code-serverand@devframes/plugin-terminals; this PR doesn't touch those packages.