Skip to content

fix(web): render SSE connection-status indicator (TASK-2027)#880

Merged
xarmian merged 2 commits into
mainfrom
fix/task-2027-sse-indicator
Jul 9, 2026
Merged

fix(web): render SSE connection-status indicator (TASK-2027)#880
xarmian merged 2 commits into
mainfrom
fix/task-2027-sse-indicator

Conversation

@xarmian

@xarmian xarmian commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

What

From the PLAN-1984 Web-UX audit: the SSE connection status was already computed in sseService but never rendered, so a stale board gave no hint the realtime stream was down or unauthorized.

This renders a small, unobtrusive live/reconnecting/offline indicator on the collection board view, wired off the existing sseService.status state (no new polling / no new connection layer).

Changes

  • New web/src/lib/components/SSEStatusIndicator.svelte — dot + label badge reading sseService.status. Reuses the visual idiom of the item page's collab-state badge:
    • connected → subtle "Live" (muted label, quiet green dot)
    • reconnecting → yellow "Reconnecting…" (pulsing dot; respects prefers-reduced-motion)
    • disconnected → red "Offline"
    • unauthorized → red "Disconnected" (session lost workspace access)
  • [collection]/+page.svelte — renders the indicator in the header title-row (wrapped h1 + indicator in a .title-group so space-between layout stays clean).
  • sse.svelte.ts — added a one-shot status_request BroadcastChannel handshake so a follower tab that opens after the leader already connected initializes its status correctly (BroadcastChannel doesn't replay the leader's earlier status message; without this a peer tab receiving live updates would wrongly show "Offline"). Found in Codex review.

Test plan

  • cd web && npm run check — 0 errors on touched files.
  • cd web && npm run build — succeeds.
  • Codex review: CLEAN.
  • Manual: open a collection board; indicator shows "Live". Kill the server → "Reconnecting…" then "Offline". Open a second tab while connected → follower initializes to "Live" via the handshake.

Refs TASK-2027, PLAN-1984.

@xarmian xarmian merged commit bcf5e65 into main Jul 9, 2026
3 of 4 checks passed
@xarmian xarmian deleted the fix/task-2027-sse-indicator branch July 9, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant