Add model searching functionality

Merged
FL
3mo ago
+84-7
image

Summary by cubic

Adds searchable model selection in the chat composer to speed up switching. Previously the menu listed all options; now a search field filters by model name, identifier, or provider with locale‑aware, case‑insensitive matching.

  • Input UX: auto‑focus on open; Escape closes; query clears on close; results list scrolls; shows “No matching models” when filtered to none.
  • The search input disables browser autocomplete and spellcheck to avoid autofill and red underlines on model IDs.
  • Filtering lives in exported filterModelOptions; empty/whitespace queries return all options; grouping by provider happens after filtering; tests cover name/id/provider and case/whitespace behavior.
  • i18n adds chatInput.searchModels and chatInput.noMatchingModels in en, ja, and zh-CN.

Summary by CodeRabbit

  • New Features

    • Added model search to the chat input, allowing models to be filtered by name, identifier, or provider.
    • Added an auto-focused search field, scrollable results list, and no-results message.
    • Added localized search labels and empty-state messaging in English, Japanese, and Simplified Chinese.
  • Tests

    • Added coverage for model filtering, including whitespace-only searches and localized matching.