Repository navigation
feat(native-chat): searchable model picker - #26011
Conversation
The model list was a flat menu that had to be scrolled to find an entry.
📝 WalkthroughWalkthroughAdds a searchable model combobox with multi-term filtering, keyboard and click selection, and read-only states. Connects it to native-chat session option pickers while retaining dropdowns for other model descriptors. Adds localized search and no-results text, optional command-list height animation, and tests for combobox behavior and picker integration. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Keyboard users cannot browse unavailable models with the arrow keys. This is a bounded accessibility issue worth fixing, but it does not prevent the picker from being merged. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (6 skipped: 6 unsupported.)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
dde52e94-c38d-4b41-a68c-726456b2e3cc
📒 Files selected for processing (13)
src/renderer/src/components/native-chat/NativeChatModelCombobox.test.tsxsrc/renderer/src/components/native-chat/NativeChatModelCombobox.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionChoiceBody.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.menu-request.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsxsrc/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsxsrc/renderer/src/components/ui/command.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
We can land this but I feel the model dropdown is still jumpy. Can redesign in another PR |
|
Merged it as it's an improvement over main, but should see Jinjing's message above, cc @AmoabaKelvin |
ELI5
The model list in native chat was a plain menu. With an agent that offers many models you had to scroll to find the one you wanted. Now the list has a search box that is ready to type in as soon as it opens, so you can type a few letters and press Enter.
What Changed
Before: clicking the model pill (or running
/model) opened a flat menu of every model. The only way to find one was to scroll, or to type its first letters and hope the menu jumped to it.After:
/model.codex 5.2finds "GPT-5.2 Codex". Matches keep the order the agent listed them in.Unchanged: agents that only expose "Choose in agent picker…" or a toggle keep their one-row menu, and the effort/options pill is untouched.
Mechanism: the model pill used to render a dropdown menu of radio items. For a model with a list of choices it now renders a new
NativeChatModelCombobox, built from the existingPopoverandCommandcomponents. The command list filters with a small word-match function instead of its default fuzzy ranking, so the agent's order is preserved.CommandListgains an opt-inanimateHeightprop, which is what makes the list resize smoothly.Why
Agents can expose dozens of models, and a flat list doesn't scale to that.
CommandinsidePopoveris what the style guide prescribes for a single choice with search, and it's what the agent and repo pickers already use. We first tried keeping the dropdown menu and adding a search field to it, to preserve its exact look. That needed a lot of code working against the menu (redirecting focus, suppressing its type-ahead, a hand-built highlight), trapped Tab in the search field, and didn't expose a proper combobox to assistive technology. Using the standard components removed all of that and made this picker behave like its siblings.The word-match filter replaces the default fuzzy scorer because the scorer matches scattered letters and re-orders results, which is noisy in a long list of similar model names.
Visual Proof
CleanShot.2026-10-06.at.11.33.18.PM.mp4
Testing
Automated:
NativeChatModelCombobox.test.tsx(new) runs against the real popover and command components: search focused on open, opening from the pill with a click and with ArrowDown, filtering by multiple words across name, id and description, arrow keys moving the highlight with focus staying in the search, Enter and click picking and closing, Tab closing, and a model that can't be set being listed but not pickable.NativeChatSessionOptionPickers.test.tsxadds a test that picking a model reaches the session.NativeChatSessionOptionPickers.menu-request.test.tsxnow also asserts that a/modelrequest lands focus in the search field.To try it: open a structured native chat, click the model pill, type part of a model name, use the arrow keys, and press Enter. Then run
/modelin the composer and check that the search field is focused.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)