diff --git a/frontend/app/components/assistant-ui/thread-list.tsx b/frontend/app/components/assistant-ui/thread-list.tsx index 0e33ae7..4bcbeda 100644 --- a/frontend/app/components/assistant-ui/thread-list.tsx +++ b/frontend/app/components/assistant-ui/thread-list.tsx @@ -129,6 +129,9 @@ type ClawReplaySnapshot = SessionReplaySnapshot< ClawRunStatus >; +const SESSION_BADGE_POLL_INTERVAL_MS = 2000; +const MAX_SESSION_BADGE_POLL_COUNT = 80; + function replaySessionSnapshot( replaySession: ReplaySessionFn, sessionId: string, @@ -359,6 +362,7 @@ const ClawSessionList: FC = () => { const renameInputRef = useRef(null); const openRequestRef = useRef(0); const openAbortRef = useRef(null); + const sessionBadges = useSessionRunBadges(sessions, activeSessionId); useEffect(() => { setActiveSessionId(readActiveSessionId()); @@ -423,6 +427,7 @@ const ClawSessionList: FC = () => { }; const openSession = async (sessionId: string) => { + sessionBadges.markRead(sessionId); const requestId = openRequestRef.current + 1; openRequestRef.current = requestId; openAbortRef.current?.abort(); @@ -473,6 +478,7 @@ const ClawSessionList: FC = () => { {sessions.map((session) => { const active = activeSessionId === session.session_id; const loading = loadingSessionId === session.session_id; + const badge = sessionBadges.bySessionId.get(session.session_id); return (
{ )} +