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 ac399cf
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(hub,hub-ui): dockPreferences as a createUi() option; DevframeHubUi.setup(ctx)
Dock-bar preferences (categoryOrder / maxVisibleItems / defaultMode /
defaultPosition) are reference-UI rendering concerns, not per-devframe
declarations — move them off `DevframeDefinition.dockPreferences` (removed
from core, along with the `DevframeDockPreferences` type and the hub's
`configs.dock` aggregation) into `createUi({ dockPreferences })`, published
under `ConnectionMeta.configs.ui.dockPreferences` alongside `branding` and
`embeddedVisibility`.
Also replace the `DevframeHubUi.configs` producer with a `setup(ctx)` hook:
the UI slot now publishes its config through the generic `ctx.staticConfig`
(`createUi()`'s setup writes `ctx.staticConfig.ui = { branding, ... }`), so
the hub's mount handler no longer special-cases a `ui` merge.
Built with the help of an agent.
Copy file name to clipboardExpand all lines: docs/guide/hub-initiate.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,23 +57,26 @@ interface DevframeHubUi {
57
57
viewer?: { distDir:string } // a standalone SPA served at the namespace root
58
58
embedded?: { entry:string } // a prebuilt bootstrap served at <base>embedded.js
59
59
assets?:Record<string, () =>string|Uint8Array> // extra UI-owned files
60
-
configs?: () =>Record<string, unknown> // static config, published as ConnectionMeta.configs.ui
60
+
setup?: (ctx) =>void|Promise<void> //publish static config via ctx.staticConfig
61
61
}
62
62
```
63
63
64
-
`@devframes/hub-ui`'s `createUi()` is the reference implementation: a standalone viewer plus the floating dock — one `<script type="module" src="/__devframes/embedded.js">` tag in the host page and the dock mounts itself. A viewer product supplies a different object to the same slot and reuses all the infrastructure.
64
+
`@devframes/hub-ui`'s `createUi()` is the reference implementation: a standalone viewer plus the floating dock — one `<script type="module" src="/__devframes/embedded.js">` tag in the host page and the dock mounts itself. A viewer product supplies a different object to the same slot and reuses all the infrastructure. Its `setup(ctx)` publishes the reference UI's config to `ctx.staticConfig.ui`, which rides `ConnectionMeta.configs.ui` to the client.
65
65
66
-
`createUi()` takes a few options: `branding` (rebrand the reference UI — logo, product name, primary color) and `embeddedVisibility` for the floating dock's reveal policy:
-`'normal'` (default) — the dock is shown immediately.
73
-
-`'passive'` — the dock starts hidden with a console hint; `Shift+Alt+D` reveals it, and the reveal persists per-origin so later sessions start shown.
74
-
-`'hidden'` — the dock starts hidden; `Shift+Alt+D` reveals it for the current session only.
75
-
76
-
Both ride `ConnectionMeta.configs.ui` to the client. Like the float/edge dock mode, `embeddedVisibility` seeds a user-overridable preference — the visitor's own reveal/hide wins from then on.
79
+
Each seeds a user-overridable preference — the config sets the default, the visitor's own choice (reveal/hide, float/edge, …) wins from then on.
0 commit comments