Repository navigation
Keep the group selector list in place after a pick - #4779
steven-tey wants to merge 1 commit into
Conversation
Combobox was moving the selected option to the top when the menu closed. Add a preserveOrder prop and use it on the group selector so the list stays in the order it was loaded. Co-authored-by: Steven Tey <steven@dub.co>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Option ordering behavior and validation packages/ui/src/combobox/order-options.ts, packages/ui/src/combobox/index.tsx, apps/web/ui/partners/groups/group-selector.tsx, apps/web/tests/misc/combobox-order-options.test.ts |
The helper orders options based on search, selection, and preserveOrder. Combobox exposes the prop and uses the helper. GroupSelector enables order preservation. Tests cover the ordering cases. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Suggested reviewers: twilson023
Merge Risk: 
Minimal · up to e3925
-
No actionable risk introduced by this change remains; it is ready to merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
The group switcher reshuffled after every pick because Combobox moves the selected option to the top when the menu closes. That made it hard to tell which groups you had already opened.
preserveOrderprop to Combobox. Options stay in the order they were passed. A selection that is not in the list is appended so it stays visible, and other comboboxes still float the selection to the top.preserveOrderon for the group selector.Testing
preserveOrder.preserveOrder, the list stayed Alpha, Beta, Gamma, Delta.Slack Thread
Summary by CodeRabbit