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
Copy file name to clipboardExpand all lines: docs/content/1.guide/16.hub.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,22 @@ ctx.commands.register({
46
46
47
47
`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.
48
48
49
+
## Nested commands
50
+
51
+
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.
64
+
49
65
## Cross-iframe dock activation
50
66
51
67
A mounted devframe's iframe uses `hub:docks:activate` to switch the active dock.
@@ -181,7 +197,7 @@ ctx.docks.register({
181
197
title: 'Nuxt',
182
198
icon: 'logos:nuxt-icon',
183
199
category: 'framework',
184
-
defaultChildId: 'nuxt:overview', // optional; popover-only when omitted
200
+
defaultChildId: 'nuxt:overview', // optional; see "Activating a group" below
185
201
})
186
202
187
203
ctx.docks.register({
@@ -194,7 +210,19 @@ ctx.docks.register({
194
210
})
195
211
```
196
212
197
-
Group and members stay independent top-level entries in `devframe:docks`. Activating the group reopens the member last opened in it (remembered per tab), and `defaultChildId` before any member has been opened. 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)).
213
+
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)).
214
+
215
+
### Activating a group
216
+
217
+
Activating a group resolves to one of its members.
218
+
219
+
The dock rail button reopens the member last opened in the group (remembered per tab), then `defaultChildId`; with neither, it reveals the member popover.
220
+
221
+
A group command, activated by its keyboard shortcut or a command-palette pick, opens that same remembered or default member, then the only visible member when there is exactly one. With several visible peers and no preferred member, it opens the command palette scoped to those members, so the choice stays with the user. Pressing the same shortcut again closes that palette.
222
+
223
+
`hub:docks:activate` follows programmatic dock switching: it opens the remembered or default member, then the first registered member.
224
+
225
+
Declare `defaultChildId` when one member is the natural landing spot; leave it off when the members are peers.
|`commands`| Command palette: `register()`, `execute()`, `getKeybindings()`, `paletteOpen`, `paletteScopeId`, `openPalette(atCommandId?)`. Passing an id opens the palette drilled into that command's children ([Activating a group](/guide/hub#activating-a-group)). |
110
110
|`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`). |
111
111
|`when`| The [when-clause](/references/when-clauses) context. |
112
112
|`connection`| Live [connection status](/guide/client#handling-connection-and-auth-errors): `status`, `error`, `events`. |
0 commit comments