fix(core): land a subTabs anchor on its live member tab, not the hidden anchor - #473
Merged
Merged
Conversation
…en anchor A group whose `defaultChildId` points at a `visibility: 'false'` subTabs anchor booted the shared frame correctly, but every later activation re-selected the invisible anchor itself — leaving no dock highlighted and the group button reading as inactive. `switchEntry` now tracks the shared frame's current member tab per `frameId` and, when a `subTabs` anchor is selected after the frame has reported a tab, redirects to that live member so a visible dock stays highlighted. The first boot (no member yet) still selects the anchor to mount its iframe. Dogfood the pattern in the core playground by hiding the Nuxt anchor with `visibility: 'false'`, and cover the group→anchor→member flow with regression tests.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
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.
Description
Follow-up to #472. That PR fixed a group whose
defaultChildIdpoints at avisibility: 'false'subTabs anchor so the group button stays reachable and clicking it boots the shared frame. But the three features still didn't play well together: every activation after the first re-selected the invisible anchor itself, so no dock ended up highlighted and the group button read as inactive.Root cause: a
subTabsanchor has no view of its own — it only exists to mount the shared iframe, and its synthesized member tabs (<frameId>:<tabId>) render the real buttons.defaultChildId→ anchor is a bootstrap hook, so selection lingered on a dock that is deliberately hidden from the bar.switchEntry(packages/core/src/client/webcomponents/state/context.ts) now tracks the shared frame's current member tab perframeId. When asubTabsanchor is selected after the frame has reported a tab — via a groupdefaultChildId, the command palette, or an RPC activation — it redirects to that live member so a visible dock stays highlighted. The very first boot, before any member exists, still selects the anchor to mount its iframe; if the remembered member is later disposed (manifest empties), it falls back to booting the anchor afresh.To verify the fix, the core playground now dogfoods the real-world pattern by hiding the Nuxt anchor with
visibility: 'false'(the anchor drives the nav loop; only its Overview/Pages/… member tabs get their own buttons). Added regression tests over the full group →defaultChildId→ hidden anchor → member flow (first-boot, re-selection, group re-open, and the disposed-member fallback).Linked Issues
Follow-up to #472.
Additional context
Verified with
pnpm exec vitest run(358 passing),pnpm build,vue-tsc -b, andeslinton the touched files, all clean. The one remainingeslinterror (packages/core/src/node/ws.tsimport order) pre-exists onmainand is unrelated to this change.This PR was created with the help of an AI coding agent.