Skip to content

CS-10688: Add selected items summary section to Picker dropdown#4367

Open
FadhlanR wants to merge 5 commits intomainfrom
cs-10688-defer-reordering-selected-items-to-top-until-dropdown-is-reopened
Open

CS-10688: Add selected items summary section to Picker dropdown#4367
FadhlanR wants to merge 5 commits intomainfrom
cs-10688-defer-reordering-selected-items-to-top-until-dropdown-is-reopened

Conversation

@FadhlanR
Copy link
Copy Markdown
Contributor

@FadhlanR FadhlanR commented Apr 9, 2026

Summary

Problem: The previous Picker reordered selected items to the top of the dropdown list. When a user selected an item and moved their cursor away, the item would jump to the top of the list. This caused confusion because:

  • Items shifted position unexpectedly while the dropdown was open
  • Users lost their place in the list after each selection
  • The visual instability made multi-selection feel unreliable

Solution: Replace the reorder-based approach with a "shopping cart" pattern:

  • Selected items shown in a summary section at the top of the dropdown (using PickerOptionRow for visual consistency)
  • Main option list stays in original order — items never jump around
  • Select-all rendered in before-options section above the summary
  • Users can toggle selection from both the summary section and the main list
  • Removed all snapshot/pinning/hover reorder logic, simplifying the component significantly
Screen.Recording.2026-04-10.at.16.43.06.mov

Test plan

  • All 24 picker integration tests pass
  • Lint passes (pnpm lint in boxel-ui/addon)
  • Manual verification: open dropdown, select/deselect items — main list stays stable, summary updates
  • Verify search + summary interaction (summary persists during search)
  • Test with RealmPicker and TypePicker consumers

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Host Test Results

    1 files  +    1      1 suites  +1   4h 36m 18s ⏱️ + 4h 36m 18s
2 195 tests +2 195  2 179 ✅ +2 179  15 💤 +15  0 ❌ ±0  1 🔥 +1 
4 259 runs  +4 259  4 230 ✅ +4 230  27 💤 +27  1 ❌ +1  1 🔥 +1 

For more details on these errors, see this check.

Results for commit d54843a. ± Comparison against base commit 3a405f1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Realm Server Test Results

  1 files  ±  0    1 suites  ±0   13m 30s ⏱️ - 5m 18s
844 tests +552  844 ✅ +555  0 💤 ±0  0 ❌  - 3 
915 runs  +607  915 ✅ +610  0 💤 ±0  0 ❌  - 3 

Results for commit d54843a. ± Comparison against base commit 3a405f1.

♻️ This comment has been updated with latest results.

Replace reorder-based approach with a "shopping cart" pattern:
- Selected items shown in a summary section at the top of the dropdown
- Main option list stays in original order (never reorders)
- Select-all rendered in before-options section above the summary
- Users can toggle selection from both summary and main list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FadhlanR FadhlanR force-pushed the cs-10688-defer-reordering-selected-items-to-top-until-dropdown-is-reopened branch from 577099b to 09b4592 Compare April 10, 2026 09:41
@FadhlanR FadhlanR changed the title CS-10688: Defer reordering selected items to top until dropdown is reopened CS-10688: Add selected items summary section to Picker dropdown Apr 10, 2026
@FadhlanR FadhlanR marked this pull request as ready for review April 10, 2026 12:01
@FadhlanR FadhlanR requested review from a team and lukemelia April 10, 2026 12:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d9091a6d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Closing the picker now also calls onSearchTermChange('') so that
server-search consumers (e.g. TypePicker) reset their query state,
preventing stale filtered results on reopen.

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Boxel Picker component to stop reordering selected items in the dropdown and instead display selected items in a dedicated summary section above the main options list, keeping the main list stable during multi-select interactions.

Changes:

  • Replaced selected-item reordering/pinning behavior with a “selected items summary” rendered in the before-options area.
  • Adjusted Picker filtering so the main list stays in original order (and is filtered by search term) while the summary remains visible.
  • Updated host + boxel-ui integration tests to reflect the new DOM structure and behaviors.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/host/tests/integration/components/operator-mode-ui-test.gts Updates type-picker option counting/selectors to only count main-list options.
packages/boxel-ui/test-app/tests/integration/components/picker-test.gts Rewrites Picker integration tests to validate summary + stable ordering + new click targets.
packages/boxel-ui/addon/src/components/picker/option-row.gts Removes hover/pinning-related event handling from option row.
packages/boxel-ui/addon/src/components/picker/index.gts Implements stable main list (displayOptions), selected summary plumbing, and resets search on close.
packages/boxel-ui/addon/src/components/picker/before-options-with-search.gts Adds select-all button + selected-items summary UI and divider in before-options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +213 to +214
this.searchTerm = '';
this.args.onSearchTermChange?.('');
padding: 0 var(--boxel-sp-2xs);
box-sizing: border-box;
}

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.

2 participants