You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop: refocus prompt input when switching tabs with Cmd+number #47514
Switching session tabs with Cmd+<number> should automatically focus the destination tab's prompt input. Currently, the tab changes without refocusing the input, interrupting keyboard-only navigation.
Steps to reproduce
Open at least two session tabs.
Switch between them using Cmd+1, Cmd+2, etc.
Start typing immediately after switching, including when returning to a previously visited tab.
Expected: The selected tab's prompt input receives focus, so typing works without an extra click.
Actual: The selected tab's prompt input is not automatically refocused.
Additional context
Reported behavior; not independently reproduced. Exact app version and OS version were not provided.
I'd like to work on this. This is a desktop UX bug in the session tab switching path: Cmd+<number> switches the active session tab but does not refocus the destination tab's prompt composer input, which breaks keyboard-only navigation.
I traced the relevant wiring on v2:
Prompt input focus lives in the composer (packages/app/src/session/composer/region.tsx exposes focusInput, packages/app/src/session/commands/use-session-commands.tsx:87 wires focusInput as a command).
Session tab switching is handled in the shell/tab-bar layer; the Cmd+number accelerator and the tab select handler are in packages/app/src/shell/.
The intended fix is: when the active session tab changes (including via Cmd+<number>), call the destination tab's composer focusInput (or restoreFocus) so the input is focused immediately, matching the existing mouse-click tab switch behavior.
I'll implement this against v2 (per repo AGENTS.md, current work targets v2), add/update a regression test for the focus behavior, and open a PR. I'll coordinate on direction if a maintainer is already mid-fix.
Thanks for the work on the fix. PR #47529 (restore composer focus on session tab changes) already addresses this issue — it restores focus once the destination draft is ready and covers the Cmd+number tab-switch path with an e2e regression test (tab-composer-focus.spec.ts), and all checks are green.
I'll stand down here rather than submit a competing implementation. Happy to review or help test if it would be useful.
Activity
argszero commentedon Sep 5, 2026
I'd like to work on this. This is a desktop UX bug in the session tab switching path:
Cmd+<number>switches the active session tab but does not refocus the destination tab's prompt composer input, which breaks keyboard-only navigation.I traced the relevant wiring on
v2:packages/app/src/session/composer/region.tsxexposesfocusInput,packages/app/src/session/commands/use-session-commands.tsx:87wiresfocusInputas a command).packages/app/src/shell/.The intended fix is: when the active session tab changes (including via
Cmd+<number>), call the destination tab's composerfocusInput(orrestoreFocus) so the input is focused immediately, matching the existing mouse-click tab switch behavior.I'll implement this against
v2(per repo AGENTS.md, current work targetsv2), add/update a regression test for the focus behavior, and open a PR. I'll coordinate on direction if a maintainer is already mid-fix.argszero commentedon Sep 6, 2026
Thanks for the work on the fix. PR #47529 (restore composer focus on session tab changes) already addresses this issue — it restores focus once the destination draft is ready and covers the Cmd+number tab-switch path with an e2e regression test (
tab-composer-focus.spec.ts), and all checks are green.I'll stand down here rather than submit a competing implementation. Happy to review or help test if it would be useful.