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
feat(hub): reinterpret grouped dock entry category as in-group sub-category
Adopt the refined dock-grouping semantics downstream viewers are moving to:
when a dock entry's groupId resolves to a registered group, the group's own
category is the entry's outer dock-bar bucket, and the entry's own category is
reinterpreted as an in-group sub-category. Orphan entries (groupId with no
registered group) keep using their own category as the outer bucket.
- Document the dual role of category/groupId and the group's category on the
types (DevframeDockEntryBase, DevframeViewGroup) plus the hub grouping docs.
- Make the client host's groupByCategory bucket grouped members under their
group's category (default fallback), orphans under their own, so hub's own
groupedEntries agrees with the refined semantics for standalone viewers.
- Reconcile DEFAULT_CATEGORIES_ORDER to put framework first (matching what
Vite DevTools ships) and export it from the main, node and client public
entry points so downstream kits can import the single source of truth.
Created with the help of an agent.
Copy file name to clipboardExpand all lines: docs/guide/client-context.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Boot the host once per page: a second boot replaces the published context and lo
50
50
|----------|-------------|
51
51
|`rpc`| The [RPC client](./client) — call server functions, register client-side functions, access shared state. |
52
52
|`clientType`|`'embedded'` (runtime inside your app) or `'standalone'` (independent hub page). |
53
-
|`docks`| Dock entries and selection — `entries`, `selected`, `groupedEntries`, `switchEntry()`, `toggleEntry()`, `getStateById()`. |
53
+
|`docks`| Dock entries and selection — `entries`, `selected`, `groupedEntries`, `switchEntry()`, `toggleEntry()`, `getStateById()`. `groupedEntries` buckets entries by outer category (a grouped member takes its group's category; see [Grouping dock entries](./hub#grouping-dock-entries)). |
54
54
|`panel`| Dock panel state: position, size, drag/resize flags. |
55
55
|`commands`| The command palette: `register()`, `execute()`, `getKeybindings()`. |
56
56
|`renderers`| Dock-renderer registry — `register()`, `get()`, `has()`, `mount(entry, container)`. Routes a dock `type` to a host-registered renderer (e.g. [JSON-Render](./json-render)); the hub ships none. |
Copy file name to clipboardExpand all lines: docs/guide/hub.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,21 @@ 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.
0 commit comments