feat(app): sample server for sync captures, server-sync and server-conflict screenshots, sync tests

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 23:00:15 +00:00
1 parent 25653c052b
commit b31c6aa332
7 files changed
+430 -19

No files matched your search

+20 -1
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.Server;
using Titano.App.Settings;
using Titano.Core.Diagnostics;
using Titano.Ui.Theming;
@@ -13,7 +14,7 @@ namespace Titano.App.Shell;
/// <summary>
/// <c>Titano.exe --capture &lt;dir&gt;</c>: renders every client screen at 1440×900 in the dark and light themes to
/// <c>&lt;screen&gt;-&lt;theme&gt;.png</c> from <see cref="SampleData"/> (first run on an empty index, then a populated
/// one), for visual review and phase reports (BRIEF §20.2), then exits.
/// one, then the sync table with an upload and a settings conflict), for visual review and phase reports (BRIEF §20.2), then exits.
/// </summary>
public static class ScreenCapture
{
@@ -55,6 +56,8 @@ public static class ScreenCapture
await shell.Library.RefreshAsync();
await shell.Jobs.ReloadAsync();
await shell.Services.Server.RestoreAsync();
await shell.Services.Sync.RefreshAsync();
await shell.Server.Sync.ReloadAsync();
shell.About.SetResult(null);
await shell.Settings.DetectEncodersAsync();
await shell.Settings.SelfTestAsync();
@@ -97,6 +100,19 @@ public static class ScreenCapture
written += await SaveAsync(window, directory, key.ToString().ToLowerInvariant(), theme);
}
}
// The sync table with an upload in progress, then filtered to the settings conflict.
await sample.FillSyncAsync();
await shell.Server.Sync.ReloadAsync();
foreach (var theme in Themes)
{
ThemeManager.Apply(theme);
shell.Navigate(SectionKey.Server);
SelectSyncFilter(shell, SyncFilter.All);
written += await SaveAsync(window, directory, "server-sync", theme);
SelectSyncFilter(shell, SyncFilter.Conflicts);
written += await SaveAsync(window, directory, "server-conflict", theme);
SelectSyncFilter(shell, SyncFilter.All);
}
Log.Info("capture", $"{written} screenshot(s) written to {Path.GetFullPath(directory)}");
if (written == 0) Environment.ExitCode = 1;
}
@@ -111,6 +127,9 @@ public static class ScreenCapture
}
}
private static void SelectSyncFilter(ShellViewModel shell, SyncFilter filter) =>
shell.Server.Sync.Chips.First(c => c.Filter == filter).SelectCommand.Execute(null);
private static async Task<int> SaveAsync(Window window, string directory, string screen, AppTheme theme, ShellViewModel? waitForThumbnails = null)
{
await Settle(window);