Conversation
Adds a `sidebar.toggle` keybinding command so users can collapse and re-expand the thread sidebar to focus on the active chat, addressing pingdotgg#2282. The default shortcut is `mod+b` and is gated on `!terminalFocus` so it doesn't interfere with shell shortcuts. - Contract: register `sidebar.toggle` as a static keybinding command. - Server: add the default rule so it gets backfilled into the user's keybindings.json on startup. - Web: lift `SidebarProvider` to the root so both the command palette and the global keydown handler in `_chat.tsx` can call `useSidebar().toggleSidebar()`. Expose sidebar state via `data-state` on the wrapper so header chrome can react without calling `useSidebar()`. - Palette: add a "Toggle sidebar" action with the bound shortcut hint. - Chrome: reserve 90px padding-left on the Electron drag-region headers when the sidebar is collapsed, so the macOS traffic lights don't overlap the active title; animate the padding to match the sidebar's width transition. - Tests + docs updated.
Lexical's core keydown handler claims mod+b for the bold formatting command and calls preventDefault, even under PlainTextPlugin. The existing `event.defaultPrevented` guard in the global chat shortcut handler then dropped the sidebar toggle before we could act. Move sidebar.toggle into its own effect bound on the capture phase so we see the event before Lexical does, and stopPropagation to keep it from reaching the editor. Other shortcuts (chat.new, chat.newLocal) stay on the bubble-phase listener since Lexical doesn't intercept their keys.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 92c64f5. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (collapsible sidebar with keyboard shortcut) that adds new behavior across multiple components and routes. New features with user-facing behavior changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
The bubble-phase handler in ChatRouteGlobalShortcuts already bails out when useCommandPaletteStore.getState().open is true. The new capture-phase listener for sidebar.toggle was missing that guard, so mod+b would collapse the sidebar behind the open dialog. Flagged by Cursor Bugbot on PR pingdotgg#2305.
|
@juliusmarminge Do I need to authenticate with Vercel or is it something that needs approval? |
|
For someone who doesn't use T3 on fullscreen, this is very usefull! |

What Changed
sidebar.togglekeybinding command bound tomod+bby default, gated onwhen: "!terminalFocus"so it stays out of the way inside the terminal drawer.SidebarProviderto the root layout so both the palette and the global chat shortcut handler can calluseSidebar().toggleSidebar().data-stateon the sidebar wrapper so chrome can react withgroup-data-*classes instead of reading the context everywhere.ChatView,NoActiveThreadState, settings) reservepl-[90px]when the sidebar is collapsed so the macOS traffic lights don't overlap the active title. Windows/Linux fall through to the existingwco:overrides. The padding transitions at the sameduration-200 ease-linearas the sidebar width, so it slides in sync.onKeyDownclaimsmod+bfor the bold command and callspreventDefault, which would trip theevent.defaultPreventedguard in the shared handler.apps/web/src/keybindings.test.ts,apps/server/src/keybindings.test.tsdefaults, andKEYBINDINGS.md.Why
Closes #2282. The thread sidebar was always visible, which made it hard to fully focus on the active chat. A toggle is the smallest useful change that enables focus mode while keeping thread switching (
mod+1..9,mod+shift+[/]) available even when the sidebar is collapsed — those listeners live onwindowinSidebar.tsxand the sidebar DOM stays mounted undercollapsible="offcanvas", so nothing extra was needed to satisfy that requirement from the issue.Reusing the existing
SidebarProvider/useSidebar()/ cookie persistence already shipped inui/sidebar.tsxkept the diff small and means sidebar state still survives reloads.UI Changes
Video attached showing open → collapsed → open with
mod+b, thread switching while collapsed, and the animated header padding on macOS so the traffic lights aren't covered.Schermopname.2026-04-23.om.12.20.58.mov
Checklist
Note
Medium Risk
Moderate risk because it changes global keyboard handling (including capture-phase listeners) and lifts sidebar state to the app root, which could affect shortcut precedence and layout behavior across routes.
Overview
Introduces a new
sidebar.togglekeybinding command, registered in contracts/server defaults (bound tomod+bwhen!terminalFocus) and documented inKEYBINDINGS.md, with corresponding test coverage updates.Updates the web app to allow toggling the thread sidebar from both the command palette (new “Toggle sidebar” action showing the shortcut) and a global capture-phase keydown handler to avoid editor interception. Sidebar state management is lifted by moving
SidebarProviderto the root route, and the sidebar wrapper now exposesdata-stateso Electron drag-region headers (ChatView,NoActiveThreadState,settings) can adjust left padding/transition when collapsed.Reviewed by Cursor Bugbot for commit 5b49b1e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add collapsible sidebar with
mod+bkeybinding and command palette actionsidebar.togglecommand registered in keybinding contracts, server defaults, and the command palette, mapped tomod+bwhen not in terminal focus.SidebarProviderfromAppSidebarLayoutto the app root in__root.tsxso sidebar state is accessible across routes._chat.tsxto interceptmod+bbefore editor handlers (e.g. bold) can consume it.group-dataselectors on theSidebarProviderwrapper.Macroscope summarized 5b49b1e.