Skip to content

feat(core): support render-only visibility on dock entries#470

Merged
antfu merged 1 commit into
mainfrom
huge-webs-take
Jul 24, 2026
Merged

feat(core): support render-only visibility on dock entries#470
antfu merged 1 commit into
mainfrom
huge-webs-take

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Description

Bumps devframe/@devframes/hub to ^0.7.13, which lands devframes/devframe#136: a render-only visibility field alongside when on the dock entry base declaration. visibility hides only an entry's own dock-bar button; the entry stays fully registered and reachable (docks.activate()/switchEntry() by id, RPC lookups, the subTabs frame-nav adapter, etc.) — hub deliberately does no filtering of its own, so each viewer implements the actual hiding.

This PR wires that up on the client side:

  • docksGroupByCategories (the single choke point behind the top-level dock bar, group popovers/sidebars, and command-palette group children) now skips entries whose visibility evaluates falsy, mirroring the existing when handling exactly — including the includeHidden escape hatch so the Settings management view keeps listing them.
  • DockEntries's per-button isDockVisible gate gets the same visibility check.
  • No kit-side type changes were needed — every local dock entry type (DevToolsDockEntry, DevToolsViewIframe, DevToolsViewJsonRender, DevToolsViewLauncher, ...) either re-exports or extends the hub's DevframeDockEntryBase, so it inherits visibility?: string automatically from the version bump.
  • Adds a "Render-only visibility" section to docs/kit/when-clauses.md and cross-references from docs/kit/dock-system.md, using the canonical subTabs shared-frame-anchor use case as the example.
  • Adds unit tests in dock-groups.test.ts covering: dropped from the rendered dock bar, still present in the raw entries array, still listed via includeHidden, and evaluated against a whenContext the same way when is.

Linked Issues

Implements the UI side of devframes/devframe#136.

Additional context

test/exports.test.ts's @vitejs/devtools > runtime: . snapshot fails on this branch, but it also fails identically on an unmodified main after a fresh pnpm install — confirmed by reproducing it in a scratch worktree off origin/main — so it's a pre-existing environment/tooling issue unrelated to this change, not something introduced here.


This PR was created with the help of an AI agent.

Bump devframe/@devframes/hub to ^0.7.13, which adds a render-only
`visibility` field alongside `when` on dock entry declarations
(devframes/devframe#136). `visibility` hides only an entry's own
dock-bar button while leaving it fully registered and reachable
(activation, RPC, the subTabs frame-nav adapter).

Wire it into the client-side dock rendering: docksGroupByCategories
(the choke point behind the dock bar, group popovers, edge sidebar,
and command-palette group children) and DockEntries' per-button gate
now skip entries whose `visibility` evaluates falsy, mirroring the
existing `when` handling. The settings management view continues to
list every entry via `includeHidden`, so visibility-hidden entries stay
discoverable there.

Documents the new field and its canonical subTabs-anchor use case in
docs/kit/when-clauses.md and docs/kit/dock-system.md.

Created with the help of an AI agent.
@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@470

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@470

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@470

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@470

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@470

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@470

commit: d7c0048

@antfu
antfu merged commit f4fd723 into main Jul 24, 2026
7 of 10 checks passed
@antfu
antfu deleted the huge-webs-take branch July 24, 2026 09:26
antfubot added a commit to nuxt/devtools that referenced this pull request Jul 24, 2026
Bump `@devframes/hub` to 0.7.13 and adopt its new render-only `visibility`
field (devframe#136): set `visibility: 'false'` on the shared-frame anchor so
only its synthesized per-tab members render, while the entry stays registered
and keeps hosting the shared iframe / driving the frame-nav loop.

This replaces the host-side client-dock override hack that dynamically set
`when: 'false'` after members bootstrapped. The dock-bar button is suppressed
by the viewer once it honors `visibility` (vitejs/devtools#470, @vitejs/devtools
0.4.7); the field is inert on older viewers.
antfubot added a commit to nuxt/devtools that referenced this pull request Jul 24, 2026
Bump `@vitejs/devtools` and `@vitejs/devtools-kit` to 0.4.7, whose viewer
honors the render-only `visibility` field (vitejs/devtools#470). Together with
`@devframes/hub` 0.7.13, the anchor's `visibility: 'false'` now actually
suppresses its dock-bar button while the entry keeps driving the shared frame.
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.

2 participants