From 8caee21b9a6e66cb9e71fbfb50c5a4742863b814 Mon Sep 17 00:00:00 2001 From: gramps Date: Fri, 30 Oct 2026 15:05:33 -0700 Subject: [PATCH] fix(scoreboard): the strip finally reaches the preview, and dev labels are orange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Clicking on everything produces no visible effect" — the cause was upstream of the controls, and it is the same defect as the invisible alert box (TASK 47): - `Source.DisplaySource` returned `VideoImageSource` only for ChatBox / WebSource / MediaSource / AlertBox. The scoreboard's frame was rendered and published, then never displayed. - the preview's Image has a per-type Visibility trigger for each of those and none for IsScoreboard, so even a correct DisplaySource would have stayed collapsed. Both are fixed, and the layer test now pins the frame-source list AND the trigger so the pair cannot drift apart again. Dev-only affordances are ORANGE from now on (creator ruling): "Simulate (dev)" is a TextBlock in Brush.Attention, so a development control can never be mistaken for product. The panel test pins the colour. --- Controls/LeftPanel.xaml | 8 ++++++-- Controls/PreviewPane.xaml | 5 +++++ Models/Source.cs | 9 ++++++++- ytLive.Tests/ScoreboardLayerTests.cs | 6 ++++++ ytLive.Tests/ScoreboardPropertiesTests.cs | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Controls/LeftPanel.xaml b/Controls/LeftPanel.xaml index 6e5c1d3..3de42fd 100644 --- a/Controls/LeftPanel.xaml +++ b/Controls/LeftPanel.xaml @@ -463,9 +463,13 @@ + Visibility="{Binding IsDevelopmentBuild, Converter={StaticResource BoolToVis}}"> + + + diff --git a/Controls/PreviewPane.xaml b/Controls/PreviewPane.xaml index 5399101..60a1e7e 100644 --- a/Controls/PreviewPane.xaml +++ b/Controls/PreviewPane.xaml @@ -138,6 +138,11 @@ + + + + diff --git a/Models/Source.cs b/Models/Source.cs index 74940fa..0f717e1 100644 --- a/Models/Source.cs +++ b/Models/Source.cs @@ -143,9 +143,16 @@ public class Source : SceneElement public ImageSource? ImageSource => _imageSource; + /// Types whose frame is produced at runtime rather than stored as an asset. The + /// scoreboard joined this list 2026-10-30 — without it the strip was rendered, published to + /// VideoImageSource, and never displayed (the same shape as the invisible-alert defect). + private bool IsFrameSource => + Type is SourceType.ChatBox or SourceType.WebSource or SourceType.MediaSource + or SourceType.AlertBox or SourceType.Scoreboard; + public override ImageSource? DisplaySource => IsLiveCapture ? (VideoImageSource ?? _imageSource) - : (Type is SourceType.ChatBox or SourceType.WebSource or SourceType.MediaSource or SourceType.AlertBox ? VideoImageSource : _imageSource); + : (IsFrameSource ? VideoImageSource : _imageSource); public override bool IsImageSource => Type == SourceType.Image; diff --git a/ytLive.Tests/ScoreboardLayerTests.cs b/ytLive.Tests/ScoreboardLayerTests.cs index 7c2cfd3..b575caf 100644 --- a/ytLive.Tests/ScoreboardLayerTests.cs +++ b/ytLive.Tests/ScoreboardLayerTests.cs @@ -25,6 +25,12 @@ public class ScoreboardLayerTests var resolver = SourceAssert.Text("ViewModels", "MainViewModel.cs"); Assert.Contains("Source { Type: SourceType.Scoreboard } => _scoreboardPresenter?.Frame", resolver); + // The PREVIEW must show the strip: its frame is a runtime frame-source and its Image needs + // the visibility trigger. Missing either made every property change look inert (2026-10-30). + var source = SourceAssert.Text("Models", "Source.cs"); + Assert.Contains("or SourceType.AlertBox or SourceType.Scoreboard", source); + Assert.Contains("IsScoreboard", SourceAssert.Text("Controls", "PreviewPane.xaml")); + // Session lifecycle: every start clears the tallies. var ops = SourceAssert.Text("ViewModels", "MainViewModel.Streaming.Operations.cs"); Assert.Contains("StartScoreboardSession();", ops); diff --git a/ytLive.Tests/ScoreboardPropertiesTests.cs b/ytLive.Tests/ScoreboardPropertiesTests.cs index c157a2e..07d124f 100644 --- a/ytLive.Tests/ScoreboardPropertiesTests.cs +++ b/ytLive.Tests/ScoreboardPropertiesTests.cs @@ -25,6 +25,10 @@ public class ScoreboardPropertiesTests Assert.Contains("Sign in to YouTube to use the scoreboard.", block); Assert.Contains("CanUseScoreboard, Converter={StaticResource InverseBoolToVis}", block); + // Dev-only labels are ORANGE, so a development affordance cannot pass for product. + Assert.Contains("Simulate (dev)", block); + Assert.Contains("Brush.Attention", block); + // The master switch sits in the same panel: off hides the strip and stops the polling. Assert.Contains("ScoreboardEnabled", panel);