From ea1017776d2522b0655bcca72dfbe5a642d0b898 Mon Sep 17 00:00:00 2001 From: gramps Date: Fri, 30 Oct 2026 14:54:52 -0700 Subject: [PATCH] feat(scoreboard): the properties are inert until the creator is signed in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scoreboard is fed by the signed-in channel (chat events + channel stats), so offering its switches to a signed-out user is a dead control. The whole block now binds IsEnabled to IsConnected and shows one line — "Sign in to YouTube to use the scoreboard." — instead of looking broken. Nothing extra is needed to re-enable: IsConnected already raises on sign-in/out, so the block comes alive the moment the session lands. Guard: ScoreboardPropertiesTests asserts the IsEnabled binding, the signed-out hint and that the hint is gated by the inverse converter. --- Controls/LeftPanel.xaml | 9 ++++++++- ytLive.Tests/ScoreboardPropertiesTests.cs | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Controls/LeftPanel.xaml b/Controls/LeftPanel.xaml index a625fcd..021b574 100644 --- a/Controls/LeftPanel.xaml +++ b/Controls/LeftPanel.xaml @@ -452,7 +452,14 @@ - + + + diff --git a/ytLive.Tests/ScoreboardPropertiesTests.cs b/ytLive.Tests/ScoreboardPropertiesTests.cs index 69fa007..84913e6 100644 --- a/ytLive.Tests/ScoreboardPropertiesTests.cs +++ b/ytLive.Tests/ScoreboardPropertiesTests.cs @@ -17,6 +17,14 @@ public class ScoreboardPropertiesTests // Gated on the selected layer being a scoreboard. Assert.Contains("SelectedElement.IsScoreboard", panel); + // Signed out: the whole block is inert (the board is fed by the signed-in channel), with a + // one-line explanation. Signing in re-enables it through the ordinary IsConnected raise. + var block = panel[panel.IndexOf("Scoreboard config", System.StringComparison.Ordinal)..]; + block = block[..block.IndexOf("", System.StringComparison.Ordinal)]; + Assert.Contains("IsEnabled=\"{Binding IsConnected}\"", block); + Assert.Contains("Sign in to YouTube to use the scoreboard.", block); + Assert.Contains("InverseBoolToVis", block); + // The master switch sits in the same panel: off hides the strip and stops the polling. Assert.Contains("ScoreboardEnabled", panel); @@ -39,8 +47,6 @@ public class ScoreboardPropertiesTests // Theme widgets only: the colour pickers are the app's drop-down (YtComboBox), never a // hand-built menu, and the toggles are YtCheckBox. - var block = panel[panel.IndexOf("Scoreboard config", System.StringComparison.Ordinal)..]; - block = block[..block.IndexOf("", System.StringComparison.Ordinal)]; Assert.Contains("Style=\"{StaticResource YtComboBox}\"", block); Assert.Contains("Style=\"{StaticResource YtCheckBox}\"", block); Assert.DoesNotContain("ContextMenu", block);