feat(editor): open server sequences with proxies, hero frame to the index, export sync and saved copies

Server sequences that are not in the local index open through a RemoteSequenceSource:
proxies from the cache, project from the server's settings with their version (a 409
merges again), analysis report from the server, analyses and renders posted as server
jobs (one per preset) and followed through the server's events. Set hero now reaches the
index (SequenceEdit.HeroFrameId) so the Library card shows it. The Export tab gains the
Sync option (remembered in the project) and restores "Save both" copies through undo.

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-03 11:38:11 +00:00
1 parent 90321a7e53
commit 2ff3a6503b
36 files changed
+1307 -116

No files matched your search

+30 -4
View File
@@ -48,6 +48,9 @@ public sealed class SampleData
private SampleData(AppServices services) => _services = services;
/// <summary>The server-only sequence whose proxies <see cref="CacheProxiesAsync"/> keeps on this PC (Sunrise over Superga).</summary>
public Guid ProxiedSequenceId => _sunrise;
/// <summary>Points the services at fakes (server, encoders, update check) for an empty first-run state.</summary>
public static SampleData Configure(AppServices services)
{
@@ -61,6 +64,7 @@ public sealed class SampleData
services.Devices = new SampleDeviceMonitor();
var sample = new SampleData(services);
services.Sync.RemoteFactory = (_, _, _) => sample._remote;
services.Sync.EditorFactory = (_, _, _) => sample._remote;
return sample;
}
@@ -617,13 +621,15 @@ public sealed class SampleData
}
/// <summary>
/// The sample server's sequences for the sync table: listings, manifests (frames hashed from their index, so
/// unhashed sample frames match them by count; renders as many as the listing says), settings edits and proxies
/// (generated JPEGs); uploads and originals are not part of the screenshots.
/// The sample server's sequences for the sync table and the editor of a server sequence: listings, manifests
/// (frames hashed from their index, so unhashed sample frames match them by count; renders as many as the listing
/// says), settings edits, proxies (generated JPEGs) and jobs the editor posts (kept queued); uploads, originals and
/// analysis reports are not part of the screenshots.
/// </summary>
private sealed class SampleSyncRemote : ISyncRemote
private sealed class SampleSyncRemote : ISyncRemote, IRemoteSequenceApi
{
private readonly Dictionary<Guid, (SequenceDto Dto, string? Settings, Guid[] Frames)> _sequences = [];
private readonly Dictionary<Guid, JobDto> _jobs = [];
public string Server => ServerAddress;
@@ -707,6 +713,26 @@ public sealed class SampleData
yield break;
}
public Task<string?> GetAnalysisReportAsync(Guid id, CancellationToken cancellationToken) => Task.FromResult<string?>(null);
public Task<JobDto> CreateJobAsync(CreateJobRequest request, CancellationToken cancellationToken)
{
var job = new JobDto(Guid.CreateVersion7(), request.Kind, request.Target, null, "queued", "user", 0, 0, null, null, null, null, 0, null,
DateTimeOffset.UtcNow, null, null);
lock (_jobs) _jobs[job.Id] = job;
return Task.FromResult(job);
}
public Task<JobDto> GetJobAsync(Guid id, CancellationToken cancellationToken)
{
lock (_jobs) return Task.FromResult(_jobs[id]);
}
public Task<IReadOnlyList<JobDto>> ListActiveJobsAsync(CancellationToken cancellationToken)
{
lock (_jobs) return Task.FromResult<IReadOnlyList<JobDto>>([.. _jobs.Values]);
}
public void Dispose()
{
}