Skip to content

feat(web): toggle a thread's pin from the keyboard - #8440

Open
ipanasenko wants to merge 2 commits into
pingdotgg:mainfrom
ipanasenko:t3code/add-thread-pin-shortcut
Open

feat(web): toggle a thread's pin from the keyboard#8440
ipanasenko wants to merge 2 commits into
pingdotgg:mainfrom
ipanasenko:t3code/add-thread-pin-shortcut

Conversation

@ipanasenko

@ipanasenko ipanasenko commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
image
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.pin command that toggles the pin on the thread you have open. It defaults to mod+shift+p, pairing with thread.settle's mod+shift+s, and carries when: "!terminalFocus" so it stays out of the way while you are in a terminal.

The handler sits next to thread.settle in ChatView and dispatches through the shared pinThread / unpinThread from useThreadActions, 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. The threadPinning capability gate keeps the command from reaching a server that predates pinning.

Surfaces

  • Clients: web, and desktop by wrapping it. Mobile has no keybinding layer.
  • Contracts: thread.pin joins THREAD_KEYBINDING_COMMANDS, so it flows into STATIC_KEYBINDING_COMMANDS and appears in Settings → Keybindings, auto-labeled "Thread: Pin". ResolvedKeybindingsConfig is a ForwardCompatibleArray, so clients that predate the command drop the rule instead of failing the whole config.
  • Reverse state: the one command toggles both directions.
  • Version skew: gated on the threadPinning capability, same contract as settle and snooze.
  • Defaults seeding: the server's startup sync adds the new rule unless a user rule already claims that command or that chord.
  • Docs: docs/user/keybindings.md and docs/user/thread-sidebar.md.

Notes

mod+shift+p is free in the default set. Firefox binds Cmd/Ctrl+Shift+P to a private window, so Firefox users will want to rebind — the same tradeoff mod+shift+s already 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.pin keyboard command bound to mod+shift+p

  • Adds thread.pin to the THREAD_KEYBINDING_COMMANDS union type and registers a default keybinding of mod+shift+p with a !terminalFocus when-clause in keybindings.ts.
  • Integrates the command into the global keydown handler in ChatView.tsx: when the server supports pinning and an active server thread exists, the handler toggles pin state via pinThread/unpinThread from useThreadActions, surfacing errors through a toast.
  • Updates keybindings.test.ts to assert the default binding, and documents the shortcut in keybindings.md and thread-sidebar.md.

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.pin keybinding so keyboard users can pin or unpin the active thread without opening the sidebar or header menus, matching other thread lifecycle shortcuts like thread.settle.

The command is registered in contracts and DEFAULT_KEYBINDINGS as mod+shift+p with when: "!terminalFocus". In ChatView, the global keydown handler toggles pin state via existing pinThread / unpinThread when the server exposes threadPinning, 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.

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.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06701d93-2ddd-4f02-ba46-c3bceb5c2884

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 27, 2026
Comment thread docs/user/keybindings.md Outdated
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.
@ipanasenko
ipanasenko marked this pull request as ready for review August 27, 2026 20:03
@macroscopeapp

macroscopeapp Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant