hyperhive/frontend/packages
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iris 1819bee43c dashboard: subscribe to /dashboard/stream for live updates (#406 step 3)
Pre-step-2, the SSE subscription on /index.html was conditionally
created by the broker-terminal IIFE that only ran on /flow.html
(via the `if (!flow || !window.HiveTerminal) return;` guard) — so
the dashboard only updated on cold load + after async-form submits.
The split in step 2 made the gap more obvious; close it.

Bare `EventSource` (the dashboard doesn't render broker rows, so
none of the HiveTerminal infrastructure is wanted here). Each
event's `kind` looks up against a `MUTATION_HANDLERS` table that
fans out to the existing `applyXxx` handlers. Unknown kinds (broker
`sent` / `delivered`, anything the backend adds later) silently
no-op. On (re)connect we kick `refreshState()` to recover events
lost during the disconnect window — same pattern as flow.js's
`onStreamOpen`. EventSource handles auto-reconnect.

#408 will give /index.html its own stream that omits broker
traffic; for now both pages subscribe to `/dashboard/stream` and
filter client-side.

Closes the #406 architectural roadmap:
- step 1 (#410): common.js extraction ✓
- step 2 (#412): split into app.js + flow.js entry points ✓
- step 3 (this PR): /index.html re-acquires its SSE subscription
2026-05-25 20:55:53 +02:00
..
agent agent: cap icon at 5em, fix overflow menu hidden-state (#411) 2026-05-25 02:19:47 +02:00
dashboard dashboard: subscribe to /dashboard/stream for live updates (#406 step 3) 2026-05-25 20:55:53 +02:00
shared terminal: snap to bottom after post-row mutations (#393) 2026-05-25 00:47:31 +02:00