App Settings: transition type and length picker

Cut/Fade/Move and a 100-2000 ms length, bound to the view model; changes save with the layout.
Test: TransitionPickerTests. Not pushed.
This commit is contained in:
2026-10-27 09:12:37 -07:00
parent 90cd039d98
commit f67a263ccd
4 changed files with 70 additions and 4 deletions
+13 -1
View File
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Helpers="clr-namespace:ytLive.Helpers"
xmlns:Models="clr-namespace:ytLive.Models">
xmlns:Models="clr-namespace:ytLive.Models"
xmlns:services="clr-namespace:ytLive.Services">
<Grid Grid.RowSpan="3"
Visibility="{Binding IsAnyOverlayOpen, Converter={StaticResource BoolToVis}}">
<Button Background="#99000000" BorderThickness="0" Cursor="Hand"
@@ -55,6 +56,17 @@
<ComboBoxItem Content="Phone (Vertical Rectangle)" Tag="{x:Static Models:ZoomShape.VerticalRectangle}"/>
<ComboBoxItem Content="Tablet (Horizontal Rectangle)" Tag="{x:Static Models:ZoomShape.HorizontalRectangle}"/>
</ComboBox>
<TextBlock Text="Scene Transition" Style="{StaticResource YtLabel}" Margin="0,12,0,4"/>
<ComboBox Style="{StaticResource YtComboBox}" SelectedValue="{Binding SelectedTransitionType}" SelectedValuePath="Tag">
<ComboBoxItem Content="Cut" Tag="{x:Static services:TransitionType.Cut}"/>
<ComboBoxItem Content="Fade" Tag="{x:Static services:TransitionType.Fade}"/>
<ComboBoxItem Content="Move" Tag="{x:Static services:TransitionType.Move}"/>
</ComboBox>
<TextBlock Style="{StaticResource YtLabel}" Margin="0,8,0,4">
<Run Text="Transition length: "/><Run Text="{Binding TransitionDurationMs, StringFormat={}{0:0} ms}"/>
</TextBlock>
<Slider Minimum="100" Maximum="2000" TickFrequency="50" IsSnapToTickEnabled="True"
Value="{Binding TransitionDurationMs, Mode=TwoWay}"/>
</StackPanel>
<!-- Report Bug -->
+1 -1
View File
@@ -455,7 +455,7 @@ These were explicitly ruled out:
## Transitions & brand logo (queued 2026-10-27)
- ✅ **Fade fix** — swaps fade from the outgoing picture (`TransitionFadeTests`). On-screen check pending.
- ☐ **Transition picker** in App Settings (type + duration).
- ✅ **Transition picker** in App Settings (type + duration), saved with the layout (`TransitionPickerTests`).
- ☐ **Wipe** — CPU blend, direction setting.
- ☐ **Move** — persistent layers (per-layer "carry across scenes" flag), per-scene placement, fixed z band.
- ☐ **Brand logo** — permanent "Brand logo" layer above background in every scene; file in App Settings
+2 -2
View File
@@ -97,14 +97,14 @@ public partial class MainViewModel
public TransitionType SelectedTransitionType
{
get => _selectedTransitionType;
set => SetProperty(ref _selectedTransitionType, value);
set { if (SetProperty(ref _selectedTransitionType, value)) ScheduleSave(); }
}
private TransitionType _selectedTransitionType = TransitionType.Fade;
public double TransitionDurationMs
{
get => _transitionDurationMs;
set => SetProperty(ref _transitionDurationMs, value);
set { if (SetProperty(ref _transitionDurationMs, value)) ScheduleSave(); }
}
private double _transitionDurationMs = 300;
+54
View File
@@ -0,0 +1,54 @@
using System;
using System.ComponentModel;
using Xunit;
using ytLive.Services;
using ytLive.ViewModels;
namespace ytLive.Tests;
/// <summary>
/// The App Settings transition picker drives the view model: type and length changes
/// notify the bound controls.
/// </summary>
[Collection("RealApp")]
public sealed class TransitionPickerTests
{
private readonly RealAppHost _app;
public TransitionPickerTests(RealAppHost app) => _app = app;
[Fact]
public void Transition_Type_And_Length_Notify_The_Settings_Picker()
{
_app.Run(Run);
}
private static void Run()
{
var tempDb = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"ytLlive-transition-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
try
{
using (var schema = new LayoutStore(tempDb)) { }
Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools();
var vm = new MainViewModel();
var raised = new System.Collections.Generic.List<string>();
((INotifyPropertyChanged)vm).PropertyChanged += (_, e) => raised.Add(e.PropertyName ?? "");
vm.SelectedTransitionType = TransitionType.Move;
vm.TransitionDurationMs = 750;
Assert.Equal(TransitionType.Move, vm.SelectedTransitionType);
Assert.Equal(750, vm.TransitionDurationMs);
Assert.Contains(nameof(MainViewModel.SelectedTransitionType), raised);
Assert.Contains(nameof(MainViewModel.TransitionDurationMs), raised);
}
finally
{
MainViewModel.LayoutPathOverride = null;
Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools();
try { System.IO.File.Delete(tempDb); } catch { }
}
}
}