Keyboard-select composer controls with hold-modifier hints#4271
Keyboard-select composer controls with hold-modifier hints#4271colonelpanic8 wants to merge 10 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new feature adding keyboard shortcuts and visual hold-modifier hints for composer controls. New features with new user-facing behavior warrant human review, especially given the modifications to core components like ChatComposer and BranchToolbar. You can customize Macroscope's approvability policy. Learn more. |
Adds pingdotgg/t3code#4271 (keyboard-select composer controls + hold-modifier hints) as the final entry in the applyPatches stack. The raw cumulative diff applies with fuzz after #4258 and #4260, so it uses a plain fetchurl GitHub link rather than a local compatibility patch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump the pingdotgg/t3code#4271 fetchurl hash to the current PR head (51135b2cc), pulling in the Cursor/Macroscope review fixes (terminal-focus aware hints, layout-scoped picker open state, mutually-exclusive toolbar pickers, branch-search reset). Raw cumulative diff still applies with fuzz. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
51135b2 to
dd6cfa5
Compare
5c9615f to
a371312
Compare
8ebc09a to
c2702bb
Compare
Make every selector in the thread first-prompt composer keyboard-operable through the existing customizable keybindings system, alongside the pre-existing modelPicker.toggle command: - modelOptionsPicker.toggle (mod+shift+e): reasoning effort / traits menu - runtimeModePicker.toggle (mod+shift+a): access level select - planMode.toggle (mod+shift+p): Plan/Build toggle - environmentPicker.toggle (mod+shift+v): branch toolbar environment - envModePicker.toggle (mod+shift+l): local vs worktree - branchPicker.toggle (mod+shift+b): branch selector All six are rebindable in Settings -> Keybindings (labels derived by the existing commandLabel helper) and are upserted into existing configs by the server's startup sync. Holding the platform mod key reveals Kbd hint badges on each control via shouldShowComposerControlHintsForModifiers, which uses subset (not exact) modifier matching so a bare Ctrl/Cmd reveals the chords. Compact footer routes the effort/runtime toggles to CompactComposerControlsMenu; mobile routes environment/env-mode to the combined run-context menu. Toggles report availability so unavailable controls leave the browser default intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The hold-modifier hint chips were rendered inline inside the composer control triggers, crowding out the current values (the model name truncated to almost nothing). Render them instead as detached, portaled tooltips anchored below each trigger, so the model, options, approval and runtime-mode values stay fully visible while hints are shown. The branch toolbar keeps its inline hints since those labels have room. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
d0c50d2 to
3a03660
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3a03660. Configure here.
ac2c0ac to
d5ca73b
Compare

What
Makes every selector in the thread first-prompt composer keyboard-operable through the app's existing customizable keybindings system, extending the pattern already used by
modelPicker.toggle.modelOptionsPicker.togglemod+shift+eruntimeModePicker.togglemod+shift+aplanMode.togglemod+shift+penvironmentPicker.togglemod+shift+venvModePicker.togglemod+shift+lbranchPicker.togglemod+shift+b(
mod= Ctrl on Linux/Windows, Cmd on macOS.)All six are rebindable in Settings → Keybindings — they flow through the existing command registry, so their labels are derived by
commandLabeland they're upserted into existing user configs by the server's startup sync. No new settings surface was added.Hold-modifier hints
Holding the platform mod key reveals small
Kbdhint badges for each control (mirroring the existing thread-jump number hints). For the composer controls the badge floats just below its trigger (a detached anchored tooltip), so the current values — model, effort, access level, Plan/Build — stay fully visible; the branch toolbar controls keep inline badges. Visibility is computed once via a newshouldShowComposerControlHintsForModifiers, which deliberately uses subset modifier matching (not the exact-match used by thread jumps) so that holding a bare Ctrl/Cmd reveals the fullmod+shift+*chords.Fallbacks
CompactComposerControlsMenu; the Plan/Build toggle still flips directly.MobileRunContextSelectormenu.preventDefault, so the browser default still fires.Tests
Extended keybinding coverage in
packages/contracts,apps/web(mac vs non-mac, subset semantics, customized bindings, no-binding, label resolution), andapps/serverdefaults enumeration. Typecheck, lint, and full test suites pass (contracts 190, shared 272, web 1411, server keybindings 22).🤖 Generated with Claude Code
Exact-head evidence
Revalidated at d0c50d2 on current main (9a0a071): focused tests, vp check, and vp run typecheck passed. The capture uses only disposable local projects.
Note
Medium Risk
Touches global keydown handling and many UI state paths (compact vs desktop, mobile, locked env); incorrect availability or picker coordination could cause stuck overlays or swallowed shortcuts, but changes are mostly additive with tests.
Overview
Adds six rebindable commands (
modelOptionsPicker,runtimeModePicker,planMode,environmentPicker,envModePicker,branchPicker) with defaultmod+shift+*chords, wired through contracts/shared defaults and handled inChatViewvia imperative toggles onChatComposerandBranchToolbar.Composer and branch UI now use single active picker state (composer pickers + compact menu + branch toolbar overlays), with logic to replace rather than stack overlays, ignore stale close events, and reset on layout changes via
useLayoutScopedOpenState. Mobile routes environment/env-mode shortcuts to the combined run-context menu.Hold-modifier hints show
Kbdlabels when held modifiers are a subset of each binding (shouldShowCommandHintForModifiers), including terminal-focuswhenrules; composer controls use anchoredComposerControlShortcutHinttooltips. Toggles return false when unavailable sopreventDefaultis skipped and browser defaults still work.Reviewed by Cursor Bugbot for commit d5ca73b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add keyboard shortcuts to toggle composer and branch toolbar controls with modifier-held hints
mod+shift+e/a/p/v/l/b) mapped tomodelOptionsPicker.toggle,runtimeModePicker.toggle,planMode.toggle,environmentPicker.toggle,envModePicker.toggle, andbranchPicker.togglein keybindings.ts.shouldShowComposerControlHintsForModifiersandshouldShowCommandHintForModifiershelpers in keybindings.ts.resolveComposerPickerOpenChangein composerProviderState.tsx; only one picker can be open at a time.BranchToolbarexposes an imperativeBranchToolbarHandlefor programmatic toggling fromChatViewContent.useLayoutScopedOpenStatehook in useLayoutScopedOpenState.ts ensures picker open state resets automatically on layout changes (e.g. mobile ↔ desktop).Macroscope summarized d5ca73b.