fix(ui): REC / ON-AIR labels are white in every state

RecordPillToggle never set a base Foreground, and its label inherits the toggle's — so unchecked
inherited the Control default (black) on the dark bar, while checked was white on red. The style
now sets on-accent once; the checked trigger only changes the fill.

That is the consistency rule for session controls: white ink always, the fill carries the state
(neutral off, red live). EDIT follows the same rule. UiShellTests asserts the base foreground, so
the missing setter cannot come back silently.
This commit is contained in:
2026-10-30 10:46:51 -07:00
parent feef763035
commit cb4f8ec758
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -757,6 +757,10 @@
<!-- SegmentToggle's template hard-codes a Transparent face and paints the checked state
itself, so an armed pill needs its own template that honours Background. -->
<Setter Property="Background" Value="Transparent"/>
<!-- The label inherits this: without it the bare Control default (black) paints on the
dark bar and the pill looks empty. Session controls carry WHITE ink in every state;
the fill is what changes. -->
<Setter Property="Foreground" Value="{StaticResource Brush.OnAccent}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
@@ -770,7 +774,6 @@
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{StaticResource Brush.Primary}"/>
<Setter Property="Foreground" Value="{StaticResource Brush.OnAccent}"/>
</Trigger>
</Style.Triggers>
</Style>
+5
View File
@@ -43,6 +43,11 @@ public class UiShellTests
// 5. Armed session controls are red, and the running stop button is red — not a grey literal.
Assert.Contains("x:Key=\"RecordPillToggle\"", theme);
// One rule for session controls: white ink in every state, the fill carries the state.
// The missing base foreground is what painted the REC/ON-AIR labels black (2026-10-30).
var pill = theme[theme.IndexOf("x:Key=\"RecordPillToggle\"", System.StringComparison.Ordinal)..];
pill = pill[..pill.IndexOf("</Style>", System.StringComparison.Ordinal)];
Assert.Contains("<Setter Property=\"Foreground\" Value=\"{StaticResource Brush.OnAccent}\"/>", pill);
Assert.Contains("Brush.Primary", theme);
Assert.Contains("Style=\"{StaticResource RecordPillToggle}\"", topBar);
Assert.Contains("Background=\"{StaticResource Brush.Primary}\" Margin=\"14,0,0,0\"", topBar);