feat(hub): add render-only visibility to dock entry base declaration#136
Merged
Conversation
Adds a whenexpr-typed `visibility` field alongside `when` on `DevframeDockEntryBase`. It hides only the entry's own dock-bar button while leaving the entry registered and fully reachable (activation, RPC lookups, frame-nav, etc.) — useful for a shared-frame `subTabs` anchor that should surface only its synthesized member tabs, not its own button. `when` remains the general relevance switch for an entry as a whole; `visibility` is a narrower render-only carve-out with the same syntax and the same type-safety in `defineDockEntry`.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 a
visibilityfield alongsidewhenon the dock entry base declaration (DevframeDockEntryBase) — a whenexpr-typed, render-only counterpart towhen.visibilityhides only the entry's own dock-bar button. The entry stays registered and fully reachable:docks.activate()/switchEntry()by id, RPC lookups, and anything else that walks the raw entry list (e.g. thesubTabsframe-nav adapter) keep working exactly as if it were visible.whenremains the general relevance switch for the entry as a whole;visibilityis a narrower carve-out for entries that must stay in the model without a dock-bar button of their own.subTabsanchor: the anchor iframe must stay registered to keep driving the postMessage nav loop, but only its synthesized member tabs should render as dock-bar buttons — setvisibility: 'false'on the anchor to hide just its own button.Changes
packages/hub/src/types/docks.ts— newDevframeDockEntryBase.visibility?: string, cross-referenced fromDevframeViewIframe.subTabs's doc comment.packages/hub/src/define.ts—defineDockEntrytype-checksvisibilitythe same way aswhen(compile-time whenexpr syntax validation).packages/devframe/src/types/devframe.ts— mirrored ontoDevframeDockDefaults(definition-level dock defaults consumed bymountDevframe).packages/hub/src/node/mount-devframe.ts— doc comment update.docs/guide/when-clauses.md— new section documenting the field and thesubTabsuse case.mount-devframe.test.ts(default/override round-trip) andhost.test.ts(proves avisibility: 'false'entry stays indocks.entries, has state, and is activatable viaswitchEntry).This PR was created with the help of an AI agent.