agent-orchestrator/packages
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
..
ao chore: version packages 2026-03-29 09:21:26 +00:00
cli fix: resolve prompt delivery persistence and false warnings 2026-04-06 22:46:29 -07:00
core fix: resolve prompt delivery persistence and false warnings 2026-04-06 22:46:29 -07:00
integration-tests extend opencode discovery timeout, include integration tests in pnpm test 2026-03-29 16:44:53 +05:30
plugins feat: standardize agent plugins — shared hooks, activity JSONL, backfill aider/opencode (#755) 2026-04-01 21:50:07 +05:30
web feat: event-driven live tab titles and favicons via SSE (#848) 2026-04-06 22:46:29 -07:00