Skip to content

Double-click a sidebar thread row to rename#3064

Open
TheIcarusWings wants to merge 1 commit into
pingdotgg:mainfrom
TheIcarusWings:icaruswings/sidebar-dblclick-rename
Open

Double-click a sidebar thread row to rename#3064
TheIcarusWings wants to merge 1 commit into
pingdotgg:mainfrom
TheIcarusWings:icaruswings/sidebar-dblclick-rename

Conversation

@TheIcarusWings

@TheIcarusWings TheIcarusWings commented Jun 12, 2026

Copy link
Copy Markdown

Double-clicking a thread row in the sidebar now starts the inline rename, reusing the existing context-menu rename flow (Enter commits, Esc cancels, blur commits). A detail > 1 guard stops the trailing click of a double-click from also navigating, so cmd/shift multi-select is unaffected.

Tests

  • Unit: isTrailingDoubleClick covers single / synthetic / double / triple clicks.
  • Browser: double-click starts a focused, text-selected rename; Enter persists; Esc cancels; single-click still navigates.

🤖 Generated with Claude Code


Note

Low Risk
Sidebar interaction-only change with a small click-handling guard; no auth, API, or data-model changes beyond existing rename commit.

Overview
Double-click on a sidebar thread row now starts the same inline rename flow as the context menu (focused input with full title selected; Enter commits, Escape cancels).

The row wires onDoubleClick through a shared startThreadRename helper (also used by “Rename thread” in the menu). handleThreadClick skips navigation when MouseEvent.detail > 1 so the second click of a double-click does not open the thread.

SidebarThreadRow is exported for browser tests; coverage includes isTrailingDoubleClick (unit) and double-click / Enter / Escape / single-click behavior (browser).

Reviewed by Cursor Bugbot for commit ba0abbd. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add double-click to rename a thread row inline in the sidebar

  • Double-clicking a SidebarThreadRow now opens an inline rename input with the title pre-selected, mirroring the existing context-menu rename flow.
  • Adds isTrailingDoubleClick(detail) in Sidebar.logic.ts to detect and ignore the trailing click(s) fired by the browser as part of a double-click sequence, preventing unintended navigation.
  • The rename flow is unified: both the double-click and context-menu 'rename' action call the same startThreadRename callback on SidebarProjectItem.
  • Browser tests in Sidebar.dblclick.browser.tsx cover double-click open, Enter commit, Escape cancel, and single-click navigation.
📊 Macroscope summarized ba0abbd. 3 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

Double-clicking a thread row now starts the existing inline rename,
reusing the context-menu rename flow. A detail>1 guard keeps the
trailing click of a double-click from also navigating.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 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

Run ID: 5382b961-95ca-4a7a-9059-03e071c19ebe

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@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 Jun 12, 2026

@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 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 ba0abbd. Configure here.

// while a double-click is starting an inline rename.
if (isTrailingDoubleClick(event.detail)) {
return;
}

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.

Mobile sidebar closes before rename

Medium Severity

On mobile, the first tap of a double-tap still runs handleThreadClick, which calls setOpenMobile(false) and closes the sidebar before the row’s dblclick handler can start inline rename. Double-tap-to-rename therefore likely never works in the mobile sidebar even though desktop double-click does.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ba0abbd. Configure here.

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.

🟡 Medium

Double-clicking inside the rename input to select text bubbles dblclick to SidebarMenuSubButton, triggering handleRowDoubleClick which resets renamingTitle to thread.title and discards the user's edits. The input's onClick handler only stops click propagation, not dblclick. Consider adding onDoubleClick={stopPropagation} to the rename input to prevent the event from reaching the row button.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/Sidebar.tsx around line 595:

Double-clicking inside the rename input to select text bubbles `dblclick` to `SidebarMenuSubButton`, triggering `handleRowDoubleClick` which resets `renamingTitle` to `thread.title` and discards the user's edits. The input's `onClick` handler only stops `click` propagation, not `dblclick`. Consider adding `onDoubleClick={stopPropagation}` to the rename input to prevent the event from reaching the row button.

Evidence trail:
apps/web/src/components/Sidebar.tsx lines 595-603 (input element with onClick but no onDoubleClick), lines 505-507 (handleRenameInputClick stops propagation for click only), line 571 (parent onDoubleClick={handleRowDoubleClick}), lines 425-431 (handleRowDoubleClick calls startThreadRename(threadKey, thread.title)), lines 1804-1808 (startThreadRename calls setRenamingTitle(title) resetting to original thread.title).

@macroscopeapp

macroscopeapp Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces new double-click-to-rename functionality. Two unresolved review comments identify functional bugs: mobile double-tap doesn't work because the sidebar closes first, and double-clicking inside the rename input resets edits. These issues warrant human review before merging.

You can customize Macroscope's approvability policy. 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