From 41a1ca58add47f53bb64ddc6aa02be2d9a73faa9 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Mon, 1 Jun 2026 13:20:21 +0800 Subject: [PATCH] fix(chat): clean up history indicators (#3592) --- .../views/chat/components/chat-window.tsx | 77 +++++++++++-------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/packages/views/chat/components/chat-window.tsx b/packages/views/chat/components/chat-window.tsx index a0d752dc66..10125540ba 100644 --- a/packages/views/chat/components/chat-window.tsx +++ b/packages/views/chat/components/chat-window.tsx @@ -800,18 +800,16 @@ function SessionDropdown({ setConfirmingStopId(null); }, [confirmingStopId, pendingTaskBySessionId]); - // Cross-session aggregate signal for the closed-dropdown trigger. - // "Active" here means there's something interesting happening in a - // session OTHER than the one the user is currently looking at — the - // user already sees their own session's state via the StatusPill / - // unread auto-mark, so highlighting it on the trigger would be noise. - // Same priority rule as the row pips: running > unread. - const otherSessionRunning = sessions.some( + // Header state split: + // - inside the trigger: the current chat's own live state + // - beside the trigger: aggregate activity from other chats + const currentSessionRunning = activeSessionId ? inFlightSessionIds.has(activeSessionId) : false; + const otherRunningCount = sessions.filter( (s) => s.id !== activeSessionId && inFlightSessionIds.has(s.id), - ); - const otherSessionUnread = sessions.some( + ).length; + const otherUnreadCount = sessions.filter( (s) => s.id !== activeSessionId && s.has_unread, - ); + ).length; const handleConfirmDelete = (session: ChatSession) => { const sessionId = session.id; @@ -1039,7 +1037,7 @@ function SessionDropdown({ ) : (
-
+
{isRunning && } {showCompleted && !isRunning && } {showUnread && !isRunning && !showCompleted && ( @@ -1051,7 +1049,7 @@ function SessionDropdown({ )} {trailingStatus}
-
+
{isRunning && pendingTask && (