From c189624865b79d5faef9a80e7c912ef280e36797 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 5 May 2026 13:53:47 -0400 Subject: [PATCH] fix(resource-usage): keep popover open when terminal steals focus Clicking a terminal row in the popover calls setActiveTab(tabId), which causes xterm to programmatically focus the terminal DOM node. Radix Popover treated that focus shift as a focus-outside event and fired onOpenChange(false), closing the popover even though navigateToTab no longer calls setOpen(false). Suppress focus-driven closes on PopoverContent. The popover still closes on outside-click (onPointerDownOutside default) and Escape. Co-authored-by: Orca --- .../components/status-bar/ResourceUsageStatusSegment.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx index 2750ca6a5d3..52fc0c3aedc 100644 --- a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx +++ b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx @@ -979,6 +979,12 @@ export function ResourceUsageStatusSegment({ sideOffset={8} className="w-[26rem] p-0" onOpenAutoFocus={(event) => event.preventDefault()} + // Why: clicking a terminal row calls setActiveTab, which causes + // xterm to programmatically focus the terminal DOM node. Radix + // would interpret that as a focus-outside event and close the + // popover. Suppress focus-driven closes; the popover still closes + // on outside-click (onPointerDownOutside default) and Escape. + onFocusOutside={(event) => event.preventDefault()} > {/* Why: header strip — title on the left, daemon-control icons on the right. The tab switcher was removed because a single unified