feat(sidebar): add ⌘B shortcut to collapse/expand sidebar#5047
feat(sidebar): add ⌘B shortcut to collapse/expand sidebar#5047waleedlatif1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@greptile |
|
@cursor review |
PR SummaryLow Risk Overview Introduces
Reviewed by Cursor Bugbot for commit 97d8c98. Configure here. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 64d4dd0. Configure here.
Greptile SummaryThis PR wires up a
Confidence Score: 5/5Safe to merge — the change is additive, touches only sidebar toggling and tooltip display, and correctly guards the shortcut from editable surfaces. All three files make narrow, well-scoped additions: the new command entry, a pure helper function, and two tooltip wrappers. The No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant GlobalCommandsProvider
participant SidebarStore
participant Sidebar
participant WorkspaceHeader
User->>GlobalCommandsProvider: keydown ⌘B / Ctrl+B
Note over GlobalCommandsProvider: allowInEditable: false<br/>skips inputs/textareas
GlobalCommandsProvider->>SidebarStore: toggleCollapsed()
SidebarStore-->>Sidebar: isCollapsed state change
alt Sidebar expanding (was collapsed)
Sidebar->>WorkspaceHeader: "isCollapsed=false"
WorkspaceHeader-->>User: Full sidebar visible, collapse tooltip shows ⌘B
else Sidebar collapsing (was open)
Sidebar->>WorkspaceHeader: "isCollapsed=true, expandShortcut=⌘B"
WorkspaceHeader-->>User: Collapsed expand button, tooltip shows ⌘B
end
Reviews (4): Last reviewed commit: "improvement(sidebar): address review — s..." | Re-trigger Greptile |
Greptile SummaryThis PR registers
Confidence Score: 4/5Safe to merge; the changes are small and self-contained, with no effect on data or auth. The main practical risk is The implementation is clean and consistent with how other global shortcuts are wired. The
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant GlobalCommandsProvider
participant Sidebar
User->>GlobalCommandsProvider: keydown ⌘B / Ctrl+B (capture phase)
GlobalCommandsProvider->>GlobalCommandsProvider: matchesShortcut("collapse-sidebar")
GlobalCommandsProvider->>GlobalCommandsProvider: e.preventDefault() + e.stopPropagation()
GlobalCommandsProvider->>Sidebar: handler() → toggleCollapsed()
Sidebar->>Sidebar: isCollapsed state flipped
Note over User,Sidebar: Tooltip path (sidebar expanded)
User->>Sidebar: hover collapse button
Sidebar->>User: SidebarTooltip shows "Collapse sidebar ⌘B"
Reviews (2): Last reviewed commit: "feat(sidebar): add ⌘B shortcut to collap..." | Re-trigger Greptile |
…d hint, expand tooltip
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97d8c98. Configure here.
|
@greptile review |

Summary
⌘B(Ctrl+B on Windows) global shortcut to collapse/expand the workspace sidebarcollapse-sidebar,Mod+B)Tooltip.Shortcut, platform-aware (⌘ vs Ctrl)Type of Change
Testing
Tested manually — ⌘B toggles the sidebar from anywhere in the workspace; tooltip shows the shortcut.
Checklist