test(app): editor sample for --capture and a Windows smoke test of every section

SampleData.FillEditorAsync writes a synthetic harbour sunset of real JPEG
frames with Exif (flicker, two exposure steps, white-balance drift, a
horizon), scans, deep-analyses and advises it, so --capture writes
sequence-<tab>-<theme>.png for every editor section. EditorViewModel
.WhenIdleAsync lets capture and tests wait for the preview, corrections,
plan, estimates and thumbnails in flight.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 17:35:53 +00:00
1 parent 37703b13f9
commit b2b36d5c57
7 files changed
+413 -1

No files matched your search

+31
View File
@@ -4,6 +4,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using Titano.App.DesignTime;
using Titano.App.Editor;
using Titano.App.Settings;
using Titano.Core.Diagnostics;
using Titano.Ui.Theming;
@@ -97,6 +98,8 @@ public static class ScreenCapture
written += await SaveAsync(window, directory, key.ToString().ToLowerInvariant(), theme);
}
}
written += await CaptureEditorAsync(window, shell, sample, directory);
Log.Info("capture", $"{written} screenshot(s) written to {Path.GetFullPath(directory)}");
if (written == 0) Environment.ExitCode = 1;
}
@@ -111,6 +114,34 @@ public static class ScreenCapture
}
}
/// <summary>The sequence editor on the synthetic sunset: every section in both themes (<c>sequence-&lt;tab&gt;-&lt;theme&gt;.png</c>).</summary>
private static async Task<int> CaptureEditorAsync(Window window, ShellViewModel shell, SampleData sample, string directory)
{
var written = 0;
var id = await sample.FillEditorAsync();
shell.OpenSequence(id);
await shell.Sequence.OpenAsync(id);
if (shell.Sequence.Editor is not { } editor)
{
Log.Warning("capture", "The editor sample did not open");
return 0;
}
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
foreach (var tab in editor.Tabs)
{
editor.SelectedTab = tab;
editor.CurrentIndex = tab is ExportTab ? 40 : 45;
await Settle(window);
if (!await editor.WhenIdleAsync(TimeSpan.FromSeconds(30))) Log.Warning("capture", $"The {tab.Key} section was still busy");
written += await SaveAsync(window, directory, "sequence-" + tab.Key.ToLowerInvariant(), theme);
}
}
editor.SelectedTab = editor.Exposure;
return written;
}
private static async Task<int> SaveAsync(Window window, string directory, string screen, AppTheme theme, ShellViewModel? waitForThumbnails = null)
{
await Settle(window);