feat(topbar): one decision — [ Build Scenes ][ Record / Go Live ]

Unit A of the top-bar redesign (creator ruling 2026-11-12). The standalone EDIT toggle is gone;
Build Scenes IS edit mode, so "which world am I in?" and "can I edit?" cannot disagree any more.

BarWorld (ViewModels/MainViewModel.TopBar.cs) has two values, Build and Output. Build ships
highlighted at launch and sets EditingActive on; choosing Record / Go Live turns it off. Clicking the
already-highlighted half is deliberately not a no-op: it re-enters that world, which is the only way
back to the layers during a session now that the EDIT button is gone (unit 1 made that legal).

WorldSegmentButton (Themes/Controls.xaml) is a Button, not a ToggleButton, and each half passes its
own flag through Tag to one shared DataTrigger — a ToggleButton would fight the view model and, with a
one-way IsChecked, clear its own binding on first click.

UiShellTests updated where it guarded the old EDIT markup (it now guards the segment). TopBarWorldTests
pins launch state, both transitions, and the re-enter case.

679 pass, 0 warnings. Next: unit B (output switch), unit C (output-dependent 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:05:29 -08:00
parent d46e84562f
commit a5dc2f494c
7 changed files with 174 additions and 30 deletions
+53
View File
@@ -0,0 +1,53 @@
using System.Windows.Input;
using ytLive.Helpers;
namespace ytLive.ViewModels;
/// <summary>Which half of the top bar's dual segment is in force.</summary>
public enum BarWorld
{
/// <summary>Build Scenes — the edit surface. The default at launch (creator ruling 2026-11-12).</summary>
Build,
/// <summary>Record / Go Live — the output surface: which output, and the one action that starts it.</summary>
Output,
}
/// <summary>
/// The top bar's one decision (creator ruling 2026-11-12): <c>[ Build Scenes ][ Record / Go Live ]</c>.
/// Build Scenes <b>is</b> edit mode — there is no separate EDIT toggle any more, so "may I edit?" and
/// "which world am I in?" cannot disagree.
///
/// <para>Clicking the highlighted segment is not a no-op: it re-enters that world, which matters while a
/// session runs because Build Scenes is the only way back to the layers (see
/// <see cref="LockEditWhileLive"/>).</para>
/// </summary>
public partial class MainViewModel
{
private BarWorld _barWorld = BarWorld.Build;
public BarWorld BarWorld => _barWorld;
public bool IsBuildWorld => _barWorld == BarWorld.Build;
public bool IsOutputWorld => _barWorld == BarWorld.Output;
public ICommand EnterBuildWorldCommand { get; private set; } = null!;
public ICommand EnterOutputWorldCommand { get; private set; } = null!;
private void InitializeWorldCommands()
{
EnterBuildWorldCommand = new RelayCommand(_ => EnterWorld(BarWorld.Build));
EnterOutputWorldCommand = new RelayCommand(_ => EnterWorld(BarWorld.Output));
}
/// <summary>Switches worlds. Re-entering the current one still re-asserts its edit state, which is
/// what lets a creator take EDIT back mid-show by clicking Build Scenes.</summary>
internal void EnterWorld(BarWorld world)
{
_barWorld = world;
OnPropertyChanged(nameof(BarWorld));
OnPropertyChanged(nameof(IsBuildWorld));
OnPropertyChanged(nameof(IsOutputWorld));
EditingActive = world == BarWorld.Build;
}
}
+1
View File
@@ -342,6 +342,7 @@ public partial class MainViewModel : ViewModelBase
OpenHotkeyConfigCommand = new RelayCommand(_ => OpenHotkeyConfig());
ChangeAccountCommand = new RelayCommand(_ => _ = ChangeAccountAsync());
LogoutCommand = new RelayCommand(_ => _ = SignOutYouTubeAsync());
InitializeWorldCommands();
_layoutStore = new LayoutStore(LayoutPathOverride ?? DefaultLayoutPath);
_activeLayoutPath = _layoutStore.ActivePath;