anomalyco / anomalyco/opencode

fix(app): model selector keyboard navigation does not follow visual group order

Open
#39,341 1 comment 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Jul 28, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When filtering models in the V2 model selector (e.g., typing "deep" to find DeepSeek models), pressing up/down arrow keys navigates in alphabetical model-name order instead of following the visual provider-grouped order.

For example, if "DeepSeek V4 Flash" exists under both Anthropic and OpenRouter:

  • Visual order: Anthropic group (top) → OpenRouter group (bottom)
  • Keyboard navigation order: follows flat alphabetical sort, jumping between groups non-linearly
Steps to reproduce
  1. Add multiple providers that have models with the same or similar names (e.g., two providers both offering "DeepSeek V4 Flash")
  2. Open the model selector in the Desktop App or Web UI
  3. Type "deep" in the search box to filter
  4. Press Down arrow to navigate through the filtered results
  5. Observe that the highlight skips around between provider groups instead of moving sequentially through the visual list
Root cause

In packages/app/src/components/dialog-select-model.tsx, the keys() function (used for keyboard navigation) builds a flat array from models() sorted alphabetically by model name, while the UI renders groups() which re-groups by provider and sorts groups by provider popularity. These two orderings are fundamentally different.

OpenCode version

Latest (dev branch)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.