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

+17 -14
View File
@@ -142,11 +142,11 @@ public sealed class SyncTableViewModel : ObservableObject, IDisposable
_ = ReloadAsync();
}
/// <summary>Reads the table again; concurrent requests collapse into one more pass.</summary>
/// <summary>Reads the table again; requests made while a pass runs share the next one, which they wait for.</summary>
public async Task ReloadAsync()
{
Interlocked.Exchange(ref _reloadQueued, 1);
if (!await _reloading.WaitAsync(0)) return;
await _reloading.WaitAsync();
try
{
while (Interlocked.Exchange(ref _reloadQueued, 0) == 1)
@@ -293,18 +293,7 @@ public sealed class SyncTableViewModel : ObservableObject, IDisposable
SyncAction.TakeServer => SyncResolution.TakeServer,
_ => SyncResolution.SaveBoth,
};
if (resolution != SyncResolution.SaveBoth && !_shell.Services.Dialogs.Confirm(new ConfirmRequest
{
Heading = Loc.L("Server.Conflict." + action + ".Title"),
Message = Loc.L("Server.Conflict." + action + ".Message", entry.Title),
Detail = SyncText.Conflict(entry),
DetailToolTip = Loc.L("Tooltips.Server.Conflict.Detail"),
SafeText = Loc.L("Server.Conflict.Cancel"),
SafeToolTip = Loc.L("Tooltips.Server.Conflict.Cancel"),
ActionText = Loc.L("Server.Sync.Action." + action),
ActionToolTip = Loc.L("Tooltips.Server.Sync." + action),
IsDestructive = true,
})) return;
if (resolution != SyncResolution.SaveBoth && !_shell.Services.Dialogs.Confirm(OverwriteRequest(entry, action))) return;
try
{
await service.ResolveAsync(remote, entry.Id, resolution, CancellationToken.None);
@@ -317,6 +306,20 @@ public sealed class SyncTableViewModel : ObservableObject, IDisposable
}
}
/// <summary>"Keep this PC's settings?" with the settings that differ: one side's edits are about to be overwritten.</summary>
private static ConfirmRequest OverwriteRequest(SyncEntry entry, SyncAction action) => new()
{
Heading = Loc.L("Server.Conflict." + action + ".Title"),
Message = Loc.L("Server.Conflict." + action + ".Message", entry.Title),
Detail = SyncText.Conflict(entry),
DetailToolTip = Loc.L("Tooltips.Server.Conflict.Detail"),
SafeText = Loc.L("Server.Conflict.Cancel"),
SafeToolTip = Loc.L("Tooltips.Server.Conflict.Cancel"),
ActionText = Loc.L("Server.Sync.Action." + action),
ActionToolTip = Loc.L("Tooltips.Server.Sync." + action),
IsDestructive = true,
};
private async Task UploadAllAsync()
{
if (Host is not { Service: { } service, Server: { } server } || _shell.Services.Engine is not { } engine) return;