From bb5dcb4ba2e70e574053e43371a560f2e744a08b Mon Sep 17 00:00:00 2001 From: gramps Date: Tue, 22 Sep 2026 09:31:00 -0700 Subject: [PATCH] =?UTF-8?q?feat(stream):=20TASK=2041=20Test=20Stream=20mod?= =?UTF-8?q?e=20=E2=80=94=20private=20test=20broadcast=20+=20TEST=20drawer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test button next to Start runs the real private-only go-live pipeline as a session variant (IsTestStream): BeginTestStream -> extracted StartStreamingSession(alsoRecord:false) shared with the dialog path — no Go Live dialog, no 'last live' stamp, no recording. Gold top bar + TEST badge + 'End Test' button face; TEST drawer (third right-rail pull-out, three-way exclusivity) auto-opens once the liveChatId resolves. Chat tooling: Mock Chat Input sends a REAL liveChat/messages.insert (YouTubeStreamService.InsertChatMessageAsync) that round-trips the real ~2s poll and renders through the live overlay; simulated Subscriber/New Member/Super Chat events inject through the poller's MessageReceived seam (YouTubeChatService.InjectSimulatedMessage, ChatMessage.IsSimulated) — the insert API only creates textMessageEvent, so non-text events are local-only by design (ref: developers.google.com/youtube/v3/live/docs/liveChatMessages/insert). Scopes youtube + youtube.force-ssl already cover insert; no re-consent. Good Dog: ytLive.Tests/TestStreamTests.cs — coordinator protocol with fake HTTP + real-window drawer exclusivity/gate. 0 warnings; 314/314 pass (clean run; intermittent host abort is the pre-existing WinRT-webcam flake). Docs ride in the same change: TASKS.md row 41, TASKS/task-41-test-stream-mode.md, ai.md (YouTube Live API constraints), HANDOFF rewrite. --- Controls/PreviewPane.xaml | 112 +++++++++ Controls/TopBar.xaml | 13 + HANDOFF.md | 105 ++++---- Models/YouTube.cs | 5 + Services/TestSessionViewModel.cs | 232 ++++++++++++++++++ Services/YouTubeChatService.cs | 8 + Services/YouTubeStreamService.cs | 33 +++ TASKS.md | 8 + TASKS/task-41-test-stream-mode.md | 82 +++++++ ViewModels/MainViewModel.Account.cs | 1 + .../MainViewModel.Streaming.Operations.cs | 103 +++++--- ViewModels/MainViewModel.Streaming.cs | 41 +++- ViewModels/MainViewModel.Ypp.cs | 28 ++- ViewModels/MainViewModel.cs | 1 + ai.md | 17 ++ ytLive.Tests/TestStreamTests.cs | 189 ++++++++++++++ 16 files changed, 893 insertions(+), 85 deletions(-) create mode 100644 Services/TestSessionViewModel.cs create mode 100644 TASKS/task-41-test-stream-mode.md create mode 100644 ytLive.Tests/TestStreamTests.cs diff --git a/Controls/PreviewPane.xaml b/Controls/PreviewPane.xaml index 29a4d0f..6fc2881 100644 --- a/Controls/PreviewPane.xaml +++ b/Controls/PreviewPane.xaml @@ -648,6 +648,104 @@ + + + + + + + + + + + + + + + + + + + + + + + +