You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb369f0
Browse filesBrowse the repository at this point in the historyBrowse files
feat(hub-ui): open a scoped palette for groups without defaultChildId
A group has no view of its own, so activating one by id — its shortcut, a
palette pick, an RPC activation — used to fall back to whichever member
happened to come first. That picked for the user, and a group whose members
are peers has no member worth picking.
Activating a group now opens an unambiguous target directly: the author's
`defaultChildId`, or a lone visible member. With several peer members it opens
the command palette drilled into that group, so the choice stays with the user
and the group is reachable by keyboard alone. Pressing the same shortcut again
closes the palette; stepping back to the root list unscopes it, so the
shortcut drills back in rather than toggling.
`CommandsContext` gains `openPalette(atCommandId?)` and `paletteScopeId`.
Members hang directly off their group in the command tree — the dock bar's
sub-category dividers have no counterpart there, since a category is not
something you can run. A group with no visible member and no reachable
`defaultChildId` registers no command at all.
`switchEntry` is unchanged, so boot restore and `hub:docks:activate` behave
as before.
Copy file name to clipboardExpand all lines: docs/content/1.guide/16.hub.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,22 @@ ctx.commands.register({
51
51
52
52
`args` takes positional [Standard Schema](https://standardschema.dev/) schemas (a single `v.object(...)` unwraps into the input); omit for zero-arg. `safety` defaults to `'action'`; `when` clauses are unenforced for agent calls.
53
53
54
+
## Nested commands
55
+
56
+
A command's `children` nest arbitrarily deep. The palette drills into each level, and every command in the tree is bindable at any depth — a shortcut assigned to a leaf several levels down fires as directly as one on a top-level command, and each appears as its own row under **Settings → Shortcuts**, indented by nesting level.
Set `showInPalette: 'without-children'` on a parent to keep its whole subtree out of root search while leaving it reachable by drilling down.
69
+
54
70
## Cross-iframe dock activation
55
71
56
72
A mounted devframe's iframe uses `hub:docks:activate` to switch the active dock.
@@ -199,7 +215,7 @@ ctx.docks.register({
199
215
title: 'Nuxt',
200
216
icon: 'logos:nuxt-icon',
201
217
category: 'framework',
202
-
defaultChildId: 'nuxt:overview', // optional; popover-only when omitted
218
+
defaultChildId: 'nuxt:overview', // optional; see "Activating a group" below
203
219
})
204
220
205
221
ctx.docks.register({
@@ -212,7 +228,17 @@ ctx.docks.register({
212
228
})
213
229
```
214
230
215
-
Group and members stay independent top-level entries in `devframe:docks`; `defaultChildId` opens on activation. Grouping affects the dock rail, not iframes — to share **one** soft-navigated iframe, give docks a shared `frameId` and mark the anchor with `subTabs` ([Shared-iframe soft navigation](/guide/client-context#shared-iframe-soft-navigation)).
231
+
Group and members stay independent top-level entries in `devframe:docks`. Grouping affects the dock rail, not iframes — to share **one** soft-navigated iframe, give docks a shared `frameId` and mark the anchor with `subTabs` ([Shared-iframe soft navigation](/guide/client-context#shared-iframe-soft-navigation)).
232
+
233
+
### Activating a group
234
+
235
+
Activating a group resolves to one of its members.
236
+
237
+
**Clicking** the dock-rail button opens `defaultChildId` when the group declares one, and reveals the member popover otherwise.
238
+
239
+
**By id** — a keyboard shortcut on the group, a command-palette pick, or a `hub:docks:activate` call — opens the member the group points at: `defaultChildId`, or the only visible member when there is exactly one. A group with several members and no `defaultChildId` opens the command palette listing just those members, so the choice stays with the user and the group remains reachable by keyboard alone. Pressing the same shortcut again closes that palette.
240
+
241
+
Declare `defaultChildId` when one member is the natural landing spot; leave it off when the members are peers.
|`commands`| Command palette: `register()`, `execute()`, `getKeybindings()`, `openPalette(atCommandId?)` — with an id, the palette opens drilled into that command's children and records it in `paletteScopeId` (how [activating a group](/guide/hub#activating-a-group) offers its members). |
44
44
|`renderers`| Dock-renderer registry — `register()`, `get()`, `has()`, `mount(entry, container)`. Routes a dock `type` to a renderer (local boot or the hub's [manifest](/guide/hub-initiate#renderer-modules); local wins). `mount()` resolves a `status`: `mounted` (with `dispose`), `missing-renderer`, or `load-error` (with `error`). |
45
45
|`when`| The [when-clause](/references/when-clauses) context. |
46
46
|`connection`| Live [connection status](/guide/client#handling-connection-and-auth-errors) — `status`, `error`, `events`. |
0 commit comments