From 5b0cda9c014757df166ca883ee87c2efae6ed648 Mon Sep 17 00:00:00 2001 From: wusumac <736139669@qq.com> Date: Sun, 2 Aug 2026 21:23:45 +0800 Subject: [PATCH] fix(web): don't auto-expand directory groups when opening pinned running sessions --- web/src/components/SessionList.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/components/SessionList.tsx b/web/src/components/SessionList.tsx index 47bd374d..0d6962c2 100644 --- a/web/src/components/SessionList.tsx +++ b/web/src/components/SessionList.tsx @@ -1170,7 +1170,11 @@ export function SessionList(props: { return } - const group = allGroups.find(g => + // Pinned "in progress" sessions are not rendered inside directory + // groups, so only auto-expand when the selected session actually lives + // in a visible group. Using `allGroups` here would expand the group + // below whenever a running session is opened. + const group = groups.find(g => g.sessions.some(s => s.id === selectedSessionId) ) if (!group) return @@ -1180,7 +1184,7 @@ export function SessionList(props: { autoExpandedSelectedSessionKeyRef.current = autoExpandKey setCollapseOverrides(prev => expandSelectedSessionCollapseOverrides(prev, group)) - }, [selectedSessionId, allGroups]) + }, [selectedSessionId, groups]) // Clean up stale collapse overrides useEffect(() => {