Skip to content

Extract SelectionMenu into boxel-ui as a shared component#5101

Closed
lukemelia wants to merge 2 commits into
cs-11325-card-chooser-selection-trigger-reconsider-adorn-pill-vsfrom
extract-card-selection-menu
Closed

Extract SelectionMenu into boxel-ui as a shared component#5101
lukemelia wants to merge 2 commits into
cs-11325-card-chooser-selection-trigger-reconsider-adorn-pill-vsfrom
extract-card-selection-menu

Conversation

@lukemelia
Copy link
Copy Markdown
Contributor

@lukemelia lukemelia commented Jun 3, 2026

Prep for bringing the bulk-selection menu to the workspace cards grid. Extract the selection control out of the card chooser's results header into a generic boxel-ui SelectionMenu, so any surface can adopt it — including the base CardsGrid card, which can only import boxel-ui (not host).

The trigger is a primary BoxelButton

Rather than a bespoke <button>, the trigger is a standard Button @kind='primary', so it inherits the design system's highlight colors, hover, and focus-ring behavior. The component's scoped CSS only adds what Button doesn't: the gap between the checkmark / count / caret, the readable highlight foreground (Button's primary text defaults to --boxel-dark), a tighter radius, the open-state deepening, and the caret flip.

Generic / content-agnostic

The caller supplies the menu contents via @items, so Select All / Deselect All (and the inert count header) stay in the app — built in SearchResultHeader and handed in — and app-specific selection semantics don't leak into the design system. @label sets the trigger's accessible name (the card chooser passes "N cards selected").

Shared icon + card-header dedup

Moved the SelectionCheckmark artwork into boxel-ui (a two-color composite, so it's a component, not part of the generated monochrome icon set) and pointed CardHeader at it — removing a byte-identical inline SVG and advancing CS-11333.

Verification

boxel-ui + host both pass ember-tsc (0 errors), eslint, and prettier; existing selection-menu tests' markup/data-test/aria-label are unchanged. The trigger's rendering now derives from Button (radius/height/hover), so it's worth a fresh in-browser glance.

Stacked on #5100#5099; auto-retargets to main as those merge. (The workspace-grid integration — wiring host selection state into the base card's toolbar — is the follow-up Adorn UI issue.)

🤖 Generated with Claude Code

The "N selected" bulk-selection trigger was a flat teal pill that read as
a regression from the previous dropdown. Keep BoxelDropdown + Menu (the
right primitives for an action menu) and restyle the trigger as a proper
primary dropdown button, modeled on the boxel-ui primary Button / highlight
ContextButton:

- highlight fill with --boxel-highlight-foreground text, deepening to
  --boxel-highlight-hover on hover and while the menu is open
- roomier internal spacing and a taller min-height so the content is no
  longer squished
- keyboard focus draws a ring outside the button and no longer darkens the
  fill (deepening is reserved for hover / open)
- the caret flips to point up while the menu is open

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Preview deployments

Host Test Results

    1 files      1 suites   1h 37m 27s ⏱️
2 931 tests 2 916 ✅ 15 💤 0 ❌
2 950 runs  2 935 ✅ 15 💤 0 ❌

Results for commit 3e1120c.

Realm Server Test Results

    1 files      1 suites   10m 6s ⏱️
1 549 tests 1 548 ✅ 1 💤 0 ❌
1 640 runs  1 639 ✅ 1 💤 0 ❌

Results for commit 3e1120c.

@lukemelia lukemelia changed the title Extract CardSelectionMenu as a shared component Extract SelectionMenu into boxel-ui as a shared component Jun 3, 2026
@lukemelia lukemelia force-pushed the extract-card-selection-menu branch 3 times, most recently from 6e3f470 to 639345b Compare June 4, 2026 02:20
The bulk-selection control (primary dropdown trigger + action menu) lived
inline in the card chooser's results header. Extract it into a generic
boxel-ui SelectionMenu so any surface — including the base CardsGrid card,
which can only import boxel-ui — can adopt it.

The trigger is a standard primary BoxelButton (inheriting the design
system's highlight colors, hover, and focus-ring), with a leading selection
checkmark, the count, and a caret that flips while the menu is open. The
component is content-agnostic: the consumer supplies the menu items via
@Items, so Select All / Deselect All and the inert count header stay in the
app (built in SearchResultHeader) rather than the design system.

Also move the shared SelectionCheckmark artwork into boxel-ui and reuse it
in CardHeader, removing a duplicated inline SVG (advances CS-11333).

No behavior change for the card chooser: same markup, data-test hooks,
aria-label, and menu items.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lukemelia lukemelia force-pushed the extract-card-selection-menu branch from 639345b to 3e1120c Compare June 4, 2026 02:25
@lukemelia lukemelia force-pushed the cs-11325-card-chooser-selection-trigger-reconsider-adorn-pill-vs branch from ed0f9c7 to 2746dc8 Compare June 4, 2026 02:37
@lukemelia
Copy link
Copy Markdown
Contributor Author

[Claude Code 🤖] Folding this into #5100 for review — the extraction reworks the same selection trigger that PR introduces, so reviewing them together avoids reviewing intermediate state that this PR immediately replaces. #5100 now contains the full change (squashed): the primary-dropdown trigger + the boxel-ui SelectionMenu extraction + the SelectionCheckmark dedup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant