Skip to content

fix: sidebar explorer/search shortcuts open a collapsed sidebar#1267

Merged
perber merged 1 commit into
perber:mainfrom
mvanhorn:fix/1265-sidebar-shortcuts-open-collapsed
Jul 5, 2026
Merged

fix: sidebar explorer/search shortcuts open a collapsed sidebar#1267
perber merged 1 commit into
perber:mainfrom
mvanhorn:fix/1265-sidebar-shortcuts-open-collapsed

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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.tsx only calls setSidebarMode(item.id), which changes the active panel but never makes a collapsed sidebar visible. The store already exposes setSidebarVisible (used by AppLayout), 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

  • Added Sidebar.test.tsx (Vitest + @testing-library/react) covering three cases: collapsed sidebar plus explorer shortcut opens it on the tree panel, collapsed sidebar plus search shortcut opens it on the search panel, and an already-open sidebar stays open and just switches panels when a shortcut is pressed.
  • eslint and prettier --check pass on the changed files, and the app TypeScript project (tsconfig.app.json) type-checks cleanly.

Fixes #1265

@mvanhorn mvanhorn requested a review from perber as a code owner July 5, 2026 07:57
@perber

perber commented Jul 5, 2026

Copy link
Copy Markdown
Owner

@mvanhorn Thanks! I'm merging the PR.

@perber perber merged commit 505316d into perber:main Jul 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTRL+SHIFT+E or F limited functionality

2 participants