TASK 4 ship step 6: health stats land in the bottom bar — FramePump.HealthUpdated is now wired to the VM (OnFramePumpHealthUpdated marshals onto the UI thread — the encoder's stderr loop raises on a background thread — and copies the parsed bitrate/FPS/dropped/duration into CurrentHealth, the bottom bar's existing binding); ResetHealth zeroes dropped frames + elapsed duration on go-live and on End so stats never linger from a previous session (bitrate/FPS stay on the tier's targets); the bar shows real encoder values once TASK 5 fills _rtmpUrlProvider (until then the pump skips the encoder) — 169 tests passing, 0 warnings

This commit is contained in:
2026-08-13 15:56:29 -07:00
parent dc29adf9bb
commit 8292663791
5 changed files with 77 additions and 35 deletions
+27 -30
View File
@@ -7,36 +7,32 @@
## Session state (last updated: 2026-08-13)
- **Branch:** `main`. The audio UX follow-up (`9f9ed34`) and round 2 (`18abe42`)
are **committed and pushed**.
- **This session (round 3 — mic mute icon + REC sign):**
1. **Mic mute icon:** the mic bar gained a **microphone glyph** (same 16px style
as the speaker, white → red + slash when muted, `ToolTip=MicMuteText`)
**between the meter and the speaker** — both mutes adjacent with spacing
between the icons; click reuses the same `MicSpeaker_MouseLeftButtonUp`
handler → `ToggleMicMuteCommand`. No VM/code-behind change.
2. **REC sign (top center):** the old LIVE badge (hidden when offline) became an
**always-visible REC chip** — dark gray dot (#555) + dim "REC" (#888) offline,
**bright red (#e94560)** + "REC" + elapsed while live, **darker red (#8f1f1f)**
when live with a **private** stream. Driven by new VM props
`RecDotBrush`/`RecTextBrush`/`RecDotOpacity`/`IsLivePrivate` (notified from the
`StreamStatus` and `StreamVisibility` setters), privacy read off the **dialog's
chosen visibility** (`StreamVisibility == "Private"`) — the stream service still
hardcodes `privacyStatus = "public"`, so the private-REC state only lights once
that's honored (TASK 4 ship step 7). The dot pulses while live; `LiveIndicatorVisible`
and `LivePulseOpacity` were removed.
3. **Voice filters queued as task 22** — bass boost, treble, noise suppression,
compressor on the mic input channel, KISS, always on (before the meter/encoder mix).
- **Branch:** `main`. The audio UX follow-up (`9f9ed34`), round 2 (`18abe42`),
and round 3 (`dc29adf`) are **committed and pushed**.
- **This session (TASK 4 ship step 6 — health stats in the bottom bar):**
1. **Wiring:** `MainViewModel.OnFramePumpHealthUpdated` subscribes to
`FramePump.HealthUpdated` and marshals onto the UI thread (the encoder's
stderr loop raises on a background thread — same pattern as the audio
level handlers), copying the parsed bitrate/FPS/dropped/duration into
`CurrentHealth`, which the bottom bar's left stats group already binds
(bitrate/FPS/dropped/duration/health-message).
2. **Session hygiene:** `ResetHealth(status)` zeroes dropped frames + the
elapsed duration (and clears `LastError`) on go-live and on End so stats
never linger from a previous stream; bitrate/FPS stay on the tier's
targets from `ApplyStreamQuality`.
3. **Reality:** the bar lights up with REAL encoder values once TASK 5 fills
`_rtmpUrlProvider` with the reusable stream's ingest URL — until then the
pump skips the encoder (logged) and the bar shows the tier's targets.
No new tests needed: `FramePumpTests.HealthUpdated_ForwardsEncoderHealth`
already covers the pump→event seam; the VM handler is a thin marshal+copy.
- **Mic status contract (creator's rule, verified — do NOT "fix"):** the status dot is
**red until a mic resource is actually connected**. `MicStatus` starts `NotConnected`
(red); it goes green ONLY when the mixer's `MicConnected` fires, which comes strictly
from the mic source's `Started` event raised after `StartRecording()` succeeds. Zero
devices at startup → stays red and the mixer is never started; capture failure → yellow.
Green must never be raised earlier (e.g. on loopback start or on `Start()` being called).
- **Uncommitted:** this round-3 work`ViewModels/MainViewModel.cs` (REC props,
`_recDotPulse`, StreamVisibility/StreamStatus notifications, `LiveIndicatorVisible`/
`LivePulseOpacity` removed), `MainWindow.xaml` (REC chip + mic mute icon),
`TASKS.md` (task 22 + round-3 audio note), `ai.md`, `ViewModels/index.md`, `HANDOFF`.
- **Uncommitted:** this session`ViewModels/MainViewModel.cs` (health wiring +
`ResetHealth`), `TASKS.md` (ship step 6 ✅), `ai.md`, `ViewModels/index.md`, `HANDOFF`.
- **Verified:** pending (build + full test run right before commit).
- **Landmines:**
- Never set a local `Canvas.SetTop` on the social bar — a local value permanently
@@ -64,12 +60,13 @@
integration test (a real `MainWindow`), which never goes live — keep it that way.
- Sandbox can't reach outbound HTTPS — `HttpSocialValidator` stub-handler tests
only, never the real instance.
- **Next step:** commit + push round 3 (one commit). Then TASK 4 ship step 6 — health
stats: bind `FramePump.HealthUpdated` (bitrate/FPS/duration) into the bottom bar.
Also queued: task 21 (logo + About hub), task 22 (voice filters). Nothing else
queued — do not expand the task queue on your own. Optional, not queued:
rewriting the healed entry's `ProfileUrl` to
`https://mastodon.llamachile.tube/@gramps` (user must say the word).
- **Next step:** commit + push this ship-step-6 work (one commit). Then the remaining
TASK 4 requirement is **ship step 7 — one-click go live + private-only enforcement**
(honor the dialog's chosen visibility / enforce `privacyStatus = "private"`; also
fixes the REC sign's private state — see round-3 note above). Also queued: task 21
(logo + About hub), task 22 (voice filters). Nothing else queued — do not expand
the task queue on your own. Optional, not queued: rewriting the healed entry's
`ProfileUrl` to `https://mastodon.llamachile.tube/@gramps` (user must say the word).
- **Secret/DB/port facts live:** OAuth client id/secret in `Helpers/OAuthCredentials.cs`;
OAuth session token in `Helpers/TokenStore.cs` (DPAPI → `%APPDATA%\ytLlive\ytLlive.auth`);