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: Needs human review The PR is broken - it imports from You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 2425a0d
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 interaction change in one component; no auth, data, or API surface changes.
Overview
Right panel tab rows now support middle-click to close, matching common browser/editor tab behavior.
onMouseDownprevents the default middle-button action (e.g. autoscroll), andonAuxClickcloses the tab via the existingonCloseSurfacepath—the same cleanup as the close button and context menu.Reviewed by Cursor Bugbot for commit 811baa1. 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 in RightPanelTabs.tsx. Middle-clicking a tab callsprops.onCloseSurface(surface)and suppresses the default browser middle-click behavior (e.g. auto-scroll).Macroscope summarized 811baa1.