feat(web): toggle a thread's pin from the keyboard - #8440
Conversation
Pinning a thread needed the sidebar or chat-header context menu. Added a `thread.pin` command that toggles the pin on the thread you have open, defaulting to `mod+shift+p` and inactive while the terminal has focus. The handler sits next to `thread.settle` in ChatView and dispatches through the shared `pinThread`/`unpinThread` actions, so a fresh pin lands at the top of the pinned run and the `threadPinning` capability gate keeps the command away from older servers. Model: Claude Opus 5. Harness: Claude Code.
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Environments without pin reordering keep keyless pins in newest-first order below arranged ones, so an older thread pinned there lands below newer pins. Point at the sidebar doc, which already owns those rules.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new default-enabled keyboard workflow that pins or unpins the active thread and mutates persisted server state through existing actions. Although the implementation is small and capability-gated, it introduces new user-facing production behavior, so human review is appropriate. You can add or adjust custom eligibility rules. Learn more. |
Screen.Recording.2026-08-27.at.10.01.37.PM.mov
===== DESCRIPTION BELOW GENERATED BY AI =====
Pinning a thread was only reachable by pointer: the sidebar row's context menu or the chat header's action menu. Every other thread-lifecycle action of that weight (settle, thread traversal, jump) already has a binding, so pinning was the odd one out for keyboard-driven users.
Added a
thread.pincommand that toggles the pin on the thread you have open. It defaults tomod+shift+p, pairing withthread.settle'smod+shift+s, and carrieswhen: "!terminalFocus"so it stays out of the way while you are in a terminal.The handler sits next to
thread.settleinChatViewand dispatches through the sharedpinThread/unpinThreadfromuseThreadActions, so it places a fresh pin exactly like the menu actions do (top of the arranged run where the server supports pin reordering, keyless otherwise), and failures raise the same stacked toast. ThethreadPinningcapability gate keeps the command from reaching a server that predates pinning.Surfaces
thread.pinjoinsTHREAD_KEYBINDING_COMMANDS, so it flows intoSTATIC_KEYBINDING_COMMANDSand appears in Settings → Keybindings, auto-labeled "Thread: Pin".ResolvedKeybindingsConfigis aForwardCompatibleArray, so clients that predate the command drop the rule instead of failing the whole config.threadPinningcapability, same contract as settle and snooze.docs/user/keybindings.mdanddocs/user/thread-sidebar.md.Notes
mod+shift+pis free in the default set. Firefox bindsCmd/Ctrl+Shift+Pto a private window, so Firefox users will want to rebind — the same tradeoffmod+shift+salready makes with Firefox's screenshot chord.Under the legacy sidebar there is no pinned section, so the shortcut pins with no visible effect there. That is pre-existing rather than new: the chat header's action menu already offers Pin under the legacy sidebar. Gating the shortcut would have made it disagree with the menu item beside it.
Model: Claude Opus 5. Harness: Claude Code.
Note
Add
thread.pinkeyboard command bound tomod+shift+pthread.pinto theTHREAD_KEYBINDING_COMMANDSunion type and registers a default keybinding ofmod+shift+pwith a!terminalFocuswhen-clause in keybindings.ts.pinThread/unpinThreadfromuseThreadActions, surfacing errors through a toast.Macroscope summarized 1950a4c.
Note
Low Risk
Small, capability-gated UI change that reuses existing pin/unpin actions; no auth or data-model changes.
Overview
Adds a
thread.pinkeybinding so keyboard users can pin or unpin the active thread without opening the sidebar or header menus, matching other thread lifecycle shortcuts likethread.settle.The command is registered in contracts and
DEFAULT_KEYBINDINGSasmod+shift+pwithwhen: "!terminalFocus". InChatView, the global keydown handler toggles pin state via existingpinThread/unpinThreadwhen the server exposesthreadPinning, and shows the same error toasts on failure. User docs for keybindings and the thread sidebar describe the shortcut.Reviewed by Cursor Bugbot for commit 1950a4c. Bugbot is set up for automated code reviews on this repo. Configure here.