feat(devframe,hub,hub-ui): static connection-meta configs + plugin-declared dock layout - #227
Merged
Merged
Conversation
…clared dock layout Add ConnectionMeta.configs — an augmentable, boot-time, read-only-from-the- browser config channel, distinct from the mutable/shared-state-synced ctx.settings and devframe:user-settings. Each key is contributed via declaration merging against DevframeConnectionConfigsRegistry. Ports vitejs/devtools#515 (plugin-declared dock ordering, layout, and window defaults) on top of it: DevframeDockDefaults gains categoryOrder, maxVisibleItems, defaultMode, and defaultPosition. The hub aggregates them across every installed devframe (last-installed wins per scalar, categoryOrder shallow-merged) into ConnectionMeta.configs.dock, folded into the dock bar's category sort, the floating dock's inline-item capacity, and a first-run visitor's mode/position seed. hub-ui's branding moves off the ad-hoc branding.json asset route onto configs.ui.branding, delivered through the one connection handshake the dock already performs instead of a separate fetch. createUi({ branding }) keeps its existing signature. Built with the help of an agent.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…e branding channels
Follows up on review feedback:
- Adds ctx.configs (DevframeConfigsHost) as a core devframe context
primitive — the generic API for contributing to a context's own
ConnectionMeta.configs, resolved once (instance-shell) after every
contributor has run and baked into the served meta for every host
adapter, not just the hub. Contributors own their own merge semantics
via an (current) => next updater.
- installDevframe now calls ctx.configs.contribute('dock', ...) instead
of a docks-specific contributeDockConfig; dockConfig/contributeDockConfig
are removed from DevframeDocksHost — dock-bar config aggregation isn't
a docks-registry concern.
- DevframeHubUi.settings renamed to configs, matching the
ConnectionMeta.configs.ui wire shape it feeds.
- hub-ui's resolveBranding drops the host-page override channels
(window.__DEVFRAME_BRANDING__, <script data-*>, ?query params) —
ConnectionMeta already has its own cross-realm propagation, so
branding needs no globals or query params of its own.
Built with the help of an agent.
Ports vitejs/devtools#465 (passive/hidden overlay) to the reference UI, but as one config field instead of the upstream three-client-entries approach. `createUi({ embeddedVisibility })` publishes `ConnectionMeta.configs.ui.embeddedVisibility`: - `normal` (default) — the floating dock shows immediately. - `passive` — starts hidden with a console hint; Shift+Alt+D reveals it, and the reveal persists per-origin so later sessions start shown. - `hidden` — starts hidden; Shift+Alt+D reveals it for the session only. Like the float/edge dock mode, it seeds a user-overridable preference: the config sets the default, the visitor's own reveal/hide wins from then on. The "Hide" command now conceals (toggleable back via the shortcut) rather than tearing the dock down for the session. Built with the help of an agent.
…eferences Applies review feedback: - `ctx.configs` (the `DevframeConfigsHost` with `contribute`/`resolve`) is now `ctx.staticConfig` — a plain, non-reactive `Partial<DevframeConnectionConfigsRegistry>` object mutated at setup time. Drops the host class and its test; the instance shell serializes the object straight into `ConnectionMeta.configs`. - The hub-wide dock-bar preferences (`categoryOrder` / `maxVisibleItems` / `defaultMode` / `defaultPosition`) move off the per-entry `DevframeDockDefaults` into a dedicated `DevframeDockPreferences` type, declared on the new `DevframeDefinition.dockPreferences`. `installDevframe` aggregates it into `ctx.staticConfig.dock`; the hub's `configs.dock` registry key now points at `DevframeDockPreferences` (the `DevframeDockConfig` alias is gone). Built with the help of an agent.
…eHubUi.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.
…table The reference-viewer toggles baked into the hub's `DevframeDocksUserSettings` move to `@devframes/hub-ui` via declaration merging, mirroring the pattern used for branding / embeddedVisibility / dockPreferences: - `@devframes/hub` keeps only the generic dock-registry + command model every viewer shares: `docksHidden`, `docksCategoriesHidden`, `docksPinned`, `docksCustomOrder`, `commandShortcuts` (the last read by the framework-neutral `createDevframeClientHost`). `DEFAULT_STATE_USER_SETTINGS` drops the UI toggles. - `@devframes/hub-ui` augments `DevframeDocksUserSettings` with its own reference-viewer toggles — `showIframeAddressBar`, `closeOnOutsideClick`, `autoCollapseEdgeToolbar`, `showDevframeInspector` (all optional). The old `HubDocksUserSettings extends …` type is gone; hub-ui now consumes the augmented base directly. Built with the help of an agent.
The API-snapshot suite auto-discovers workspace packages, but depending on the installed layout (pnpm `shamefullyHoist`) that discovery can walk into `node_modules` and try to snapshot dependencies like `@babel/runtime`, crashing on their directory-valued `exports` (`EISDIR`). Skip any discovered package under `node_modules` so only first-party workspace packages are snapshotted — fixing the intermittent CI failure. Built with the help of an agent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ConnectionMeta.configs— an augmentable, boot-time, read-only-from-the-browser config channel delivered once through the connection handshake every devframe already performs. Contrast withctx.settings/devframe:user-settings, which are mutable and synced bidirectionally over shared-state RPC:configsis one-way and fixed for the life of the server, contributed via declaration merging againstDevframeConnectionConfigsRegistry.On top of it, ports vitejs/devtools#515 (plugin-declared dock ordering, layout, and window defaults):
DevframeDockDefaultsgainscategoryOrder,maxVisibleItems,defaultMode,defaultPosition— a devframe's opinion about the hub-wide dock bar, not attributes of its own synthesized entry.categoryOrdershallow-merged) intoConnectionMeta.configs.dock, computed once after every devframe has installed.createDevframeClientHost({ categoryOrder })host option along the way — it was typed and documented but never wired into the actual grouping), the floating dock's inline-item capacity, and a first-run visitor's mode/positionlocalStorageseed.Also moves
@devframes/hub-ui's branding off the ad-hocbranding.jsonasset route ontoconfigs.ui.branding, delivered through the one connection handshake the dock already performs instead of a separate fetch.createUi({ branding })keeps its existing signature — only the delivery mechanism changed. The hub stays policy-free about what "ui" means:DevframeHubUigains asettingsproducer parallel toassets, embedded verbatim underconfigs.ui.Notes
branding.jsonis removed outright rather than kept as a compat shim.maxVisibleItemsreuses the existing silent clamp inresolveDockLayout.pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm buildall pass; tsnapi snapshots updated for the new public API surface.Built with the help of an agent.