Skip to content

feat(web): add an unbound keybinding to rename the active thread - #18562

Closed
Adeophan wants to merge 1 commit into
pingdotgg:mainfrom
Adeophan:feat/thread-rename-keybinding
Closed

Adeophan wants to merge 1 commit into
pingdotgg:mainfrom
Adeophan:feat/thread-rename-keybinding

Conversation

@Adeophan

Copy link
Copy Markdown

Problem

Renaming the open thread needs the mouse: double-click the header title, or open the title menu and pick Rename. There is no keybinding command or command palette entry for it, so keyboard-driven users can't rename without leaving the keyboard. Requested in #6772 and as item 2 of #6817.

Change

  • New thread.rename keybinding command. It ships unbound: DEFAULT_KEYBINDINGS is untouched, so no existing shortcut changes. Earlier attempts were closed over default chords (mod+shift+r collides with desktop Force Reload). Users bind it in Settings → Keybindings or keybindings.json, where it appears as "Thread: Rename".
  • A Rename thread command palette action shows the bound shortcut. The palette shortcut is also handled while the palette is open, matching how chat.find and thread.copyReference work.
  • Both start the existing inline rename in ChatHeader. Enter saves, Escape cancels, and blur saves, all unchanged. ChatView and the palette send a rename request for a specific thread over a small window-event bus (threadRenameActionBus.ts, same pattern as threadFindActionBus.ts). ChatHeader only acts on requests for its own thread.
  • One availability rule (canStartThreadRename) covers every entry point: a server-backed thread the user can operate, with the header title visible. A maximized right panel hides the title, except in the narrow layout. When the rule fails, the shortcut leaves the key alone. It also ignores auto-repeat and IME composition.
  • The palette refocuses the composer when it finishes closing, which would immediately blur (and commit) a freshly opened rename field. So the palette parks a one-shot request and sends it from its existing finalFocus callback, right after that refocus. Every other palette close keeps today's focus behaviour. Reopening the palette, or navigating away from the target thread, drops the parked request.

Not changed: desktop, whose Electron menu accelerators are fixed and which inherits the web behaviour; mobile, which already has rename as a thread list action; server, providers and MCP (t3_thread_update action=rename already exists).

Scope and approval

Requested in Ideas #6772 and #6817 (item 2). I couldn't find an explicit maintainer approval comment on either. I believe this is a focused configuration of an established capability: thread rename already exists in the header and menus, and this only exposes it as a bindable command plus a palette entry. Because it ships without a default binding, nothing changes for anyone who doesn't opt in. Closed attempts #6454, #7573 and #15573 added default chords; #11430 was unbound and closed only for missing a recording, which is included below.

Verification

Focused tests:

  • apps/web: vp test run src/components/chat/threadRenameActionBus.test.ts src/keybindings.test.ts src/components/settings/KeybindingsSettings.logic.test.ts → 178 passed. New cases cover:
    • the availability rule, including the narrow-layout exception;
    • requests reaching only the subscriber for the exact thread;
    • a parked request firing exactly once;
    • a parked request being dropped after navigating away and back, or after cancelling.
  • packages/contracts: vp test run src/keybindings.test.ts → 11 passed.
  • vp run typecheck in apps/web and packages/contracts; vp lint and vp fmt on touched files.

Manual end-to-end in a real browser against a dev server with seeded real data:

  1. In Settings → Keybindings → Add keybinding, picked "Thread: Rename", recorded F2, set when to !terminalFocus && !editableFocus, and saved.
  2. In a thread, pressed F2. The header title became a focused input with the whole title selected. Typed a name and pressed Enter: it saved, and the header and sidebar updated.
  3. Pressed F2, typed, then Escape: the edit was discarded.
  4. Ctrl+K, typed "rename": the Rename thread action showed F2. Pressing Enter closed the palette, and the title input kept focus with the title selected; it did not jump to the composer. Typed a name and pressed Enter: it saved.
  5. With focus in the composer, F2 did nothing, as the when clause requires.

Recording (sped up, idle time removed): thread.rename end-to-end
MP4: compact · full-length original

Before (main): no rename action in the palette After: Rename thread with its bound shortcut
before after

After: "Thread: Rename" is listed in Settings → Keybindings → Add keybinding.
settings

Not checked:

  • The maximized-right-panel and IME guards are covered by the unit tests only, not exercised live.
  • Desktop (Electron) and mobile clients were not run.
  • The recording was made just before rebasing onto current main. The rebase only resolved a conflict with the new "Copy prompt link" palette actions. Afterwards I reran the focused tests and repeated the F2 and palette checks live.

Implemented with Claude Opus 5.5 in Claude Code (running inside T3 Code); code and architecture review by GPT-6.1 Sol.

🤖 Generated with Claude Code

Renaming the active thread from the chat header needed a mouse: a
double-click on the title or the title menu. There was no command to
reach it from the keyboard or the command palette.

Add a `thread.rename` keybinding command that starts the existing
inline header rename. It ships without a default shortcut; users bind it
in Settings -> Keybindings or keybindings.json. ChatView and the command
palette send a rename request for a specific thread over a small
window-event bus, and ChatHeader starts its existing rename only for
requests that target its thread.

