Repository navigation
Keep keyboard focus in the focused pane on sidebar clicks - #458
Merged
amirlehmam merged 1 commit intoNov 15, 2026
Merged
Conversation
Clicking the sidebar moved focus off the terminal while the pane kept its focus ring, so typing afterwards went nowhere. Presses outside workspace rows now cancel the focus change; rows keep their default so native drag reordering still works, and focus is handed back to the focused pane when the press ends.
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.
Problem
Clicking the sidebar takes keyboard focus away from the focused pane while the pane keeps its focus ring.
After clicking the active workspace's row, an empty part of the sidebar, typing goes nowhere until the pane is clicked again.
Nothing in the sidebar uses the keyboard apart from its text fields, so the click just leaves focus on the page body. The terminal only grabs focus back when its pane becomes visible or focused, and clicking the workspace you're already in changes neither.
Change
Sidebar/keep-pane-focus.ts, wired as the sidebar root'sonMouseDown:draggable, and cancelling the press also cancels Chromium's native drag, which is how rows are reordered. On a row the press keeps its default, and focus is handed back once the press ends (mouseupordragend). It only goes back to an element still inside the focused pane, so a click that switched the workspace or the pane leaves focus where that switch put it.Testing
npm test: 415 files passed, 2 skipped; 6705 tests passed, 10 skipped. Includes the newtests/unit/sidebar-keep-pane-focus.test.ts.npm run typecheckandeslintonsrc/renderer/components/Sidebarare clean.