fix(desktop): keep the fast toggle in the model menu, and typing in settings no longer jumps to search

Merged
AV
1mo ago
+106-134

Follow-up to #8243. Resolves the one thread left open there (typing in a settings submenu pulled focus to the model search).

Summary

  • The typing-to-search redirect now lives in ModelPanel's own key handler, so it only fires for keys inside the model list. Before, it sat on the whole DropdownMenuContent; React portals still bubble to React ancestors, so a letter typed in a trait submenu or on the effort slider stole focus back to the search input.
  • The standalone ⚡ Fast pill beside the model pill is gone. The toggle stays inside the menu: in the effort slider card, or as a trait row for an agent with fast mode but no effort levels. One place is enough.

How It Works

ModelPanel.onPanelKeyDown already owned Tab and ⌘-digit handling; the single-character redirect joins it, with the same guards as before (no modifiers, not a space, target is not the search). ModelPicker loses sendTypingToSearch, the wrapper div, fastOn, and the LuZap/useLingui imports.

How to review: most of the ModelPicker.tsx delta is the de-indent from dropping the wrapper div — git diff -w shows the real change (~20 lines).

Manual QA Checklist

Verified over CDP in the dev app (Claude session, Fable 5.1):

  • Open the model menu, hover a row so it takes menu focus, type o → the search input reads o (redirect still works inside the list)
  • Tab onto the effort slider thumb, type x → focus stays on the thumb, search stays empty, value unchanged
  • Composer footer shows only the mode pill and the model pill; no Fast pill
  • Menu still renders the effort slider card and the model rows; no runtime exceptions
  • Not exercised: typing inside a trait submenu (the Claude session exposes no trait rows) and the in-menu ⚡ itself (no fast-mode option). Same code path as the slider case; a Codex session would show both.

Testing

  • biome check on the picker directory: clean
  • bun run typecheck in apps/desktop: no errors in the changed files (the remaining local errors are the known Better Auth install split, unrelated)
  • bun test for useOptimisticSelections: 4/4 (unchanged by this PR)

Summary by cubic

Fixes the model picker so typing in settings submenus no longer steals focus to the search input, and removes the duplicate Fast-mode pill from the composer footer.

  • Typing-to-search now only fires from keys inside the model list, not the whole menu content, so the effort slider and trait submenus keep their focus.
  • The standalone ⚡ Fast pill next to the model pill is gone; the toggle stays in the effort slider card, or as a trait row for agents with fast mode but no effort levels.

Summary by CodeRabbit

  • Model Picker
    • Fast is shown in the effort slider when an effort setting is available; otherwise, it remains in the settings list.
    • Pressing a character key outside the search field now moves focus to the search field.
    • Typing while hovering over a menu row no longer forwards characters to the search field.