Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): add model options picker keybinding #7571

ClosedLunarRed(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/7571/headopened View on GitHub

What Changed

  • Added the configurable modelOptionsPicker.toggle command with mod+shift+, as its default binding.
  • Wired the command to the existing Model Options Picker in the composer.
  • Focused the current option when the picker opens and returned focus to the composer after selection.
  • Preserved terminal shortcut gating and documented the command.

Why

Issue #2549 requests keyboard access to reasoning level selection. The existing picker contains model-specific options beyond reasoning level, so the command uses the broader Model Options Picker name.

This is a narrow implementation of the relevant idea from #4271. It does not add option cycling, presets, shortcut badges, other composer shortcuts, or new UI.

Closes #2549.

UI Changes

No new UI was added.

https://github.com/user-attachments/assets/73a9ca25-c200-4f26-bd3e-bc5737846495

Validation

  • vp test run packages/contracts/src/keybindings.test.ts apps/server/src/keybindings.test.ts
  • vp test run src/keybindings.test.ts src/components/chat/composerProviderState.test.tsx --project unit from apps/web
  • pnpm --filter @t3tools/contracts typecheck
  • pnpm --filter @t3tools/shared typecheck
  • pnpm --filter t3 typecheck
  • pnpm --filter @t3tools/web typecheck
  • Targeted lint and formatting checks for all changed files
  • Manual verification of the default shortcut, current-option focus, arrow navigation, selection, composer focus restoration, toggle behavior, custom rebinding, and terminal focus gating

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Model and harness: GPT-5.6 with Codex in T3 Code

Note

Add modelOptionsPicker.toggle keybinding with default mod+shift+,

  • Registers modelOptionsPicker.toggle as a valid keybinding command with a default shortcut of mod+shift+, (outside terminal focus).
  • Adds a toggleModelOptionsPicker() method to ChatComposerHandle, which the window-level keydown handler in ChatView calls when the shortcut fires.
  • The composer toggles the model options picker in compact or expanded layout depending on footer state, with mutual exclusivity against the model picker and guards for collapsed mobile and approval states.
  • TraitsPicker and CompactComposerControlsMenu gain controlled open props, and TraitsMenuContent gains an onOptionSelect callback that refocuses the composer after selection.
  • Fixes keyboard event parsing so that events with code Comma resolve to , in shortcut matching.
Macroscope summarized cf4739f.

Note

Low Risk Composer UX and keybinding wiring only; no auth, data, or API surface changes beyond a new command ID.

Overview Adds modelOptionsPicker.toggle with default mod+shift+, (gated by !terminalFocus), registered in contracts/shared defaults and documented in user keybindings.

Chat composer exposes toggleModelOptionsPicker() on the composer handle; ChatView routes the command there. The picker is driven in expanded vs compact footer layouts via shared open state, and opening it closes the model picker (and vice versa). Trait pickers gain controlled open/onOpenChange, onOptionSelect to refocus the composer after a choice, and keyboard-open focus on the current primary option for arrow navigation.

Key resolution maps Comma → "," so mod+shift+, matches reliably. Tests cover defaults, shortcut resolution, custom rebinding, and prop forwarding.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cf4739fa8d5f73de3e8ceac0b3f3e8f99be13987. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 3b4cbf35-45bf-4b3e-bfc4-ddc76c753735

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. One finding on the new traits-picker focus behavior. Everything else (controlled open plumbing, CompactComposerControlsMenu control props, keybinding wiring) looks consistent with the existing ProviderModelPicker contract.

      Posted via Macroscope — UI Consistency
    4. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR introduces a new keybinding command (mod+shift+,) with associated state management in the ChatComposer to toggle the model options picker. While the implementation follows existing patterns and includes tests, it adds new user-facing capability and touches core UI components, warranting human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Note

      This comment is posted by Julius' dot

      Closing under prior approval. This adds a new default shortcut and keyboard-opening behavior for the model options picker. #2549 contains proposals and your implementation plan, but no maintainer approval of this direction or default binding; #4271 doesn't supply one either. Please obtain that approval and link it for reconsideration.

    6. juliusmarminge closed this

Sign in to join this conversation.