feat: add per-group expandable control to button dropdown - #4947
Draft
revezard wants to merge 7 commits into
Draft
feat: add per-group expandable control to button dropdown#4947revezard wants to merge 7 commits into
revezard wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4947 +/- ##
==========================================
- Coverage 97.66% 93.76% -3.91%
==========================================
Files 959 958 -1
Lines 31342 27144 -4198
Branches 11578 9763 -1815
==========================================
- Hits 30610 25451 -5159
+ Misses 686 613 -73
- Partials 46 1080 +1034 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Adds an
expandableflag to ButtonDropdown'sItemGroupthat overrides the dropdown-levelexpandableGroupson a per-group basis:expandable: true— the group renders as an expandable submenu even whenexpandableGroupsis unsetexpandable: false— the group renders inline (flat) even whenexpandableGroupsis setexpandableGroupsvalueThis lets a single dropdown mix expandable and flat groups (e.g. keep high-traffic groups inline
while long/secondary groups collapse into submenus). Expandability is resolved per node via a
small
planeOfplane model rather than a single global flag, so expandable and flat groupscoexist correctly for keyboard navigation on both desktop and in the mobile restricted view.
The change is backward-compatible: with no
expandableflag set, behavior is identical to today.Implemented per design alignment with the Cloudscape team (<name / discussion or issue link>).
Related links, issue #, if available: <link, or n/a>
How has this been tested?
is-group-expandable.test.ts(locks theinherit/override resolution) and new mixed expandable/flat navigation cases in
move-highlight.test.tscovering both desktop plane confinement and the mobile restricted-viewpath (flat-group children reachable, collapsed expandable-group children gated).
button-dropdown/expandableand anew
button-dropdown/expandable-mixeddev page, in both light and dark modes.flat groups and into/out of expandable groups; filtering flattens all groups; toggling
expandableGroupswith per-groupexpandableoverrides behaves as documented.Reviewers can exercise it on the
button-dropdown/expandable-mixeddev page: toggleexpandableGroupsand observe the forced-expandable (true) and forced-flat (false) groups holdtheir behavior while the rest inherit.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
expandableprop documented via JSDoc onItemGroup)expandableGroups; absent flag preserves current behavior)Security
Testing
is-group-expandable.test.ts,move-highlight.test.tsmixed-mode cases)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.