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

+32
View File
@@ -319,6 +319,38 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
Shell.Notify(Loc.L("Editor.Render.Queued"), request.Label, Loc.L("Shell.Nav.Jobs"), Loc.L("Tooltips.Nav.Jobs"), () => Shell.Navigate(SectionKey.Jobs));
}
/// <summary>
/// Completes once the preview, corrections, plan, estimates and filmstrip thumbnails in flight are done (capture and
/// tests); a finished step may start the next (corrections re-render the preview), so it waits until all are quiet.
/// </summary>
/// <returns>False when the work was still going on after <paramref name="timeout"/>.</returns>
public async Task<bool> WhenIdleAsync(TimeSpan timeout)
{
var deadline = DateTime.UtcNow + timeout;
while (deadline - DateTime.UtcNow is { Ticks: > 0 } left)
{
var work = Work();
try
{
await Task.WhenAll(work).WaitAsync(left);
}
catch (TimeoutException)
{
return false;
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
// A failed run was already logged by its owner; it counts as done.
}
await Task.Delay(50);
// Quiet means nothing new was scheduled meanwhile (the same tasks) and no thumbnail is loading.
if (work.SequenceEqual(Work()) && (Thumbnails as EditorThumbnails)?.Pending is null or 0) return true;
}
return false;
Task[] Work() => [_preview.Idle, _corrections.Idle, _plans.Idle, .. Tabs.OfType<ExportTab>().Select(t => t.EstimatesIdle)];
}
/// <summary>Loads the jobs of this sequence already queued or running (busy state).</summary>
public async Task AttachJobsAsync()
{