feat(desktop): redesign the chat composer model and mode pickers

Merged
AV
1mo ago
+907-461

What & why

The chat composer's model picker buried the model list behind a "Model ›" submenu, and the mode picker was a flat list with the description in a footer. This reshapes both into a single, denser panel each.

Model picker (ModelPicker, ModelFlyout → ModelPanel)

  • One 296px panel: agent icon tab strip (★ favorites + one tab per agent, underline marker on the active one) → borderless search row (auto-focused; Enter picks the top hit; Tab cycles tabs) → grouped model list (Favorites / All models) with ⌘1–9 hints that actually pick the row, a ✓ on the current model and an always-visible favorite star on the right.
  • Footer: a new EffortSliderCard — fast-mode ⚡ toggle, the current effort level, and a stepped slider with one mark per level. Changes apply immediately and keep the menu open. Any other agent settings render below it as Label … Value › rows.
  • The setting submenus are now wrapped in DropdownMenuPortal: the frosted panel's backdrop-filter makes it the containing block for position: fixed, so an inline submenu was positioned inside the panel and clipped by overflow-hidden (it existed in the DOM but never painted).

Mode picker (ModePicker)

  • Rows are icon + title + description with a ✓ on the current mode; the Full access icon is amber, text stays white.
  • Moves to the left of the composer footer (toolbar), with the model picker on the right (toolbarEnd); menus align start/end respectively.

Shared

  • Pill triggers are transparent at rest (faint fill on hover/open), 28px tall at 12px; menu rows are 13px, labels 11px, descriptions 12px; 10px row radius inside a 14px frosted panel (MENU_PANEL_CLASS).
  • packages/ui Slider takes optional trackClassName / rangeClassName / thumbClassName and children inside the track (for step marks). Existing callers are unaffected.

No new i18n strings; existing messages are reused.

How I tested it

Drove the dev desktop app over CDP against a real Claude chat session in a workspace:

  • Model menu: opens with the search focused; typing son filters to the Sonnet rows; Tab moves to the Codex tab and clears the query; Esc closes.
  • Effort slider: clicking the 4th step mark set effort to High (menu stayed open, label and pill updated); clicking the 5th restored Xhigh. Fast mode submenu → On showed the ⚡ on the pill, Off removed it.
  • Mode menu: opens from the left pill, aligned to the start; Full access row shows the amber icon with white text.
  • Captured screenshots of the closed footer, the model menu (Claude and Codex tabs, slider), and the mode menu at each step.
  • bun run check:i18n clean; Biome clean on all changed files; packages/ui typechecks; useFavoriteModels test passes. apps/desktop typecheck has pre-existing errors in unrelated route files, none in these.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Summary by cubic

Redesigns the chat composer's model and mode pickers into single dense panels. Picks now apply immediately instead of waiting for the agent round-trip, and the effort slider commits once on release rather than once per crossed level.

The model picker replaces the nested "Model ›" submenu with one 296px panel: agent icon tabs, a search field (Enter picks the top hit, Tab cycles tabs, mod+digit hints pick rows), a grouped Favorites / All models list with a ✓ on the current model and always-visible favorite stars, and a footer effort slider card with a fast-mode toggle. Fast mode also appears as a standalone zap pill next to the model picker. The mode picker rows show icon, title, and description, with the Full access icon using the theme highlight instead of a fixed amber; it moves to the left of the composer footer. Adds a new Fast i18n string across locales.

Bug Fixes

  • Agent setting submenus are portaled; the frosted panel's backdrop-filter previously clipped them.
  • Tab focus no longer gets trapped in the model panel when there are no agent tabs, and cycles past the last tab into the fast toggle and slider.

Dependencies

  • packages/ui Slider accepts optional track, range, and thumb class names plus children for step marks.

Summary by CodeRabbit

  • New Features

    • Added an effort slider and a separate Fast toggle to model settings.
    • Improved model selection with search, Favorites and preset tabs, keyboard shortcuts, and clearer selection indicators.
    • Mode and model settings now update optimistically, showing selections immediately while changes are applied.
    • Added translations for the Fast option across supported languages.
  • Style

    • Refreshed composer menus and controls with updated spacing, colors, and panel styling.