Repository navigation
feat(hub): add toggle dock actions and entry descriptions - #469
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "85aa2498be74452a069c95dedc91c3108bddad78",
"result": {
"overallSummary": "Adds a `toggle` mode to `action` dock entries so a click turns an in-page tool (e.g. a Vue component inspector) on/off without stealing the dock selection or opening the panel: the script runs once and is driven by activation events, an open panel is hidden while the tool is on and restored when it turns off (unless another dock takes over), and Escape can stop it via a new command. Also adds an optional `description` shown under a dock button's title in tooltips. Implemented in parity across both client runtimes (`@devframes/hub/client` and hub-ui), with matching UI updates, i18n strings, tests, and docs.",
"groups": [
{
"key": "toggle-action-core",
"label": "Toggle action runtime",
"summary": "Adds the `toggle` option to action dock entries and `setActionActive()` to both runtimes (`@devframes/hub/client` and hub-ui). A toggle action runs its client script once, drives on/off state from `entry:activated`/`entry:deactivated`, never takes the dock selection, and hides/restores the panel while active. Also adds `description` to `DevframeDockEntryBase`.",
"category": "core",
"filePaths": [
"packages/hub/src/client/docks.ts",
"packages/hub/src/client/host.ts",
"packages/hub/src/types/docks.ts",
"packages/hub-ui/src/client/state/context.ts",
"packages/hub-ui/src/client/state/docks.ts"
],
"critical": true,
"fileNotes": [
{
"path": "packages/hub-ui/src/client/state/context.ts",
"text": "Handles the trickiest part: tracking whether the panel was open before a tool turned on (`reopenPanel`), so a new selection wins and skips restoring it, while a direct second toggle does restore it."
},
{
"path": "packages/hub/src/client/host.ts",
"text": "Mirrors the hub-ui logic for the standalone client runtime; keep the two implementations in sync (`switchToggleAction`, `turnOffActions`, `restorePanel`)."
}
]
},
{
"key": "dock-ui-active-tooltip",
"label": "Dock UI active state & tooltips",
"summary": "Updates dock buttons, group popover/sidebar and the dock bar to render an active toggle action (without stealing the selection highlight) and show the dock bar even while an active tool hides the panel, plus a new `description` line under the title in tooltips.",
"category": "ui",
"filePaths": [
"packages/hub-ui/src/client/components/dock/Dock.vue",
"packages/hub-ui/src/client/components/dock/DockEdge.vue",
"packages/hub-ui/src/client/components/dock/DockEntries.vue",
"packages/hub-ui/src/client/components/dock/DockEntry.vue",
"packages/hub-ui/src/client/components/dock/DockGroupButton.vue",
"packages/hub-ui/src/client/components/dock/DockGroupPopover.vue",
"packages/hub-ui/src/client/components/dock/DockGroupSidebar.vue",
"packages/hub-ui/src/client/state/floating-tooltip.ts"
],
"fileNotes": [
{
"path": "packages/hub-ui/src/client/components/dock/DockGroupPopover.vue",
"text": "Adds hover tooltips to popover rows, but only when `description` is set since the row already shows the title as text."
}
]
},
{
"key": "i18n-stop-tool",
"label": "Stop active tool translations",
"summary": "Adds the `command.stopActiveTool` string for the new `devframes:stop-active-tool` Escape command, in all supported locales.",
"category": "i18n",
"filePaths": [
"packages/hub-ui/src/client/i18n/locales/de.json",
"packages/hub-ui/src/client/i18n/locales/en.json",
"packages/hub-ui/src/client/i18n/locales/es.json",
"packages/hub-ui/src/client/i18n/locales/fr.json",
"packages/hub-ui/src/client/i18n/locales/ja.json",
"packages/hub-ui/src/client/i18n/locales/ko.json",
"packages/hub-ui/src/client/i18n/locales/pt-BR.json",
"packages/hub-ui/src/client/i18n/locales/ru.json",
"packages/hub-ui/src/client/i18n/locales/zh-CN.json",
"packages/hub-ui/src/client/i18n/locales/zh-TW.json"
]
},
{
"key": "tests",
"label": "Toggle action tests & snapshots",
"summary": "Covers toggle on/off, selection preservation, panel hide/restore, Escape, `setActionActive`, and the no-restore-on-new-selection case for both runtimes, and updates the public API type snapshots accordingly.",
"category": "tests",
"filePaths": [
"packages/hub/src/client/__tests__/host.test.ts",
"packages/hub-ui/src/client/state/client-script.integration.test.ts",
"tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.d.ts",
"tests/__snapshots__/tsnapi/@devframes/hub/index.snapshot.d.ts"
]
},
{
"key": "docs",
"label": "Documentation updates",
"summary": "Documents toggle actions (new 'Toggle actions' guide section), the `description` field, and renderer expectations for hosts that render dock entries themselves.",
"category": "docs",
"filePaths": [
"docs/content/1.guide/17.client-context.md",
"docs/content/1.guide/22.build-your-own-hub-ui.md",
"docs/content/8.references/6.hub-api.md"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-30T21:39:12.118Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
A `toggle: true` action is an on/off tool, such as an in-page element picker. It never takes the selection: it hides an open panel while on, restores it when off, and its dock button renders as active. A click, `docks.setActionActive(id, false)`, or Escape in hub-ui turns it off. Dock entries also get an optional `description`, shown under the title in the dock button tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
antfubot
force-pushed
the
feat/dock-action-toggle
branch
from
October 30, 2026 21:38
2a8b61c to
85aa249
Compare
This was referenced Oct 30, 2026
This branch was successfully 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.
Why
Nuxt DevTools v4 is built on the hub and the hub UI dock. After 4.0.0, users said:
Nuxt DevTools wants a top-level "Inspect Vue component" dock entry. It turns an in-page element picker (vite-plugin-vue-tracer) on and off, does not open the panel, and shows as active while picking. See https://github.com/nuxt/devtools.
What was missing
An
actionentry already runs a client script. But when a click runs an action:session.open = true;session.open = false) makes the dock bar minimize, so the active highlight is not visible;switchEntry(null)after a pick closes everything;titlein a tooltip, with no room for a longer hint.API
With
toggle: true:entry:activated/entry:deactivated;switchEntry(id)(a click) turns it on or off. It never takes the selection;getStateById(id).isActiveistruewhile it is on. The button renders as active (also inside groups), and the dock bar does not minimize;docks.setActionActive(id, false), or onEscape(newdevframes:stop-active-toolcommand in hub-ui);switchEntry(null), also turns it off. Then the panel is not restored, because the new selection wins.Without
toggle, actions work as before. The scripts that use the currententry:activated+switchEntry(null)pattern (vite-plugin-vue-tracer) keep working.Both runtimes implement this:
createDevframeClientRuntime()(@devframes/hub/client) and the hub-ui context. The reference hosts (custom-hub-vite,custom-hub-next) fire actions by hand and are unchanged, so they stay at parity.Usage
Tooltips
Top-level buttons and the group side rail already showed the
titletooltip. This PR adds the optionaldescriptionunder it. Group popover rows already show the title as text, so they show a tooltip only whendescriptionis set.Tests and docs
packages/hub/src/client/__tests__/host.test.tsandpackages/hub-ui/src/client/state/client-script.integration.test.tscover: on/off, the selection is kept, the panel is hidden and restored, Escape,setActionActive, and turning off without a restore on a new selection.tsnapi).pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm buildall pass.🤖 Generated with Claude Code