feat(37): expose the staged-scene factory reset

App Settings can now restore only the staged canonical scene. The VM saves
pending edits first, resets that scene, reloads immediately, and keeps the same
scene staged. Other scene edits survive; the action is disabled while live or
recording. 615 tests green, clean build with 0 warnings.

Reference: OBS Scene Collections keep scene/source sets distinct:
https://obsproject.com/kb/scene-collections
This commit is contained in:
2026-11-10 18:09:16 -08:00
parent 41064bdd13
commit e6c6913994
4 changed files with 57 additions and 1 deletions
+14
View File
@@ -193,6 +193,8 @@ public partial class MainViewModel : ViewModelBase
public ICommand AddReplayLayerCommand { get; }
/// <summary>TASK 37: replace the current scene set with its factory snapshot.</summary>
public ICommand RestoreAllLayoutDefaultsCommand { get; }
/// <summary>TASK 37: restore only the staged canonical scene to its factory snapshot.</summary>
public ICommand RestoreStagedSceneDefaultsCommand { get; }
public ICommand ChangeMediaFileCommand { get; }
/// <summary>Accepts the detector's green/blue-screen offer on a clip (TASK 64).</summary>
public ICommand AcceptChromaSuggestionCommand { get; }
@@ -275,6 +277,8 @@ public partial class MainViewModel : ViewModelBase
AddReplayLayerCommand = new RelayCommand(_ => AddReplayLayer());
RestoreAllLayoutDefaultsCommand = new RelayCommand(_ => RestoreAllLayoutDefaults(),
_ => IsOffline && !IsRecording);
RestoreStagedSceneDefaultsCommand = new RelayCommand(_ => RestoreStagedSceneDefaults(),
_ => IsOffline && !IsRecording && StagedScene is { } scene && SceneCatalog.IsCanonical(scene.Name));
ChangeMediaFileCommand = new RelayCommand(
element => ChangeMediaFile(element as Source),
element => element is Source { IsMediaSource: true });
@@ -642,6 +646,16 @@ public partial class MainViewModel : ViewModelBase
LoadLayout();
}
private void RestoreStagedSceneDefaults()
{
if (!IsOffline || IsRecording || StagedScene is not { } staged || !SceneCatalog.IsCanonical(staged.Name)) return;
var sceneName = staged.Name;
SaveLayoutNow();
if (!_layoutStore.RestoreDefaultScene(staged.Id)) return;
LoadLayout();
StagedScene = Scenes.FirstOrDefault(scene => SceneCatalog.Is(scene.Name, sceneName)) ?? StagedScene;
}
private void ScheduleSave()
{
if (_isLoading || _saveDebounce == null) return;