Skip to content

fix(app): align model selector keyboard navigation with visual group order - #39344

Open
DevDengChao wants to merge 1 commit into
anomalyco:devfrom
DevDengChao:fix/model-selector-nav-order
Open

fix(app): align model selector keyboard navigation with visual group order#39344
DevDengChao wants to merge 1 commit into
anomalyco:devfrom
DevDengChao:fix/model-selector-nav-order

Conversation

@DevDengChao

Copy link
Copy Markdown

Issue for this PR

Closes #39341

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The V2 model selector in the Desktop App / Web UI had a mismatch between keyboard navigation order and visual render order. When filtering models (e.g., typing "deep" to find DeepSeek models across multiple providers), pressing up/down arrows navigated in flat alphabetical-by-model-name order, while the UI rendered models grouped by provider with groups sorted by provider popularity. This caused the highlight to jump non-linearly between provider groups.

The fix changes keys() (line 311 of dialog-select-model.tsx) to derive from groups().flatMap() instead of models().map(), so keyboard navigation follows the same grouped+sorted order as the visual rendering.

How did you verify your code works?

  • Added unit tests in dialog-select-model.test.ts verifying that navigation keys derived from grouped models match the visual provider-popularity order
  • All 4 new tests pass
  • bun typecheck passes across all 36 packages

Screenshots / recordings

No UI visual changes — this is a behavioral fix only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…order

The V2 model selector's keyboard navigation (up/down arrows) followed a
flat alphabetical-by-model-name order, while the UI rendered models
grouped by provider with groups sorted by provider popularity. This
caused the highlight to jump non-linearly between provider groups when
navigating filtered results.

Change keys() to derive from groups().flatMap() instead of
models().map() so navigation order matches the visual render order.

Closes anomalyco#39341
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.

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

1 participant