Add middle-click close for right panel tabs#3161
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Approved Simple, self-contained UI enhancement adding middle-click to close tabs. The logic is trivial (checking mouse button === 1), includes a unit test, and uses existing close functionality with no side effects. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
What Changed
Adds support for closing right panel tabs with a middle mouse click.
This applies to the tab strip in the expandable right panel, including browser preview tabs and singleton surfaces like Diff. Middle-click uses the same close path as the existing tab close button, so existing cleanup behavior is preserved.
Why
Right panel tabs behave like browser/editor tabs, where middle-click is a common shortcut for closing a tab. The previous implementation only allowed closing via the visible close button or context menu, which makes repeated tab cleanup slower.
UI Changes
No static visual changes.
Interaction change: middle-clicking a right panel tab now closes that tab.
Checklist
Note
Low Risk
Small UI-only interaction change that routes through the existing tab close callback; no auth, data, or backend impact.
Overview
Right panel tab strips now support middle-click to close, matching common browser/editor tab behavior.
Each tab gets
onMouseDownandonAuxClickhandlers that call the existingonCloseSurfacepath (same as the close button and context menu). A smallshouldCloseRightPanelTabOnAuxClickhelper limits the action to the middle button (button === 1); left and right clicks are unchanged.preventDefaulton middlemousedownavoids default browser behavior such as autoscroll.Reviewed by Cursor Bugbot for commit a56c2e1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add middle-click close for right panel tabs
Adds
onMouseDownandonAuxClickhandlers to each tab inRightPanelTabs. Middle-clicking a tab callsonCloseSurfacefor that tab and suppresses default browser behavior (e.g. autoscroll); left and right clicks are unaffected.Macroscope summarized a56c2e1.