fix: sidebar explorer/search shortcuts open a collapsed sidebar#1267
Merged
perber merged 1 commit intoJul 5, 2026
Merged
Conversation
4 tasks
Owner
|
@mvanhorn Thanks! I'm merging the PR. |
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.
Summary
The CTRL+SHIFT+E (Open explorer) and CTRL+SHIFT+F (Open search) sidebar shortcuts now open the sidebar when it is collapsed, in addition to activating the corresponding panel. When the sidebar is already open the behavior is unchanged: the shortcut just switches to that panel.
Why this matters
Per #1265, pressing either shortcut while the sidebar is collapsed appears to do nothing. The reason is that the hotkey action in
Sidebar.tsxonly callssetSidebarMode(item.id), which changes the active panel but never makes a collapsed sidebar visible. The store already exposessetSidebarVisible(used byAppLayout), so the fix wires that into the shortcut action. This matches the expected behavior described in the issue and is consistent with how editors like VS Code treat these shortcuts. The separate idea of a dedicated sidebar-toggle shortcut is left out of scope, since it is still under discussion.The visible tab buttons keep their existing direct
onClick, since clicking a tab already implies the sidebar is open.Testing
Sidebar.test.tsx(Vitest + @testing-library/react) covering three cases: collapsed sidebar plus explorer shortcut opens it on thetreepanel, collapsed sidebar plus search shortcut opens it on thesearchpanel, and an already-open sidebar stays open and just switches panels when a shortcut is pressed.eslintandprettier --checkpass on the changed files, and the app TypeScript project (tsconfig.app.json) type-checks cleanly.Fixes #1265