diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.test.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.test.tsx index 70333b27c76..89cca25382e 100644 --- a/ui/src/components/coordinator/CoordinatorNeedsYou.test.tsx +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.test.tsx @@ -209,5 +209,11 @@ describe("Coordinator Needs You", () => { await click("Decision history"); expect(fixture.openPanel).toHaveBeenCalled(); expect(fixture.setPanelVisible).toHaveBeenCalledWith(true); + // The shared desktop hide control changes visibility without closing + // this tab. Clicking history again must reveal the already-open tab. + fixture.setPanelVisible(false); + fixture.setPanelVisible.mockClear(); + await click("Decision history"); + expect(fixture.setPanelVisible).toHaveBeenCalledWith(true); }); }); diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx index 8cb56c1bb24..58f7857a635 100644 --- a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx @@ -149,7 +149,7 @@ export function CoordinatorNeedsYou() { ]).entries()], [pendingItems, recentItems]); const filtersActive = Boolean(query.trim() || agentFilter || projectFilter); const closeHistory = useCallback(() => { setHistoryOpen(false); closePanel(); }, [closePanel]); - const showHistory = () => setHistoryOpen(true); + const showHistory = () => { setHistoryOpen(true); if (!isMobile) setPanelVisible(true); }; useEffect(() => { setBreadcrumbs([{ label: "Needs You" }]); }, [setBreadcrumbs]); useEffect(() => { setSettling([]); setHistoryOpen(false); setNow(Date.now()); closePanel();