Always focus the terminal after worktree navigation#371
Merged
Conversation
Makes the terminal regain focus whenever you navigate to a worktree outside the command palette — sidebar click / arrow-nav, worktree hotkey slots, next/prev, and history back/forward — matching the menu and deeplink paths that already passed `focusTerminal: true`. Previously a sidebar selection left focus floating, so every click had to be followed by a manual click into the terminal to start typing. This honors the "terminal is the default focus" invariant across all navigation surfaces. Implemented with AI assistance (Claude Code); reviewed and verified in a real build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sbertix
approved these changes
May 30, 2026
Collaborator
There was a problem hiding this comment.
Yeah, I think the historical reasons for having navigation this way no longer hold. And some process (e.g., Claude Code) randomly pull focus to the terminal surface either way, so this is for the best 💪
Thank you 🙇♂️
(I feel like the comments are not needed tbh, as they don't really explain the WHY, just the WHAT, but 100% nit)
Per review on supabitapp#371: the comments narrated the WHAT, not the WHY. The `focusTerminal: true` call sites and the history-nav focus block are self-explanatory; removing the prose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Thanks so much — really glad it's useful! 🙏 Good call on the comments; you're right that they narrated the what rather than the why. Dropped both (latest commit). And agreed on the rationale — since other processes (Claude Code, etc.) pull focus to the terminal surface anyway, making that the consistent default just matches how it already behaves in practice. 💪 |
Keyboard and history worktree navigation now emit a trailing focusTerminalRequested row action; the navigation tests didn't assert it and failed on an unexpected received action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Focuses the destination terminal whenever you navigate to a worktree outside the command palette: sidebar click / arrow-nav, worktree hotkey slots, next/prev, and history back/forward.
Why
Matches the menu and deeplink paths that already passed
focusTerminal: true, honoring the "terminal is the default focus" invariant. Previously a sidebar click left focus floating, so you had to click into the terminal before typing.Scope
2 files, ~20 lines — flips existing call sites to
focusTerminal: trueand adds the same focus step to history navigation. No new API;focusTerminal/focusTerminalRequestedalready exist.Disclosure
Implemented with AI assistance (Claude Code); reviewed and verified in a real build.