@devries-cameron20 / t3code-1 / commits / 0615fd7df1
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Add middle-click close for right panel tabs (#3161)

Co-authored-by: Julius Marminge <jmarminge@gmail.com>

Hugo Blom committed Jun 30, 2026 at 19:13 UTC 0615fd7df1ec04303dd13e86d9276aac3057096a
1 file changed +15
apps/web/src/components/RightPanelTabs.tsx
+15
@@ -331,6 +331,19 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
331 },
332 [props],
333 );
334 + const handleTabMouseDown = useCallback((event: ReactMouseEvent) => {
335 + if (event.button !== 1) return;
336 + event.preventDefault();
337 + }, []);
338 + const handleTabAuxClick = useCallback(
339 + (event: ReactMouseEvent, surface: RightPanelSurface) => {
340 + if (event.button !== 1) return;
341 + event.preventDefault();
342 + event.stopPropagation();
343 + props.onCloseSurface(surface);
344 + },
345 + [props],
346 + );
347
348 useEffect(() => {
349 const activeTab = tabListRef.current?.querySelector<HTMLElement>("[data-active-tab='true']");
@@ -367,6 +380,8 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
380 <div
381 key={surface.id}
382 data-active-tab={active}
383 + onMouseDown={handleTabMouseDown}
384 + onAuxClick={(event) => handleTabAuxClick(event, surface)}
385 onContextMenu={(event) => void handleTabContextMenu(event, surface)}
386 className={cn(
387 "group flex h-7 min-w-25 max-w-44 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm",