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:
7 files changed
+430
-19
No files matched your search
@@ -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 <dir></c>: renders every client screen at 1440×900 in the dark and light themes to
|
||||
/// <c><screen>-<theme>.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);
|
||||
|
||||
Reference in new issue
Block a user