mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user