From aab23b3eeffd0570f7c43fd0f82c94d7cbcba1ea Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 5 May 2026 00:13:44 -0400 Subject: [PATCH] fix(resource-usage): keep popover open after navigation navigateToWorktree and navigateToTab no longer close the popover, so users can chain multiple jumps (browse worktrees, hop between terminals) without re-opening the segment each time. The popover still closes via outside-click / Escape. Co-authored-by: Orca --- .../status-bar/ResourceUsageStatusSegment.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx index 5158f65b2fc..89948da670e 100644 --- a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx +++ b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx @@ -823,16 +823,15 @@ export function ResourceUsageStatusSegment({ }) }, []) + // Why: navigation handlers leave the popover open so users can chain + // multiple jumps (e.g. browse worktrees, hop between terminals) without + // having to re-open the popover each time. The popover still closes via + // its own outside-click / Escape handlers. const navigateToWorktree = useCallback((worktreeId: string): void => { if (worktreeId === ORPHAN_WORKTREE_ID || worktreeId.startsWith(`${UNATTRIBUTED_REPO_ID}::`)) { - setOpen(false) return } - const result = activateAndRevealWorktree(worktreeId) - if (result === false) { - return - } - setOpen(false) + activateAndRevealWorktree(worktreeId) }, []) const navigateToTab = useCallback( @@ -847,7 +846,6 @@ export function ResourceUsageStatusSegment({ } setActiveView('terminal') setActiveTab(tabId) - setOpen(false) }, [tabsByWorktree, setActiveTab, setActiveView] )