Render the CardHeader selection menu with the shared SelectionMenu#5102
Open
lukemelia wants to merge 1 commit into
Conversation
The bulk-selection affordance in a stack item's CardHeader used a bespoke dropdown (selection checkmark + count + caret in a BoxelDropdown). Replace it with the shared boxel-ui SelectionMenu so it matches the card chooser's trigger (primary fill, focus ring, caret flip). CardHeaderUtilityMenu now carries `selectedCount` (number) and an optional `label` instead of `triggerText`. The producer (operator-mode stack item) supplies the count and an accessible label. The positioner collapses to shrink-to-fit so the centered card title still doesn't shift when the menu appears. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the operator-mode stack item CardHeader bulk-selection control to use the shared boxel-ui SelectionMenu, aligning the trigger’s visual/interaction behavior (primary fill, focus ring, caret flip) with other selection surfaces and removing the bespoke dropdown trigger implementation.
Changes:
- Replaced the inline
BoxelDropdown-based selection trigger inboxel-uiCardHeaderwith the shared<SelectionMenu @selectedCount @items @label />. - Updated host
stack-itemto provideselectedCountand an accessiblelabelfor the selection trigger. - Updated integration/acceptance tests and the
card-headerusage stub/docs to the newutilityMenushape and trigger selector ([data-test-selection-dropdown-trigger]).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/boxel-ui/addon/src/components/card-header/index.gts | Swaps bespoke selection dropdown trigger for shared SelectionMenu and simplifies the positioning CSS. |
| packages/host/app/components/operator-mode/stack-item.gts | Updates utilityMenu getter to provide selectedCount + accessible label instead of triggerText. |
| packages/boxel-ui/addon/src/components/card-header/usage.gts | Updates the usage example and docs to the new utilityMenu API shape. |
| packages/boxel-ui/test-app/tests/integration/components/card-header-test.gts | Updates the test to assert the new selection trigger selector and utilityMenu shape. |
| packages/host/tests/acceptance/workspace-delete-multiple-test.gts | Updates acceptance test selectors to target the shared selection trigger hook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import Tooltip from '../tooltip/index.gts'; | ||
|
|
||
| export interface CardHeaderUtilityMenu { | ||
| // Accessible name for the trigger; SelectionMenu defaults to the count. |
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.
Part of CS-11366. The bulk-selection affordance in an operator-mode stack item's CardHeader used a bespoke dropdown (selection checkmark + count + caret wrapped in a
BoxelDropdown). This swaps it for the shared boxel-uiSelectionMenuso the trigger matches the card chooser — primary fill, keyboard focus ring, caret flip on open.The menu stays where it is (the card header), per discussion; only the trigger/shell is unified.
Changes
boxel-uicard-header: render<SelectionMenu @selectedCount @items @label />in place of the inline dropdown.CardHeaderUtilityMenunow carriesselectedCount(number) + optionallabelinstead oftriggerText. Removed the now-dead.utility-menu-trigger*CSS;.utility-menu-positionercollapses to shrink-to-fit (right-anchored, grows left) so the centered card title still doesn't shift when the menu appears.hoststack-item: theutilityMenugetter suppliesselectedCountand an accessiblelabelinstead oftriggerText.card-headerusage stub, thecard-headerintegration test, and theworkspace-delete-multipleacceptance test to the new shape/selector (.utility-menu-trigger→[data-test-selection-dropdown-trigger]).Base branch
Targets
cs-11325-…(PR #5100, the sharedSelectionMenu) since that prerequisite isn't merged tomainyet — keeps this diff scoped to just the swap. Will rebase ontomainand retarget once #5100 lands.Testing
boxel-uicard-headerintegration test passes (incl. the title-centering assertion) against a fresh build.hostworkspace-delete-multipleacceptance test still pending a host rebuild to run locally.🤖 Generated with Claude Code