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 <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-05-05 14:31:37 -04:00
co-authored by Orca
parent 3edebbb64e
commit c189624865
@@ -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