feat(hub): client-registered client-only docks via docks.register/update#129
Merged
Conversation
Let a client host contribute dock entries that live only in the page, merged with the server docks from shared state without syncing back to the hub or other viewers — mirroring the client commands.register pattern.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Register a client-only "Client Notes" dock on the client host context in both minimal hub examples, source the dock list from the merged context.docks.entries, and show update()/dispose() on the returned handle.
antfubot
added a commit
that referenced
this pull request
Jul 23, 2026
Implement the hub side of the shared-iframe soft-nav design: extend DevframeViewIframe with navTarget + a subTabs anchor flag (and NavTarget / FrameSubTabsConfig types), and ship a viewer-side frame-nav adapter (attachFrameNavClient) that the client host auto-attaches to a subTabs anchor iframe. The adapter runs a versioned, origin-locked host<->iframe postMessage handshake, materializes one client-only member dock per reported tab (via the client docks.register from #129, keyed <frameId>:<tabId>), and drives a bidirectional nav loop: selecting a member posts navigate; the app's navigated report moves the dock highlight. An idempotent guard breaks the echo, a declarative manifest snapshot reconciles add/update/remove (clearing selection when the active tab vanishes), and a handshake timeout degrades to no-shim (anchor stays a single plain iframe dock). Grouping stays orthogonal to frameId and follows the #130 category rule. Covered by client host + adapter tests; hub API snapshots updated.
This was referenced Jul 23, 2026
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.
What
Adds client-side
docks.register()anddocks.update()to the hub's client host context (DevframeClientContext.docks), so a client host can contribute dock entries that live only in the page.Why
Until now the client could only consume docks projected from the node hub via the
devframe:docksshared state. There was no way for a host page to synthesize a dock of its own. This mirrors the existing clientcommands.register()pattern (a local map merged with the read-only server source), giving symmetry between the two client-side registries.Behavior
docks.register(entry, force?)adds a client-only entry — never written to shared state, so it stays local to this client instead of syncing to the hub or other viewers. Returns a handle withupdate(patch)(id immutable) anddispose().docks.update(entry)replaces a previously client-registered entry wholesale.docks.entries/groupedEntries, participate in selection/entryToStateMap, and load their client scripts exactly like server docks. A client dock sharing an id with a server dock overrides it locally.forceis passed; updating an unknown id throws.Notes
DockRegistration<T>type exported from@devframes/hub/client; tsnapi client API snapshot updated accordingly.This PR was created with the help of an agent.