Repository navigation
fix(hub-ui): resolve dock iframe paths against the hub in cross-origin embeds - #518
Open
webfansplz wants to merge 1 commit into
Open
webfansplz wants to merge 1 commit into
webfansplz wants to merge 1 commit into
Conversation
|
@webfansplz is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "c7f994349869d94ebf65016913048e2bcec074db",
"result": {
"overallSummary": "Fixes a 404 when the hub-ui dock is embedded on a different origin than the hub: server-registered iframe docks with relative/root paths are now resolved against the hub's own origin (using `resolveDockUrl`) rather than the embedding page's origin, so the iframe loads correctly on first open and still restores its saved route after refresh. A regression test is added to cover this scenario alongside existing local-dock behavior.",
"groups": [
{
"key": "fix-cross-origin-dock-url",
"label": "Resolve dock iframe URLs",
"summary": "When the dock is embedded cross-origin, server-registered iframe paths starting with `/`, `./` or `../` are now resolved against the hub's origin (via `resolveDockUrl`) instead of the embedding page's origin, fixing 404s on first load.",
"category": "core",
"filePaths": [
"packages/hub-ui/src/client/state/context.ts"
],
"lineNotes": [
{
"path": "packages/hub-ui/src/client/state/context.ts",
"side": "additions",
"line": 58,
"text": "Cross-origin detection compares the hub's metaBaseUrl origin to the current page origin; only applies when embedded and not a locally-registered client dock.",
"critical": true
}
]
},
{
"key": "dock-url-tests",
"label": "Dock route persistence tests",
"summary": "Adds a regression test covering cross-origin iframe URL resolution, saved-route restoration, and that locally registered docks keep their original (non-resolved) URLs.",
"category": "tests",
"filePaths": [
"packages/hub-ui/src/client/state/context.test.ts"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-12-02T09:46:33.030Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the cross-origin dock iframe URL fix.
No open issues 🎉
What changed in this PR
Fixes dock iframe URLs in cross-origin embeds so server-registered paths load from the hub rather than the embedding page.
Changes:
- Resolves
/,./, and../iframe paths against the hub, preserving bare paths and locally registered docks. - Adds regression coverage for URL resolution, saved-route restoration, and local overrides.
| File | Description |
|---|---|
| packages/hub-ui/src/client/state/context.ts | Resolves server-registered iframe paths in cross-origin embeds. |
| packages/hub-ui/src/client/state/context.test.ts | Tests URL resolution, route restoration, and preserved overrides. |
Review effort: Balanced
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.
Fix the iframe 404 reported in vitejs/devtools#570 by resolving server-registered iframe paths against the hub’s origin when the dock is embedded on another origin.
Verified in Chrome with the page and hub on separate ports. The iframe loads on first open and restores its saved route after refresh.