Skip to content

feat(web): toggle thread pin from the keyboard - #132

Merged
rynfar merged 1 commit into
pylonfrom
upstream/2026-08-28-thread-pin-keybinding
Aug 29, 2026
Merged

feat(web): toggle thread pin from the keyboard#132
rynfar merged 1 commit into
pylonfrom
upstream/2026-08-28-thread-pin-keybinding

Conversation

@rynfar

@rynfar rynfar commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Pinning a thread required reaching for its context menu. Adds mod+shift+p to
pin or unpin the thread you have open.

The shortcut is gated on the environment's threadPinning capability, ignored
while the terminal has focus, and reports failures through the usual thread
toast. Pylon already had the whole substrate — threadPinning: true in
ServerEnvironment, and pinThread/unpinThread in client-runtime — so this
only wires the keyboard path to it.

Adopted from T3 Code 4c51b4c9b6a85d96a22e0df41d5cfd2d8fc9901d, cherry-picked
clean with no adaptation.

Both directions are covered, so this is not a one-way door: the same shortcut
unpins. Because the command is added to THREAD_KEYBINDING_COMMANDS in
contracts, it also shows up in Settings → Keybindings for rebinding without any
extra label wiring — checked rather than assumed.

Verification

  • vp test run apps/server/src/keybindings.test.ts — 22 passed
  • Mutation probe: removing the mod+shift+p default fails the test
    (expected undefined to equal 'mod+shift+p')
  • vp run -F @t3tools/web typecheck, -F @t3tools/contracts typecheck,
    -F @t3tools/shared typecheck — all clean
  • Docs updated by the same commit: docs/user/keybindings.md and
    docs/user/thread-sidebar.md, both already in Pylon's voice with no T3
    references

Keyboard-only change, so no screenshots.

Claude Opus 5 via Claude Code.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Add a mod+shift+p shortcut that pins or unpins the active thread. Ignore the shortcut during terminal focus and when the server does not support thread pinning.

(cherry picked from commit 4c51b4c9b6a85d96a22e0df41d5cfd2d8fc9901d)
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 28, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.3 KiB 13.3 KiB +58 B (+0.4%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB +1 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB +57 B (+0.9%) 7.8 KiB
Codex Live turn WebSocket decoded 55.5 KiB 55.6 KiB +44 B (+0.1%) 66.4 KiB
Codex Live turn messages 9 10 +1 (+11.1%) 21
Claude Total thread wire 13.3 KiB 13.3 KiB −5 B (−0.0%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB +7 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB −12 B (−0.2%) 7.8 KiB
Claude Live turn WebSocket decoded 56.4 KiB 56.4 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 2b7a9b8 · PR result: 51ac00b · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 109.4 KiB
  • Claude decoded thread snapshot: 110.1 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar

rynfar commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

Independent review pass. One low-confidence finding, nothing fixed.

mod+shift+p is a Firefox-reserved accelerator (New Private Window) that
preventDefault cannot reclaim, so the shortcut is dead in Firefox. Noted as a
tradeoff rather than a defect: mod+shift+n already ships with the same class of
conflict against Chrome's incognito window, and the command is rebindable in
Settings → Keybindings because it goes through THREAD_KEYBINDING_COMMANDS.

The review confirmed the things I would have wanted checked:
pinThread/unpinThread signatures match the sidebar and context-menu callers,
both re-check the threadPinning capability internally so version skew is covered
twice, serverConfig resolves from the active thread's environment so
supportsPinning matches the thread being toggled, the effect's dependency array
gained every new closed-over value, shiftKey is compared exactly so the chord
cannot also fire mod+p filePicker.toggle, existing installs pick up the new
default via syncDefaultKeybindingsOnStartup, repeated presses are a server-side
no-op re-emit, and no command-palette or settings map needed a new entry.

@rynfar
rynfar merged commit 2923669 into pylon Aug 29, 2026
14 checks passed
@rynfar
rynfar deleted the upstream/2026-08-28-thread-pin-keybinding branch August 29, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants