feat(hub): allow per-group and hub-wide dock category order overrides#133
Merged
Conversation
- DevframeViewGroup.categoryOrder overrides the default category order for its members' in-group sub-categories, scoped to that group only. - DevframeClientHostOptions.categoryOrder overrides the top-level dock-bar category order hub-wide. Both mirror DEFAULT_CATEGORIES_ORDER's shape and merge-over-defaults semantics.
✅ 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 two data fields that let a category's default sort order be overridden in scope, without touching the hub-wide
DEFAULT_CATEGORIES_ORDERtable or affecting anything outside the override's scope:DevframeViewGroup.categoryOrder— a group entry can override the sort order of its members' IN-GROUP sub-categories. Scoped to that one group only; every other group and the outer dock-bar ordering are untouched.DevframeClientHostOptions.categoryOrder— the hub (the host app callingcreateDevframeClientHost()) can override the OUTER, top-level dock-bar category ordering across every ungrouped entry and every group button.Both mirror the shape and merge-over-defaults contract of
DEFAULT_CATEGORIES_ORDER(Record<categoryId, weight>, lower sorts earlier, keys merge over the defaults so only the categories being moved need listing).This PR defines the data fields and their contracts; wiring the actual merge into the sort call sites is left for a follow-up.
Changes
packages/hub/src/types/docks.ts— newcategoryOrder?: Record<string, number>onDevframeViewGroup.packages/hub/src/client/host.ts— newcategoryOrder?: Record<string, number>onDevframeClientHostOptions.@devframes/hub/clienttsnapi snapshot for the new public field.This PR was created with the help of an agent.