One availability rule decides every entry point: a server thread the
user can operate, with the header visible (a maximized right panel hides
it). The shortcut, the palette action and the palette shortcut use it,
and ChatHeader ignores requests while it is false. The shortcut leaves
the key alone when unavailable or during IME composition, and ignores
auto-repeat.

The palette restores focus to the composer as it finishes closing, which
would blur the new rename field at once. Its "Rename thread" action and
shortcut therefore defer the request and the palette sends it right
after that focus restore. Reopening the palette or navigating away
from the thread drops a pending request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 12, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new user-facing rename workflow through the command palette and a bindable keybinding, with cross-component focus and event coordination beyond the existing rename UI. The keybinding is unbound and backward-compatible, but the default-visible palette capability makes this a feature addition that merits human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c596d822-3eca-4046-aca1-03d9401d06f6

📥 Commits

Reviewing files that changed from the base of the PR and between 8f25cf9 and d9f9ca8.


📒 Files selected for processing (11)
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/CommandPalette.tsx
  • apps/web/src/components/chat/ChatHeader.tsx
  • apps/web/src/components/chat/threadRenameActionBus.test.ts
  • apps/web/src/components/chat/threadRenameActionBus.ts
  • apps/web/src/components/chat/useCanStartThreadRename.ts
  • apps/web/src/components/settings/KeybindingsSettings.logic.test.ts
  • apps/web/src/keybindings.test.ts
  • docs/user/keybindings.md
  • packages/contracts/src/keybindings.test.ts
  • packages/contracts/src/keybindings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The change adds thread.rename to the keybinding contract and supports renaming eligible server threads from ChatView or the command palette. The command palette can defer a rename until composer focus returns. ChatHeader starts the rename for a matching thread.

Changes

Thread Rename

Layer / File(s) Summary
Command and rename eligibility
packages/contracts/src/keybindings.ts, packages/contracts/src/keybindings.test.ts, apps/web/src/keybindings.test.ts, apps/web/src/components/settings/KeybindingsSettings.logic.test.ts, docs/user/keybindings.md, apps/web/src/components/chat/threadRenameActionBus.ts, apps/web/src/components/chat/useCanStartThreadRename.ts, apps/web/src/components/chat/threadRenameActionBus.test.ts
The keybinding contract includes thread.rename, and tests cover parsing and focus conditions. Rename eligibility checks server-thread status, permission, and right-panel layout. The documentation describes how to invoke and control renaming.
Scoped and deferred rename requests
apps/web/src/components/chat/threadRenameActionBus.ts, apps/web/src/components/chat/threadRenameActionBus.test.ts
The action bus dispatches rename requests only to subscribers with a matching environment and thread. It supports deferring one request, cancelling it, dropping it when the active thread changes, and flushing it once. Tests cover routing and deferred-request behavior.
Rename command entry points
apps/web/src/components/ChatView.tsx, apps/web/src/components/CommandPalette.tsx, apps/web/src/components/chat/ChatHeader.tsx
ChatView and the command palette handle eligible rename shortcuts. The palette adds a Rename thread action and defers accepted requests until composer focus returns. ChatHeader subscribes to eligible requests for the active thread and invokes startRename.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CommandPalette
  participant threadRenameActionBus
  participant ChatHeader
  CommandPalette->>threadRenameActionBus: Defer rename for active thread
  CommandPalette->>threadRenameActionBus: Flush when composer focus returns
  threadRenameActionBus->>ChatHeader: Dispatch matching thread rename
  ChatHeader->>ChatHeader: Invoke startRename
Loading

Suggested reviewers: juliusmarminge


Merge Risk | ⚪ Minimal · up to d9f9c

Merge Risk: ⚪ Minimal · up to d9f9c

The rename command is ready for normal merge checks; no actionable issue remains from this review.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to d9f9c

The new commands reuse the existing permission-checked rename operation and remain tied to the selected environment and thread. Deferred requests are delivered once and discarded when navigation changes their target. No material security regression was found in the reviewed flow.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added initiation surface is confined to matching environment-scoped header consumers in the current browser window. Same-origin code can synthesize the event, but its payload only requests editing; it does not provide a title or directly persist metadata. The reviewed flow introduces no additional rename authority.

Trust Boundaries and Controls

  • observed — Event identity matching is separate from mutation authorization. Both scope identifiers must match before the listener runs, while rename start, commit, and orchestration command dispatch check operate permission. The existing server RPC authorization mapping also retains the operate-scope requirement.

Resilience and Maintainability Implications

  • observed — A deferred request does not carry an authorization grant: delivery uses the consumer's current checks, and commit checks authority again. Clearing pending state before delivery bounds repetition, while stale-route cleanup preserves target ownership across interrupted palette transitions.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding an unbound keybinding to rename the active thread. It is concise and uses the repository's conventional commit format.
Description check Passed The description covers the problem, implementation, scope, approval context, focused tests, manual verification, screenshots, recording, limitations, and agent attribution. It explains the absence of …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Thanks for adding keyboard access to thread renaming. The existing header and menu actions work; this PR adds a bindable command and palette entry. Right now we are only taking focused bug fixes from outside contributors under Read this first, even though the guide allows some configuration options. Please keep the proposal in the linked Ideas discussions and request reconsideration if maintainers choose to take on this scope.

@maria-rcks maria-rcks closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants