Skip to content

feat(native-chat): searchable model picker - #26011

Merged
brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-searchable-model-picker
Oct 7, 2026
Merged

brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-searchable-model-picker

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​197 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​186
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​191 $\color{#cf222e}{\Huge{\mathbf{−}}}$​39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​152

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:

  • The picker opens with the cursor already in a "Search models…" field, whether you click the pill, press Enter, Space or ArrowDown on it, or run /model.
  • Typing filters the list. Every word you type must appear in the model's name, id or description, so codex 5.2 finds "GPT-5.2 Codex". Matches keep the order the agent listed them in.
  • Arrow keys move the highlight while the cursor stays in the search field. Enter picks the highlighted model and closes the picker.
  • The list glides to its new height as it filters instead of jumping.
  • Escape and Tab close the picker and return focus to the pill.
  • The current model is marked with a checkmark, like the app's other searchable pickers.
  • A model that can't be changed right now is still listed and searchable, with the reason shown, but can't be picked.

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 existing Popover and Command components. The command list filters with a small word-match function instead of its default fuzzy ranking, so the agent's order is preserved. CommandList gains an opt-in animateHeight prop, which is what makes the list resize smoothly.

Why

Agents can expose dozens of models, and a flat list doesn't scale to that.

Command inside Popover is 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

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

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.tsx adds a test that picking a model reaches the session.
  • NativeChatSessionOptionPickers.menu-request.test.tsx now also asserts that a /model request 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 /model in the composer and check that the search field is focused.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Scope: renderer only. Nothing changes in what is sent to the agent or the host, so SSH, remote hosts and mixed client/host versions are unaffected. No platform-specific shortcuts are involved.
  • Mobile: the mobile app has its own model picker, which this does not touch.
  • Localization: two new strings ("Search models…" and "No models match your search.") are added to all six catalogs. The non-English translations have not been reviewed by a native speaker.
  • Accessibility: the search field is exposed as a combobox controlling a listbox of options. The command component only reports the highlighted option to assistive technology after an arrow key is pressed, which is the same behaviour as the app's other command lists. Not tested with a screen reader.
  • Tab: Tab closes the picker and returns focus to the pill rather than moving straight to the next control.
  • Performance: not measured on very long lists (hundreds of models).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

The model list was a flat menu that had to be scrolled to find an entry.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

Adds 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 eb2ef

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: a searchable model picker for native chat.
Description check ✅ Passed The description explains the user-facing change, implementation, motivation, testing, visual proof, and compatibility considerations. It does not include a Linked Issue section or issue link; add one …
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
  • Autopilot · 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dde52e94-c38d-4b41-a68c-726456b2e3cc
📥 Commits

Reviewing files that changed from the base of the PR and between faed899 and eb2ef67.

📒 Files selected for processing (13)
  • src/renderer/src/components/native-chat/NativeChatModelCombobox.test.tsx
  • src/renderer/src/components/native-chat/NativeChatModelCombobox.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionChoiceBody.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.menu-request.test.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx
  • src/renderer/src/components/ui/command.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/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.

@AmethystLiang

Copy link
Copy Markdown
Contributor

We can land this but I feel the model dropdown is still jumpy. Can redesign in another PR

@brennanb2025
brennanb2025 merged commit eaceac0 into stablyai:main Oct 7, 2026
30 checks passed
@brennanb2025

Copy link
Copy Markdown
Contributor

Merged it as it's an improvement over main, but should see Jinjing's message above, cc @AmoabaKelvin

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