feat(socials): bar appearance — text colour, background plate, opacity, text shadow

In the Socials drawer, under the show/hide switch: text colour, an optional background plate
with its own colour and opacity, and a text drop shadow. The bar had been hard-wired
white-on-transparent since it shipped.

- `SocialsConfig` gains five additive properties (BarTextColor, BarBackgroundEnabled,
  BarBackgroundColor, BarBackgroundOpacity, BarTextShadow).
- Persistence: five new Socials columns, added by the per-column idempotent migration pattern
  (a half-migrated DB heals instead of failing), written in Save and read back in Load with
  defaults for pre-existing rows.
- `SocialBarRenderer.Render(entries, SocialBarStyle?)` — the look is a separate value type so the
  renderer stays a pure "entries + look" function and the preview can never read a half-applied
  config mid-edit. A malformed hex falls back to white/black instead of throwing inside a render
  tick.
- The plate hugs the entries (rounded 20px, padding) so it reads as a caption bar, not a band
  across the frame. Off by default, because transparent is what creators have today.
- The colour pickers reuse `BorderColorPalette` — one catalogue of the app's colours, per the
  TASK 60/63 rule.

Guard: SocialBarAppearanceTests paints the real strip and inspects pixels — default is white with
no plate, a red text colour reaches the glyphs, a 55% blue plate yields half-transparent blue
pixels, and the shadow adds dark pixels that were not there before.
This commit is contained in:
2026-10-30 08:47:50 -07:00
parent 9528128ca7
commit c82636e1a9
9 changed files with 329 additions and 16 deletions
+43 -4
View File
@@ -20,10 +20,49 @@
<TextBlock Grid.Row="0" Text="Social Media Site Promotion" FontSize="18" FontWeight="Bold"
Foreground="{StaticResource Brush.OnSurface}" Margin="0,0,0,12"/>
<!-- Show/hide the bar on the stream -->
<CheckBox Grid.Row="1" IsChecked="{Binding BarEnabled}" Style="{StaticResource YtCheckBox}" Margin="0,0,0,10">
<TextBlock Text="Show the social bar on the stream" Foreground="{StaticResource Brush.OnSurface}" FontSize="13"/>
</CheckBox>
<!-- Show/hide the bar on the stream + how it is painted -->
<StackPanel Grid.Row="1" Margin="0,0,0,10">
<CheckBox IsChecked="{Binding BarEnabled}" Style="{StaticResource YtCheckBox}">
<TextBlock Text="Show the social bar on the stream" Foreground="{StaticResource Brush.OnSurface}" FontSize="13"/>
</CheckBox>
<StackPanel Margin="18,6,0,0" IsEnabled="{Binding BarEnabled}">
<DockPanel Margin="0,2,0,0">
<TextBlock DockPanel.Dock="Left" Text="Text colour" VerticalAlignment="Center"
Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Width="96"/>
<ComboBox Style="{StaticResource YtComboBox}" Height="24" FontSize="11"
ItemsSource="{Binding ColorOptions}" DisplayMemberPath="Name"
SelectedValuePath="Hex" SelectedValue="{Binding BarTextColor, Mode=TwoWay}"/>
</DockPanel>
<CheckBox IsChecked="{Binding BarBackgroundEnabled}" Style="{StaticResource YtCheckBox}" Margin="0,8,0,0">
<TextBlock Text="Background plate" Foreground="{StaticResource Brush.OnSurface}" FontSize="12"/>
</CheckBox>
<StackPanel Margin="18,4,0,0" IsEnabled="{Binding BarBackgroundEnabled}">
<DockPanel>
<TextBlock DockPanel.Dock="Left" Text="Plate colour" VerticalAlignment="Center"
Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Width="96"/>
<ComboBox Style="{StaticResource YtComboBox}" Height="24" FontSize="11"
ItemsSource="{Binding ColorOptions}" DisplayMemberPath="Name"
SelectedValuePath="Hex" SelectedValue="{Binding BarBackgroundColor, Mode=TwoWay}"/>
</DockPanel>
<DockPanel Margin="0,6,0,0">
<TextBlock DockPanel.Dock="Left" Text="Opacity" VerticalAlignment="Center"
Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Width="96"/>
<TextBlock DockPanel.Dock="Right" VerticalAlignment="Center" Width="42" TextAlignment="Right"
Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11"
Text="{Binding BarBackgroundOpacity, StringFormat={}{0:P0}}"/>
<Slider Minimum="0" Maximum="1" SmallChange="0.05" LargeChange="0.1"
Value="{Binding BarBackgroundOpacity, Mode=TwoWay}" VerticalAlignment="Center"/>
</DockPanel>
</StackPanel>
<CheckBox IsChecked="{Binding BarTextShadow}" Style="{StaticResource YtCheckBox}" Margin="0,8,0,0">
<TextBlock Text="Text drop shadow" Foreground="{StaticResource Brush.OnSurface}" FontSize="12"/>
</CheckBox>
</StackPanel>
</StackPanel>
<!-- Sign-in gate: the first slot is always your YouTube channel -->
<Border Grid.Row="2" Background="{StaticResource Brush.SurfaceContainer}" CornerRadius="5" Padding="10,8" Margin="0,0,0,10"