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/guide/hub.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,8 +199,42 @@ ctx.docks.register({
199
199
200
200
`groupId` lives on every entry kind, so iframes, launchers, custom-render views, and integration-contributed types (e.g. json-render panels) all join groups the same way. The group and its members stay independent top-level entries in `devframe:docks`; a downstream UI derives the visual collapse by matching each member's `groupId` to the group's `id` and renders members in a popover or sub-navigation. `defaultChildId` names the member opened when the group button is activated.
201
201
202
+
### The dual role of `category`
203
+
204
+
`category` decides an entry's outer bucket on the dock bar (ordered by `DEFAULT_CATEGORIES_ORDER`) — but its meaning shifts once an entry joins a group:
205
+
206
+
-**Ungrouped entry** — `category` is the entry's outer dock-bar bucket, defaulting to `'default'`.
207
+
-**Grouped entry** (a `groupId` that resolves to a registered group) — the outer bucket comes from the **group's** own `category` instead. The member's own `category` is reinterpreted as an **in-group sub-category** that sub-divides and sorts members inside the group's popover / sub-navigation.
208
+
209
+
The group's `category` is therefore the single outer bucket shared by the group button and all its members. Fallbacks keep the rule total:
210
+
211
+
- A **group** with no `category` buckets itself and its members under `'default'`.
212
+
- A grouped **member** with no `category` defaults its in-group sub-category to `'default'`.
213
+
-**Orphan tolerance** — a member whose `groupId` never resolves to a registered group renders as a normal top-level entry and uses its **own**`category` as the outer bucket, exactly as an ungrouped entry does.
214
+
215
+
In the example above, `nuxt:overview` renders under the `framework` bucket (from the `nuxt` group) even though it could carry its own `category`; that own `category` would only sort it against sibling members inside the Nuxt group.
216
+
202
217
Grouping is one level deep: members join a group, and a group is always a top-level button. A member whose group is never registered renders as a normal top-level entry, so registration order is free.
203
218
219
+
#### Known categories
220
+
221
+
`DEFAULT_CATEGORIES_ORDER` (exported from `@devframes/hub`, `@devframes/hub/node`, `@devframes/hub/client` and `@devframes/hub/constants`) names the buckets the hub orders by default, reading from "closest to your app" toward "peripheral":
|`~builtin`|`1000`| The viewer's own built-in views; always last. |
235
+
236
+
The gaps are intentional — a kit can interleave its own category ids (or override any weight) without editing this table. An unknown category sorts as weight `0`.
237
+
204
238
## The protocol — what the UI sees
205
239
206
240
A hub-aware UI doesn't import any hub classes; it reads three shared-state keys and one RPC method:
0 commit comments