Skip to content

Keep the group selector list in place after a pick - #4779

Closed
steven-tey wants to merge 1 commit into
mainfrom
cursor/combobox-preserve-order-af37
Closed

steven-tey wants to merge 1 commit into
mainfrom
cursor/combobox-preserve-order-af37

Conversation

@steven-tey

@steven-tey steven-tey commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Add a preserveOrder prop 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.
  • Turn preserveOrder on for the group selector.

Testing

  • Unit tests cover the default "selected on top" order, search, and preserveOrder.
  • Clicked through a local Combobox in Chrome. Without the prop, picking Gamma group moved it to the top. With preserveOrder, the list stayed Alpha, Beta, Gamma, Delta.

Slack Thread

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features
    • Comboboxes can now preserve the supplied option order, including keeping selected options in place. Missing selected options remain visible.
    • By default, options marked as priority appear first, followed by selected options and then the remaining options when no search is active.
    • Searching keeps the supplied option order.

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>
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dub Ready Ready Preview Oct 24, 2026 2:26pm UTC

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b6f8e5f-224b-485f-b78a-86073caac340
Commits

Reviewing files that changed from the base of the PR and between f949c06 and e39256d.

Files selected for processing: 4
  • apps/web/tests/misc/combobox-order-options.test.ts
  • apps/web/ui/partners/groups/group-selector.tsx
  • packages/ui/src/combobox/index.tsx
  • packages/ui/src/combobox/order-options.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The combobox now uses a dedicated option-ordering helper. A new preserveOrder prop controls whether the incoming order is retained. GroupSelector enables this prop, and tests cover search, selected options, and missing selections.

Changes: Combobox option ordering

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: Low

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: preserving the group selector list order after a selection.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@steven-tey steven-tey closed this Oct 25, 2026
@devkiran
devkiran deleted the cursor/combobox-preserve-order-af37 branch October 25, 2026 08:31

This branch was successfully deployed

1 active deployment
Preview — e39256d6 Deployed Oct 24, 2026 by vercel[bot]
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.

3 participants