Skip to content

feat: live stats/uptime card in Settings + LIVE pill (#18) - #30

Merged
joeblau merged 1 commit into
mainfrom
feat/18-live-stats-card
Jul 4, 2026
Merged

feat: live stats/uptime card in Settings + LIVE pill (#18)#30
joeblau merged 1 commit into
mainfrom
feat/18-live-stats-card

Conversation

@joeblau

@joeblau joeblau commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Surfaces the live broadcast telemetry that was computed internally but never exposed past isLive/errorMessage.

What's new

  • LiveStats (StreamCore, unit-tested): telemetry value type with an uplink-health classification (Good/Fair/Congested) + compact bitrate/queue/uptime formatting.
  • statsSnapshot() on the Publisher protocol + both actors, built from the ABR's healthSnapshot() and a new currentFrameRate() (effective fps after congestion/thermal caps). Returns nil while not publishing so the HUD clears to during connect/reconnect.
  • ScreenCaptureController: @Observable liveStats + broadcastStartedAt, fed by a ~1s poll started on go-live and torn down on every path (all funnel through stopCapture).
  • Settings: a live stats/uptime card atop the launcher while broadcasting — uptime · bitrate (target) · effective fps · uplink health · thermal notice. Fixed per-tick height so the content-sized drawer never springs; per-metric VoiceOver labels.
  • ContentView: a persistent, non-interactive LIVE pill + elapsed timer.

fps/bitrate are the encoder's applied ABR targets, not measured throughput — measured fps/dropped-frame telemetry depends on M8 (not yet built).

Process

Built with an understand/design multi-agent workflow, then an adversarial review workflow that caught a reconnect-staleness bug (the HUD froze on last-good values while the stream was down) — fixed here by writing the reconnect nil through.

Verification

  • StreamCore: 69 tests pass (incl. new LiveStats health + formatting suites)
  • Full app target builds against the iOS 27 SDK

fixes #18

🤖 Generated with Claude Code

The broadcast computed BroadcastNetworkHealth (queue, zero-output, target
bitrate) and the ABR's effective fps/bitrate internally but never surfaced
them — the controller exposed only isLive/errorMessage/thermalNotice.

Plumb the telemetry through the @observable controller and display it:

- StreamCore: new pure LiveStats value type (bitRate, frameRate,
  queueBytes, zeroOutputSeconds) with an uplink-health classification
  (Good/Fair/Congested) and compact bitrate/queue/uptime formatting.
  Unit-tested (health boundaries + formatting).
- Publishers: statsSnapshot() on the Publisher protocol, implemented by
  RTMPPublisher + SessionPublisher from the ABR's healthSnapshot() + a new
  currentFrameRate() (effective fps folding in the congestion + thermal
  caps). Returns nil unless actively publishing, so the HUD clears to "—"
  during connect/reconnect instead of freezing on stale telemetry.
- ScreenCaptureController: @observable liveStats + broadcastStartedAt, fed
  by a ~1s poll that starts on go-live and tears down on every path (all
  funnel through stopCapture). Writes snapshots through — including the
  reconnect nil — with an equality guard and a post-await cancel check.
- Settings: a live stats/uptime card atop the launcher while broadcasting
  (fixed per-tick height so the content-sized drawer never springs),
  showing uptime, bitrate (target), effective fps, uplink health, and the
  thermal notice; per-metric VoiceOver labels.
- ContentView: a persistent, non-interactive LIVE pill + elapsed timer
  overlay while live.

fps/bitrate are the encoder's applied ABR targets, not measured throughput
— measured fps/dropped-frame telemetry depends on M8 (not yet built).

Built via an understand/design + adversarial-review multi-agent workflow;
the review caught and this fixes a reconnect-staleness bug where the HUD
would freeze on last-good values while the stream was actually down.
StreamCore: 69 tests pass. Full app builds against the iOS 27 SDK.

fixes #18

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joeblau
joeblau merged commit ecf570e into main Jul 4, 2026
1 check passed
@joeblau
joeblau deleted the feat/18-live-stats-card branch July 4, 2026 21:12
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.

M3 · Live stats HUD + LIVE/uptime pill

1 participant