feat(web): rename focused sidebar thread with f2 - #6454
Conversation
|
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:
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ba027148
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (F2 keyboard shortcut for thread rename) that changes runtime behavior. New features warrant human review to validate UX and ensure proper integration with existing shortcut handling. You can customize Macroscope's approvability policy. Learn more. |
|
@codex review |
1694c5a to
e3e8242
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1694c5a49b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e3e8242 to
df3b2eb
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df3b2eb9a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| previewOpen: routePreviewOpen, | ||
| modelPickerOpen: isModelPickerOpen(), | ||
| }), | ||
| [routePreviewOpen, routeTerminalOpen], |
There was a problem hiding this comment.
Keep the shortcut-context getter stable
Opening or closing the active thread's terminal or preview recreates this callback because both states are dependencies, and the callback is passed as a prop to every memoized SidebarThreadRow; this forces the entire visible thread list to rerender on each panel toggle. LegacySidebar drills an equivalently state-dependent callback through every project and row, so the same regression affects both implementations. Read the volatile context through refs or store snapshots behind a stable getter so these frequent UI actions do not invalidate every row.
AGENTS.md reference: AGENTS.md:L15-L17
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 60bd540. The stable getter now reads the active route ref and panel state from store snapshots at keydown time.
df3b2eb to
60bd540
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
60bd540 to
d90bdf9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d90bdf9db1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d90bdf9 to
571225f
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 571225f4d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| void commitRename(threadRef, renamingTitle, thread.title).then(() => { | ||
| window.requestAnimationFrame(() => rowElementRef.current?.focus()); | ||
| }); |
There was a problem hiding this comment.
Avoid restoring focus after the rename request resolves
When Enter commits a rename and the metadata request takes noticeable time—especially over a remote connection—the input remains active until the request finishes, but this new .then(...) then focuses the row unconditionally. If the user clicks or tabs to the composer or another control while waiting, completion steals focus back to the old row. Restore focus as part of the immediate keyboard transition, or guard that focus has not deliberately moved before running the callback.
AGENTS.md reference: AGENTS.md:L19-L21
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ba42a6d. Legacy rename now exits edit mode and restores row focus immediately on Enter, before awaiting the metadata request.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort 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 571225f. Configure here.
571225f to
ba42a6d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

What Changed
Adds a configurable
thread.renamecommand with F2 as the default shortcut.Pressing F2 while focus is anywhere within a sidebar thread item now opens its existing inline rename field and selects the full title. Enter saves the title and Escape cancels. This works in both sidebar implementations.
Why
Thread rename was only available through pointer interactions such as the context menu and double-click. Handling F2 on the focused sidebar item makes rename keyboard-accessible while keeping the shortcut scoped to the intended thread.
The sidebar also retains focus when navigating between threads instead of immediately moving it to the composer.
UI Changes
browser-recording-msrelwa3.mp4
Checklist
Built with GPT-5.6-Sol via the Codex harness in T3 Code.
Note
Low Risk
UI keyboard/focus behavior only; no auth, data, or API changes. Risk is limited to edge cases in composer auto-focus and global shortcuts.
Overview
Adds a
thread.renamecommand (default F2) so inline rename works from keyboard when focus is on a sidebar thread row in both sidebar implementations. Rows getdata-thread-row, rename commit/cancel returns focus to the row, and shortcut resolution is wired through shared keybinding context (including preview focus/open).ChatView stops stealing focus to the composer when the active element is inside
[data-thread-item], and type-to-focus-composer ignores space on thread rows and treats thread rows separately from genericrole="button"targets.Keybinding recording now accepts bare function keys (e.g. F2). Docs and contracts list the new command.
Reviewed by Cursor Bugbot for commit ba42a6d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add F2 keybinding to rename focused sidebar thread rows
thread.renamebinding) while a sidebar thread row is focused starts inline rename in both Sidebar.tsx and LegacySidebar.tsx; focus returns to the row after Enter/Escape.thread.renameto the keybindings contract and sets F2 as the default in shared/src/keybindings.ts.keybindingFromKeyboardEventto recognize bare function keys (e.g. F2) as valid keybindings without requiring a modifier.commitRenameinSidebarProjectItemno longer clears renaming state directly; rename session cleanup is deferred to the keydown handler.Macroscope summarized ba42a6d.