Skip to content

fix(hub-ui): prevent nested docks in popup panels - #487

Open
SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/popup-duplicate-dock
Open

SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/popup-duplicate-dock

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In Popup mode, opening a same-origin tool page that loads the embedded bootstrap can show a second full dock over the tool's content. The bootstrap checks its parent window for the Hub client context, but the Popup does not publish that context.

Publish the existing context on the Popup window before mounting its views, so the iframe recognizes its Hub parent and skips the duplicate dock.

 mountStandaloneApp(context, popup)
   publish connection metadata
+  publish Hub client context on popup
   construct DockStandalone
   mount views

Evidence

  • Before: The regression test identifies the popup as a Hub before mounting its iframe views fails with expected false to be true.
    After: The test passes. It exercises Popup initialization and calls the real parent detector before view construction. All five focused Popup and parent-detector tests pass.
  • Before: The Vite DevTools playground's Nuxt mock and Debug Dashboard show a second full dock inside Popup.
    After: Browser checks with the rebuilt embedded bundle show no nested dock in the Nuxt mock; page switching works. Edge and Float also show no nested dock.
  • pnpm lint, pnpm knip, pnpm test, pnpm typecheck, and pnpm build pass. The full test run reports 1,837 passed and 14 skipped.

Merge Danger

Door: two-way

The change can be reverted without a data migration.

Blast Radius: Popup

The production change publishes the existing context on the Popup window before its views mount. Embedded pages in that window use it to suppress duplicate docks.

@vercel

vercel Bot commented Nov 6, 2026

Copy link
Copy Markdown

@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/487?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-06 14:04 UTC
🔗 head 55fbe5a
🤖 automated by pulls.review

{
  "headSha": "55fbe5a54e7dbae8d6ca8be35876c604e17e1f47",
  "result": {
    "overallSummary": "Fixes a bug where a Popup opening an embedded iframe bootstrap would mount a second nested full dock, because the bootstrap couldn't find the Hub client context on the Popup's parent window. The fix publishes the existing context on the popup before mounting views, with a regression test covering the ordering.",
    "groups": [
      {
        "key": "fix",
        "label": "Publish popup context",
        "summary": "Publishes the existing Hub client context on the Popup window before mounting its views, so iframe bootstraps recognize the parent as a Hub and avoid mounting a second nested dock.",
        "category": "core",
        "filePaths": [
          "packages/hub-ui/src/client/state/popup.ts"
        ],
        "critical": true,
        "lineNotes": [
          {
            "path": "packages/hub-ui/src/client/state/popup.ts",
            "side": "additions",
            "line": 131,
            "text": "Sets the CLIENT_CONTEXT_KEY on the popup window prior to appending the app root, ensuring the context is available by the time iframe content checks its parent window.",
            "critical": true
          }
        ]
      },
      {
        "key": "tests",
        "label": "Popup context regression test",
        "summary": "Adds a regression test that opens a Popup and verifies isInsideHub reports true (and the context is published) before the standalone view is constructed.",
        "category": "tests",
        "filePaths": [
          "packages/hub-ui/src/client/state/popup.test.ts"
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-06T14:04:24.127Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@SaKaNa-Y

SaKaNa-Y commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

before:
截屏2026-11-06 22 01 25

now:
截屏2026-11-06 22 08 45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant