Skip to content

fix(web): preserve focus and prioritize picker shortcuts - #9795

Merged
maria-rcks merged 3 commits into
pingdotgg:mainfrom
maria-rcks:t3code/fix-composer-cursor-focus
Sep 5, 2026
Merged

fix(web): preserve focus and prioritize picker shortcuts#9795
maria-rcks merged 3 commits into
pingdotgg:mainfrom
maria-rcks:t3code/fix-composer-cursor-focus

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

keep focus and number shortcuts in the open palette or model picker, including settings pickers that previously had no keybindings. terminal startup now transfers focus only while the terminal still owns it, so returning to the composer during startup does not cut typing off mid-word.

verified in a separate headless chromium browser against isolated dev state, with mac-style shortcuts, light and dark themes, palette close/focus restoration, settings model selection, project selection, and terminal startup during typing. web typecheck, focused lint, formatting, and 126 existing tests passed.

project and model picker shortcuts, palette focus, and composer focus restoration

composer keeps typing focus while terminal starts, then palette takes priority

implemented with gpt-5.6-sol through the codex harness.


Note

Medium Risk
Changes global shortcut gating and terminal autofocus timing across several hot paths; regressions could affect thread navigation or terminal focus when no overlay is open.

Overview
Fixes focus leaking to the composer/sidebar and number shortcuts firing in the wrong surface while overlays are open.

Command palette wraps its page children in an inert subtree while open and re-focuses the search input on mount so direct-open flows cannot keep typing in the composer behind the modal. Recognized thread-jump shortcuts are always consumed in the palette input, even when no row matches.

Sidebar and model picker skip global thread/model jump handlers when isCommandPaletteOpen() or the model picker is open. The model picker also falls back to server keybindings when none are passed (e.g. Settings), and consumes jump shortcuts the same way as the palette.

Terminal stops auto-focusing on init/version updates; it only focuses the xterm when focus is still inside the viewport, restores focus to the mount on teardown, and uses a focusable container so explicit open/switch can claim focus without racing startup.

Adds docs/user/keyboard-focus.md describing palette focus, shortcut priority, and terminal startup behavior.

Reviewed by Cursor Bugbot for commit ba0d0e6. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Preserve focus and prioritize picker shortcuts across command palette and overlays

  • CommandPalette wraps its children in an inert container while open so background content cannot take focus or interaction; CommandPaletteContent now auto-focuses the command input on every mount
  • Recognized thread-jump shortcuts are consumed even when no matching item exists, so unmatched shortcuts no longer fall through to the input's normal event path
  • Sidebar.tsx and LegacySidebar.tsx skip their global keyboard shortcuts while the command palette or model picker is open
  • ModelPickerContent.tsx falls back to primary server keybindings when no local keybindings prop is supplied and suppresses its shortcuts while the command palette is open
  • ThreadTerminalDrawer.tsx terminal startup no longer steals focus after the user has moved focus outside the viewport, and teardown restores focus to the viewport container when the terminal previously owned focus
  • Behavioral Change: CommandPalette background content is now fully inert (no focus or interaction) while the palette is open; sidebar and model-picker global shortcuts are suppressed during palette/picker open state; terminal focus timing changed to synchronous focus on ready and container focus otherwise

Macroscope summarized ba0d0e6.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 4, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 4, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes focus and global shortcut behavior across modal, sidebar, picker, and terminal paths. It also enables the server/default model shortcuts in Settings when no bindings are supplied, changing an effective product default.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review September 4, 2026 23:26

Dismissing prior approval to re-evaluate 0097447

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 4, 2026
@maria-rcks maria-rcks changed the title fix(web): focus search when opening project picker fix(web): preserve focus and prioritize picker shortcuts Sep 4, 2026
@maria-rcks
maria-rcks merged commit 896fe82 into pingdotgg:main Sep 5, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant