feat(topbar): the output stage — Output [YouTube] [Local MP4] One output at a time

Unit B (creator ruling 2026-11-12). Pressing Record / Go Live now changes the bar: the REC/ON-AIR pill
pair becomes two labelled switches with glyphs (the YouTube mark, the record dot), under an "Output"
label and beside "One output at a time". Build world shows nothing but its own segment.

Two things this exposed that were not cosmetic:

- **Local MP4 was not actually the default.** Both pills started unarmed, so the stage opened with no
  output selected; the old screen got away with it because the primary button inferred "record" from
  "nothing armed". RecordPillOn now starts true, which is what "pos = ON (default)" means in code.
- **The stage gates the whole idle cluster, not just the switch.** Gating only the switch left the start
  button visible in the Build world — a Start with no output chosen. ShowOutputStage (output world, idle,
  not recording) wraps the cluster, so a running session hides the stage too: its output cannot change.

Exclusivity stays in the view model (arming one drops the other); the XAML merely reflects it.
TopBarWorldTests pins the stage's visibility and the radio pair starting at Local MP4.

680 pass, 0 warnings. Next: unit C (output-dependent primary action, End labels).
Scope justification: Assets/starting-background.jpg is outside this unit — the creator's replacement art,
still awaiting their visual check.
This commit is contained in:
2026-11-12 15:38:35 -08:00
parent 6c5cd2f66c
commit a5a10fb0b0
6 changed files with 84 additions and 12 deletions
+27 -9
View File
@@ -109,24 +109,42 @@
<!-- IDLE: the mode switch + the action(s) of the armed world. The three <!-- IDLE: the mode switch + the action(s) of the armed world. The three
controls share one height (build 77 feedback) so they read as one controls share one height (build 77 feedback) so they read as one
family — segments host, Start/Go Live, and Test all sit at 32. --> family — segments host, Start/Go Live, and Test all sit at 32. -->
<!-- THE OUTPUT STAGE (creator ruling 2026-11-12): which single output, and the one action
that starts it. Appears only in the Record / Go Live world and only while nothing is
running — a live session cannot change its output. YouTube and Local MP4 are one axis,
so the two switches are radio-exclusive in the view model, not by luck here. -->
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
Visibility="{Binding ShowIdleWorld, Converter={StaticResource BoolToVis}}"> Visibility="{Binding ShowOutputStage, Converter={StaticResource BoolToVis}}">
<TextBlock Text="Output" FontSize="12" FontWeight="Bold" VerticalAlignment="Center"
Foreground="{StaticResource Brush.OnSurfaceVariant}" Margin="0,0,8,0"/>
<Border Background="{StaticResource Brush.SurfaceContainerLowest}" CornerRadius="4" Padding="2" Height="32" VerticalAlignment="Center"> <Border Background="{StaticResource Brush.SurfaceContainerLowest}" CornerRadius="4" Padding="2" Height="32" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ToggleButton Style="{StaticResource RecordPillToggle}" <ToggleButton Style="{StaticResource RecordPillToggle}"
IsChecked="{Binding RecordPillOn}"> IsChecked="{Binding OnAirPillOn}">
<!-- the label follows the pill's own foreground: muted when armed-off, <StackPanel Orientation="Horizontal">
dark on red when armed (SegmentLabel pins its own colour) --> <Path Width="14" Height="14" Stretch="Uniform" VerticalAlignment="Center"
<TextBlock Text="REC" FontSize="12" FontWeight="Bold" VerticalAlignment="Center" Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"/> Data="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
<TextBlock Text="YouTube" FontSize="12" FontWeight="Bold" Margin="6,0,0,0"
VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"/>
</StackPanel>
</ToggleButton> </ToggleButton>
<ToggleButton Style="{StaticResource RecordPillToggle}" <ToggleButton Style="{StaticResource RecordPillToggle}"
IsChecked="{Binding OnAirPillOn}"> IsChecked="{Binding RecordPillOn}">
<TextBlock Text="ON-AIR" FontSize="12" FontWeight="Bold" VerticalAlignment="Center" <StackPanel Orientation="Horizontal">
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"/> <Path Width="14" Height="14" Stretch="Uniform" VerticalAlignment="Center"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"
Data="M12,2a10,10 0 1,0 0,20a10,10 0 1,0 0,-20zM12,4a8,8 0 1,1 0,16a8,8 0 1,1 0,-16zM12,7.5a4.5,4.5 0 1,1 0,9a4.5,4.5 0 1,1 0,-9z"/>
<TextBlock Text="Local MP4" FontSize="12" FontWeight="Bold" Margin="6,0,0,0"
VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"/>
</StackPanel>
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
</Border> </Border>
<TextBlock Text="One output at a time" FontSize="11" VerticalAlignment="Center"
Foreground="{StaticResource Brush.OnSurfaceVariant}" Margin="8,0,0,0"/>
<!-- Go face names the world: "Start Recording" vs "Go Live". <!-- Go face names the world: "Start Recording" vs "Go Live".
(Signed-out ON-AIR Start routes to the sign-in — StartSession.) --> (Signed-out ON-AIR Start routes to the sign-in — StartSession.) -->
<Button Content="{Binding PrimaryStartButtonLabel}" Style="{StaticResource YtButton}" <Button Content="{Binding PrimaryStartButtonLabel}" Style="{StaticResource YtButton}"
+3 -1
View File
@@ -41,7 +41,9 @@ public partial class MainViewModel : ViewModelBase
// ─── IsRecording / IsLive are reality. ON-AIR needs a sign-in, and the // ─── IsRecording / IsLive are reality. ON-AIR needs a sign-in, and the
// ─── pills are radio-exclusive (record-OR-live, creator ruling 2026-09-01): // ─── pills are radio-exclusive (record-OR-live, creator ruling 2026-09-01):
// ─── arming one clears the other. // ─── arming one clears the other.
private bool _recordPillOn; // Local MP4 is the armed output at launch (creator ruling 2026-11-12: "pos = ON (default)").
// Before that both were unarmed, so the output stage opened with nothing selected.
private bool _recordPillOn = true;
private bool _onAirPillOn; private bool _onAirPillOn;
private bool _isRecording; private bool _isRecording;
+5
View File
@@ -31,6 +31,10 @@ public partial class MainViewModel
public bool IsBuildWorld => _barWorld == BarWorld.Build; public bool IsBuildWorld => _barWorld == BarWorld.Build;
public bool IsOutputWorld => _barWorld == BarWorld.Output; public bool IsOutputWorld => _barWorld == BarWorld.Output;
/// <summary>The output stage belongs to the Record / Go Live world, and only while nothing is
/// running — a live session cannot change its output, so its switch is not offered.</summary>
public bool ShowOutputStage => IsOutputWorld && IsOffline && !IsRecording;
public ICommand EnterBuildWorldCommand { get; private set; } = null!; public ICommand EnterBuildWorldCommand { get; private set; } = null!;
public ICommand EnterOutputWorldCommand { get; private set; } = null!; public ICommand EnterOutputWorldCommand { get; private set; } = null!;
@@ -49,5 +53,6 @@ public partial class MainViewModel
OnPropertyChanged(nameof(IsBuildWorld)); OnPropertyChanged(nameof(IsBuildWorld));
OnPropertyChanged(nameof(IsOutputWorld)); OnPropertyChanged(nameof(IsOutputWorld));
EditingActive = world == BarWorld.Build; EditingActive = world == BarWorld.Build;
OnPropertyChanged(nameof(ShowOutputStage));
} }
} }
+7 -2
View File
@@ -151,8 +151,13 @@ Placement math itself is covered by `WindowPlacementTests` (pure function, no HW
leads the centre cluster and stays present in every state; clicking the highlighted half re-enters it, leads the centre cluster and stays present in every state; clicking the highlighted half re-enters it,
which is how a creator gets back to the layers during a session. `WorldSegmentButton` which is how a creator gets back to the layers during a session. `WorldSegmentButton`
(`Themes/Controls.xaml`) is a Button, not a ToggleButton — the highlight follows the view model, and a (`Themes/Controls.xaml`) is a Button, not a ToggleButton — the highlight follows the view model, and a
click must never be what sets it. Next in the same redesign: the output switch (`Output [YouTube] click must never be what sets it.
[Local MP4] One output at a time`, MP4 default) and an output-dependent primary action. - **The output stage** (`ShowOutputStage`) is the idle cluster and lives only in the Record / Go Live
world while nothing runs: `Output [▶ YouTube] [● Local MP4] One output at a time`, each switch carrying
its glyph, with **Local MP4 armed at launch** (`RecordPillOn` starts true — it did not before). The two
are one axis and the view model already drops one when the other arms, so exclusivity is policy, not
layout. A running session hides the stage (its output cannot change) and the reality line plus the
stop action take the cluster's place. Next in the same redesign: the output-dependent primary action.
- **Editing during a session is a setting (creator ruling 2026-11-12).** `App.LockEditWhileLive` is off - **Editing during a session is a setting (creator ruling 2026-11-12).** `App.LockEditWhileLive` is off
by default: a show does not take EDIT away, so a creator may move a layer or resize a webcam while by default: a show does not take EDIT away, so a creator may move a layer or resize a webcam while
live. On restores the old gun-safety — go-live flips EDIT off, stop flips it back, and only because live. On restores the old gun-safety — go-live flips EDIT off, stop flips it back, and only because
+34
View File
@@ -13,6 +13,40 @@ namespace ytLive.Tests;
[Collection("MainViewModelLayoutPath")] [Collection("MainViewModelLayoutPath")]
public class TopBarWorldTests public class TopBarWorldTests
{ {
[Fact]
public void The_output_stage_belongs_to_the_output_world_and_holds_one_output_at_a_time()
{
var db = Path.Combine(Path.GetTempPath(), $"llamacasty-outputstage-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = db;
try
{
var vm = new MainViewModel();
// Nothing to arm while building scenes.
Assert.False(vm.ShowOutputStage);
vm.EnterOutputWorldCommand.Execute(null);
Assert.True(vm.IsOutputWorld);
Assert.True(vm.IsOffline);
Assert.False(vm.IsRecording);
Assert.True(vm.ShowOutputStage);
// Local MP4 is the default output; the pair is one axis, so arming either drops the other.
Assert.True(vm.RecordPillOn);
Assert.False(vm.OnAirPillOn);
vm.OnAirPillOn = true;
Assert.True(vm.OnAirPillOn);
Assert.False(vm.RecordPillOn);
vm.RecordPillOn = true;
Assert.False(vm.OnAirPillOn);
}
finally
{
MainViewModel.LayoutPathOverride = null;
try { File.Delete(db); } catch (IOException) { }
}
}
[Fact] [Fact]
public void Build_scenes_is_the_default_world_and_is_the_only_place_editing_lives() public void Build_scenes_is_the_default_world_and_is_the_only_place_editing_lives()
{ {
+8
View File
@@ -41,6 +41,14 @@ public class UiShellTests
Assert.Contains("Data=\"M7,10V7a5,5 0 0,1 10,0v3h1", topBar); Assert.Contains("Data=\"M7,10V7a5,5 0 0,1 10,0v3h1", topBar);
Assert.Contains("Visibility=\"{Binding IsOutputWorld, Converter={StaticResource BoolToVis}}\"", topBar); Assert.Contains("Visibility=\"{Binding IsOutputWorld, Converter={StaticResource BoolToVis}}\"", topBar);
// 2c. The output stage: two labelled switches and the exclusivity promise beside them.
Assert.Contains("Text=\"Output\"", topBar);
Assert.Contains("Text=\"YouTube\"", topBar);
Assert.Contains("Text=\"Local MP4\"", topBar);
Assert.Contains("Text=\"One output at a time\"", topBar);
Assert.Contains("IsChecked=\"{Binding OnAirPillOn}\"", topBar);
Assert.Contains("IsChecked=\"{Binding RecordPillOn}\"", topBar);
// 3. Active scene = orange; live stays red. // 3. Active scene = orange; live stays red.
Assert.Contains("IsStaged}\" Value=\"True\">\n <Setter Property=\"BorderBrush\" Value=\"{StaticResource Brush.Attention}\"/>", strip); Assert.Contains("IsStaged}\" Value=\"True\">\n <Setter Property=\"BorderBrush\" Value=\"{StaticResource Brush.Attention}\"/>", strip);