agent-orchestrator/packages/web/src/components
Harsh Batheja 8625137702 feat: event-driven live tab titles and favicons via SSE (#848)
* feat: event-driven live tab titles and favicons via SSE

Switch tab titles and favicons from polling to real-time SSE updates:

- Extend useSessionEvents to expose sseAttentionLevels map from SSE
  snapshots (server-computed, includes full PR state)
- Refactor DynamicFavicon to use SSE attention levels instead of
  recomputing from the full sessions array (which has stale PR data
  between refreshes)
- Add useSSESessionActivity hook for session detail page to update
  document.title emoji immediately on activity change
- Add live dashboard title showing count of sessions needing attention
- Update PullRequestsPage to use new DynamicFavicon API

Closes #115

* fix: seed initial attention levels to avoid stale favicon/title on first render

Accept initialAttentionLevels parameter in useSessionEvents so callers
can seed the attention map from initialSessions via getAttentionLevel().
This prevents the favicon and dashboard title from briefly showing
"all clear" before the first SSE snapshot arrives.

* fix: add EventSource mock to session page test for SSE hook compatibility

* fix: reset stale activity state when sessionId changes in useSSESessionActivity

Add sessionId to the effect dependency array and reset state to null at
the start of each effect run so callers that reuse the hook with a
different sessionId don't see the previous session's activity.

* fix: reset sseAttentionLevels on initialSessions change to prevent stale data on project switch

The reset action now accepts an optional sseAttentionLevels field. When
initialSessions changes (e.g., project switch via sidebar), the dispatch
passes the current initialAttentionLevels via ref so the favicon and
dashboard title reflect the new project immediately rather than showing
stale attention data until the first SSE snapshot.
2026-04-06 22:46:29 -07:00
..
__tests__ feat: event-driven live tab titles and favicons via SSE (#848) 2026-04-06 22:46:29 -07:00
ActivityDot.tsx fix: correct mismatched status colors after light/dark token swap 2026-03-29 00:42:34 +05:30
AttentionZone.tsx Reset mobile view-all state and surface send errors 2026-03-26 23:37:51 +05:30
BottomSheet.tsx Polish mobile dashboard UX and harden PWA behavior 2026-03-25 13:57:40 +05:30
CIBadge.tsx feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
ConnectionBar.tsx Polish mobile dashboard UX and harden PWA behavior 2026-03-25 13:57:40 +05:30
Dashboard.tsx feat: event-driven live tab titles and favicons via SSE (#848) 2026-04-06 22:46:29 -07:00
DirectTerminal.tsx Address terminal theme review comments 2026-04-01 19:43:35 +05:30
DynamicFavicon.tsx feat: event-driven live tab titles and favicons via SSE (#848) 2026-04-06 22:46:29 -07:00
MobileBottomNav.tsx Polish mobile dashboard UX and harden PWA behavior 2026-03-25 13:57:40 +05:30
PRStatus.tsx Align web UI to design system 2026-03-29 09:23:17 +05:30
ProjectSidebar.tsx fix(web): fix mobile sidebar specificity and toggle close behavior 2026-03-24 08:04:47 +05:30
PullRequestsPage.tsx feat: event-driven live tab titles and favicons via SSE (#848) 2026-04-06 22:46:29 -07:00
ServiceWorkerRegistrar.tsx Polish mobile dashboard UX and harden PWA behavior 2026-03-25 13:57:40 +05:30
SessionCard.tsx feat: add CI failure detail notifications in lifecycle manager (#850) 2026-04-02 11:23:08 +05:30
SessionDetail.tsx feat: add CI failure detail notifications in lifecycle manager (#850) 2026-04-02 11:23:08 +05:30
Skeleton.tsx chore(web): remove unused Skeleton exports 2026-03-21 15:59:17 +05:30
Terminal.tsx Align web UI to design system 2026-03-29 09:23:17 +05:30
ThemeToggle.tsx Fix mobile dashboard navigation and connection state handling 2026-03-25 11:41:36 +05:30
Toast.tsx fix(web): clean up toast timer on unmount and add focus trap to BottomSheet 2026-03-24 23:01:38 +05:30