fix(socials): the bar disappeared from the preview when the plate was off

My own regression from the previous commit: the plate Border WRAPPED the bar's content and its
Visibility was bound to BarBackgroundEnabled — so with the plate off (the default) the preview
collapsed the entire social bar. Nothing was wrong with the data; the element was there and
invisible.

Fix: the wrapper is always laid out. "Plate off" now means a TRANSPARENT background
(`SocialBarBackgroundBrush` returns Transparent when disabled) and zero padding, "on" means the
colour/opacity plate with 18,6 padding — which also matches what the renderer bakes for the
output, so preview and broadcast agree.

Guard (new fact in SocialBarAppearanceTests): the preview must never visibility-gate the bar on
BarBackgroundEnabled, the wrapper must bind SocialBarBackgroundBrush, and the plate's switching
must be Padding.
This commit is contained in:
2026-10-30 09:06:53 -07:00
parent c1212644b0
commit 51d9dd09c7
3 changed files with 31 additions and 6 deletions
+14
View File
@@ -65,6 +65,20 @@ public class SocialBarAppearanceTests
Assert.Null(failure);
}
[Fact]
public void The_preview_bar_is_never_hidden_by_the_plate_switch()
{
// Regression, 2026-10-30: the plate Border wrapped the whole bar and its Visibility was
// bound to BarBackgroundEnabled, so turning the plate off (the default) removed the bar
// from the preview entirely. "Plate off" must mean a transparent plate.
var preview = SourceAssert.Text("Controls", "PreviewPane.xaml");
Assert.DoesNotContain("Socials.BarBackgroundEnabled, Converter={StaticResource BoolToVis}", preview);
Assert.Contains("{Binding SocialBarBackgroundBrush}", preview);
// The plate's PADDING is what switches with the toggle, not the element's presence.
Assert.Contains("<Setter Property=\"Padding\" Value=\"18,6\"/>", preview);
}
private static VideoFrame? Render(SocialBarStyle style) => SocialBarRenderer.Render(Entries, style);
private static int Count(VideoFrame frame, Func<int, int, int, int, bool> predicate)