Text tab toggles the drawer; click-away collapses it
This commit is contained in:
+5
-4
@@ -1122,10 +1122,11 @@
|
||||
|
||||
<!-- ═══ BROADCAST TEXT PULL-OUT (always visible) ═══
|
||||
White "Text" tab on the preview's right edge; clicking it
|
||||
slides out the broadcast-metadata form. Edits persist
|
||||
locally immediately; Update pushes liveBroadcasts.update. -->
|
||||
toggles the broadcast-metadata form, and any click outside
|
||||
the form collapses it. Edits persist locally immediately;
|
||||
Update pushes liveBroadcasts.update. -->
|
||||
<Grid Grid.Row="0">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Stretch">
|
||||
<StackPanel x:Name="TextPullOutHost" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Stretch">
|
||||
<Border Background="#16213e" ClipToBounds="True">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
@@ -1221,7 +1222,7 @@
|
||||
ToolTip="Broadcast text fields">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding Gesture="LeftClick"
|
||||
Command="{Binding BroadcastForm.OpenDrawerCommand}"/>
|
||||
Command="{Binding BroadcastForm.ToggleDrawerCommand}"/>
|
||||
</Border.InputBindings>
|
||||
<TextBlock Text="Text" Foreground="#e94560" FontWeight="Bold" FontSize="15"
|
||||
HorizontalAlignment="Center">
|
||||
|
||||
@@ -313,6 +313,9 @@ public partial class MainWindow : Window
|
||||
private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is not DependencyObject original) return;
|
||||
var form = _viewModel.BroadcastForm;
|
||||
if (form.IsDrawerOpen && !IsDescendantOf(original, TextPullOutHost))
|
||||
form.CloseDrawerCommand.Execute(null);
|
||||
if (IsDescendantOf(original, PreviewGrid)) return;
|
||||
if (IsDescendantOf(original, SourceList)) return;
|
||||
if (IsDescendantOf(original, ElementsScrollViewer)) return;
|
||||
|
||||
@@ -41,12 +41,12 @@ public sealed class LiveBroadcastFormViewModel : ViewModelBase
|
||||
_streamService = streamService;
|
||||
_broadcastId = broadcastId;
|
||||
UpdateBroadcastCommand = new RelayCommand(_ => _ = UpdateRemoteAsync(), _ => CanUpdateRemote);
|
||||
OpenDrawerCommand = new RelayCommand(_ => IsDrawerOpen = true);
|
||||
ToggleDrawerCommand = new RelayCommand(_ => IsDrawerOpen = !IsDrawerOpen);
|
||||
CloseDrawerCommand = new RelayCommand(_ => IsDrawerOpen = false);
|
||||
}
|
||||
|
||||
public ICommand UpdateBroadcastCommand { get; }
|
||||
public RelayCommand OpenDrawerCommand { get; }
|
||||
public RelayCommand ToggleDrawerCommand { get; }
|
||||
public RelayCommand CloseDrawerCommand { get; }
|
||||
|
||||
public string Title { get => _title; set { if (SetProperty(ref _title, value)) Persist(); } }
|
||||
|
||||
@@ -195,7 +195,7 @@ The app is a **director's control surface**, not an editor. This replaces the OB
|
||||
|
||||
### Broadcast metadata pull-out + launch geometry (2026-08-24)
|
||||
|
||||
**The "Text" tab** (always visible, 2026-08-24 revision): a white 30px tab with rotated YouTube-red "Text" sits on the right edge of the preview, vertically centered — **shown regardless of login/stream state** (creator decision; original IsLive gating removed same day). Click slides out a 320px dark drawer over the preview's right edge (200ms CubicEase on `Width`, `BroadcastForm.IsDrawerOpen` drives it; ✕ closes). The Update button still greys until `CurrentBroadcastId` exists.
|
||||
**The "Text" tab** (always visible, 2026-08-24 revision): a white 30px tab with rotated YouTube-red "Text" sits on the right edge of the preview, vertically centered — **shown regardless of login/stream state** (creator decision; original IsLive gating removed same day). Click **toggles** the drawer (`ToggleDrawerCommand`); any left-click outside the form also collapses it (`Window_PreviewMouseLeftButtonDown` checks `TextPullOutHost` ancestry), as does the ✕. The drawer is a 320px dark panel over the preview's right edge (200ms CubicEase on `Width`, `BroadcastForm.IsDrawerOpen` drives it). The Update button still greys until `CurrentBroadcastId` exists.
|
||||
|
||||
**Fields — the always-editable snippet/status set** (⚠️ creator premise inverted: contentDetails fields like latency/DVR/embed are editable ONLY in created/ready, NOT while live; they are deliberately absent):
|
||||
- Title / Description / Tags (comma-separated string → `snippet.tags[]`) / Visibility ComboBox (private/unlisted/public) / Made-for-Kids CheckBox — all live-editable pre- and post-launch
|
||||
|
||||
@@ -77,7 +77,11 @@ public sealed class BroadcastPullOutTests
|
||||
Assert.Equal("Hello", vm.BroadcastForm.Title);
|
||||
|
||||
Assert.False(vm.BroadcastForm.IsDrawerOpen);
|
||||
vm.BroadcastForm.OpenDrawerCommand.Execute(null);
|
||||
vm.BroadcastForm.ToggleDrawerCommand.Execute(null);
|
||||
Assert.True(vm.BroadcastForm.IsDrawerOpen);
|
||||
vm.BroadcastForm.ToggleDrawerCommand.Execute(null);
|
||||
Assert.False(vm.BroadcastForm.IsDrawerOpen);
|
||||
vm.BroadcastForm.ToggleDrawerCommand.Execute(null);
|
||||
Assert.True(vm.BroadcastForm.IsDrawerOpen);
|
||||
vm.BroadcastForm.CloseDrawerCommand.Execute(null);
|
||||
Assert.False(vm.BroadcastForm.IsDrawerOpen);
|
||||
|
||||
Reference in New Issue
Block a user