Add sidebar toggle keyboard shortcut - #3960
Merged
Merged
Conversation
Adds a View menu item with CommandOrControl+B accelerator that fires a toggle-sidebar IPC event to the renderer, where app.tsx listens for it and calls the existing toggleSidebar handler. Co-authored-by: shaunandrews <shaun@automattic.com>
shaunandrews
marked this pull request as ready for review
June 25, 2026 18:15
Collaborator
📊 Performance Test ResultsComparing ce5b4dc vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
gavande1
reviewed
Jun 29, 2026
gavande1
left a comment
Contributor
There was a problem hiding this comment.
Nice @shaunandrews, I tested this and it works as advertised. LGTM 👍
gavande1
approved these changes
Jun 29, 2026
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.
Related issues
Closes STU-1900
How AI was used in this PR
AI produced the initial PR, then Codex reviewed the behavior, identified why the shortcut was incomplete, and updated the branch with a broader fix and test coverage.
Proposed Changes
Adds a reliable primary-modifier+B shortcut for toggling the sidebar: Cmd+B on macOS and Ctrl+B on Windows/Linux.
This fixes the original branch by making the shortcut work even when the native app menu is hidden, and by supporting both Studio renderer surfaces. Users can now toggle the sidebar consistently from the keyboard in the legacy Studio UI and the newer agentic UI.
The View menu entry remains available for discoverability.
Testing Instructions
Validated locally:
npx eslint --fix apps/studio/src/components/app.tsx apps/studio/src/main-window.ts apps/studio/src/tests/main-window.test.ts apps/ui/src/components/sidebar-layout/index.tsx apps/ui/src/components/sidebar-layout/index.test.tsx apps/ui/src/data/core/connectors/hosted/index.ts apps/ui/src/data/core/connectors/ipc/index.ts apps/ui/src/data/core/types.tsnpm test -- apps/studio/src/tests/main-window.test.tsnpm test -- apps/studio/src/components/tests/app.test.tsxnpm test -- apps/ui/src/components/sidebar-layout/index.test.tsxnpm run typecheckgit diff --checkPre-merge Checklist