Skip to content

feat(web): rename focused sidebar thread with f2 - #6454

Open
tarik02 wants to merge 1 commit into
pingdotgg:mainfrom
tarik02:feat/f2-thread-rename
Open

feat(web): rename focused sidebar thread with f2#6454
tarik02 wants to merge 1 commit into
pingdotgg:mainfrom
tarik02:feat/f2-thread-rename

Conversation

@tarik02

@tarik02 tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What Changed

Adds a configurable thread.rename command 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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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.rename command (default F2) so inline rename works from keyboard when focus is on a sidebar thread row in both sidebar implementations. Rows get data-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 generic role="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

  • Pressing F2 (or a configured thread.rename binding) 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.
  • Adds thread.rename to the keybindings contract and sets F2 as the default in shared/src/keybindings.ts.
  • Extends keybindingFromKeyboardEvent to recognize bare function keys (e.g. F2) as valid keybindings without requiring a modifier.
  • Prevents type-to-focus and composer autofocus from interfering when a thread row or thread item has focus.
  • Behavioral Change: commitRename in SidebarProjectItem no longer clears renaming state directly; rename session cleanup is deferred to the keydown handler.

Macroscope summarized ba42a6d.

@coderabbitai

coderabbitai Bot commented Aug 13, 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: 2b125416-7a06-4256-8ce5-141e917d1e2b

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

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.

❤️ Share

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 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/shared/src/keybindings.ts
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

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

@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from 1694c5a to e3e8242 Compare August 13, 2026 11:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/web/src/components/Sidebar.tsx Outdated
@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from e3e8242 to df3b2eb Compare August 13, 2026 11:35
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Aug 13, 2026
@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/web/src/components/Sidebar.tsx Outdated
previewOpen: routePreviewOpen,
modelPickerOpen: isModelPickerOpen(),
}),
[routePreviewOpen, routeTerminalOpen],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 60bd540. The stable getter now reads the active route ref and panel state from store snapshots at keydown time.

@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from df3b2eb to 60bd540 Compare August 13, 2026 11:44
@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 60bd540f02

ℹ️ 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".

Comment thread apps/web/src/components/ChatView.tsx
@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from 60bd540 to d90bdf9 Compare August 13, 2026 11:53
@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/ChatView.tsx
@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from d90bdf9 to 571225f Compare August 13, 2026 12:01
@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +631 to +633
void commitRename(threadRef, renamingTitle, thread.title).then(() => {
window.requestAnimationFrame(() => rowElementRef.current?.focus());
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba42a6d. Legacy rename now exits edit mode and restores row focus immediately on Enter, before awaiting the metadata request.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/LegacySidebar.tsx Outdated
@tarik02
tarik02 force-pushed the feat/f2-thread-rename branch from 571225f to ba42a6d Compare August 13, 2026 12:07
@tarik02

tarik02 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: ba42a6d3fe

ℹ️ 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".

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 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