feat(audio dock): the shell — 168px, auto-collapsing, replacing the empty bottom bar
Unit 4 of the sound-bar refactor. `Controls/AudioDock` takes the bottom row that held the empty `BottomBar` spacer (deleted): four bay containers (MIC / GAME / TRAX / LIP-SYNC) above a 36px master strip, all token-styled. Height comes from `Models/AudioDockLayout`, not from a setting: 168px normally, 36px below a 900px window height. At the 1366×768 minimum a full dock leaves ~398px for the preview, so the collapse is mandatory, not cosmetic. The dock listens to its window's SizeChanged and re-applies. Nothing here pretends to be a meter yet — the bays and the master readouts fill in over the next units, each with its own test. Guard: AudioDockLayoutTests pins both sides of the threshold (768 collapsed, 1040 expanded), the boundary itself, and the two heights as the design's numbers.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using Xunit;
|
||||
using ytLive.Models;
|
||||
|
||||
namespace ytLive.Tests;
|
||||
|
||||
/// <summary>The dock's height is the whole reason it is allowed to take 168px: on a short window it
|
||||
/// must get out of the way instead of squeezing the preview. The threshold is the creator's
|
||||
/// minimum (768) and default (1040) — both sides are pinned here so a future "tidy" cannot leave a
|
||||
/// 768px window with a full dock.
|
||||
/// </summary>
|
||||
public class AudioDockLayoutTests
|
||||
{
|
||||
[Fact]
|
||||
public void The_dock_collapses_on_short_windows_and_expands_on_normal_ones()
|
||||
{
|
||||
// Minimum window: collapsed, so the preview keeps its room.
|
||||
Assert.True(AudioDockLayout.IsCollapsed(768));
|
||||
Assert.Equal(AudioDockLayout.CollapsedHeight, AudioDockLayout.HeightFor(768));
|
||||
|
||||
// Default window: the full dock.
|
||||
Assert.False(AudioDockLayout.IsCollapsed(1040));
|
||||
Assert.Equal(AudioDockLayout.ExpandedHeight, AudioDockLayout.HeightFor(1040));
|
||||
|
||||
// The boundary itself belongs to the expanded side (>= is the friendlier read).
|
||||
Assert.False(AudioDockLayout.IsCollapsed(AudioDockLayout.CollapseBelowHeight));
|
||||
Assert.True(AudioDockLayout.IsCollapsed(AudioDockLayout.CollapseBelowHeight - 1));
|
||||
|
||||
// The two heights are the design's numbers, not whatever looked fine.
|
||||
Assert.Equal(168, AudioDockLayout.ExpandedHeight);
|
||||
Assert.Equal(36, AudioDockLayout.CollapsedHeight);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user