feat: wire separate homes into the desktop (owner review 5 P3.2)
The desktop now uses the per-home layout from P3.1: each home keeps its own projects, proxies and originals, and a server is known by its id whichever address reaches it. - Settings keep the known servers (id, name, last address, certificate, aliases, originals archive). Reset and Import keep them; Export leaves them out. - SyncHost records each server the first time it signs in with an id. It names the cache and workspace folders by that id, and re-keys the folders a server had under its addresses at sign-in. The re-key waits while transfer or workspace jobs are pending. - Download originals goes to the server's own archive. It is created beside this PC's archive at the first download, and a toast says where. A sequence that already has a local copy keeps receiving into that copy's archive. A server without an id keeps the 1.0 behaviour. - At start, after the index opens and before any job runs, the folders are sorted into their homes. A toast reports the result: sorted, pending or failed. - The workspace host gives each home's store its own sync. Find, List, usage, clean-up and the trash plan and empty cover every home. Server comparisons go through the identity, so a project stays Online when its server is reached by another address. - The render-node downloads and the server import staging move into the server's folder of the cache. The cache trim keeps `servers`, and the scheduled scan also scans the originals archives. - Settings shows the Home folders rows (Workspace) and the Known servers table (Server). The diagnostics bundle lists the homes. - The dead `AppPaths.CreateDirectories` and `ThumbnailsDirectory` are removed. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d697a4255
commit
9ad8c6f7a9
44 files changed
+1106
-220
No files matched your search
@@ -44,13 +44,13 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
await bed.WaitForJobAsync(checkout.Copy.Id);
|
||||
var projectId = checkout.Project.Id;
|
||||
// Named the server's, as a copy downloaded from the server leaves it.
|
||||
var folder = host.Store.Find(projectId)!;
|
||||
var folder = host.Find(projectId)!;
|
||||
var bundle = folder.ReadBundle();
|
||||
var home = new BundleHome(BundleHome.ServerKind, bed.SequenceId, null, Server);
|
||||
folder.WriteBundle(bundle with { Workspace = bundle.Workspace! with { Home = home } });
|
||||
|
||||
// Not signed in to the server: a render from the originals runs here all the same.
|
||||
var source = new WorkspaceSequenceSource(host.Sync, projectId, bed.Db, DecoderFactory.CreateClient(null), bed.Engine,
|
||||
var source = new WorkspaceSequenceSource(host.SyncOf(projectId), projectId, bed.Db, DecoderFactory.CreateClient(null), bed.Engine,
|
||||
new WorkspaceServerHome((IRemoteSequenceApi?)null));
|
||||
var content = await source.LoadAsync(bed.Ct);
|
||||
var session = new EditorSession(source, content, [], TimeSpan.FromMilliseconds(20));
|
||||
@@ -62,7 +62,7 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
Assert.Equal(JobKind.WorkspaceRender, request.Kind);
|
||||
Assert.SequenceEqual([bed.SequenceId], request.Targets);
|
||||
var parameters = Assert.NotNull(WorkspaceJobs.RenderParameters(new Job { Id = Guid.CreateVersion7(), Kind = request.Kind, ParametersJson = request.ParametersJson }));
|
||||
Assert.Equal((projectId, host.Store.Root, Server), (parameters.ProjectId, parameters.WorkspaceRoot, parameters.Server));
|
||||
Assert.Equal((projectId, host.Find(projectId)!.Store.Root, Server), (parameters.ProjectId, parameters.WorkspaceRoot, parameters.Server));
|
||||
var (render, _) = ProcessingJobs.ReadRender(parameters.RenderJson);
|
||||
Assert.NotNull(render.SettingsJson, "the portable settings travel with the job");
|
||||
|
||||
@@ -108,7 +108,7 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
var checkout = await host.CheckoutAsync(bed.SequenceId, null, null, BundleMedia.Originals, cancellationToken: bed.Ct);
|
||||
await bed.WaitForJobAsync(checkout.Copy.Id);
|
||||
var projectId = checkout.Project.Id;
|
||||
var folder = host.Store.Find(projectId)!;
|
||||
var folder = host.Find(projectId)!;
|
||||
var (source, session) = await bed.OpenAsync(host, projectId);
|
||||
var ui = new RecordingUi { ConfirmAnswer = false };
|
||||
await using (session)
|
||||
@@ -155,7 +155,7 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
await using var bed = await WorkspaceTestBed.CreateAsync(context, frames: 2);
|
||||
var host = bed.Host(new AppSettings { WorkspaceAutoSync = false });
|
||||
var projectId = await bed.CheckoutAsync(host);
|
||||
var folder = host.Store.Find(projectId)!;
|
||||
var folder = host.Find(projectId)!;
|
||||
Assert.False(await host.SendRendersAsync(projectId, bed.Ct), "nothing waits to be sent");
|
||||
Assert.False(await host.RenderSendPendingAsync(projectId, bed.SequenceId, bed.Ct));
|
||||
|
||||
@@ -171,7 +171,7 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
var sends = (await bed.Db.Jobs.ListAsync(null, 50, null, bed.Ct)).Items.Where(j => j.Kind == JobKind.WorkspaceSend).ToList();
|
||||
Assert.Equal(1, sends.Count);
|
||||
var parameters = Assert.NotNull(WorkspaceJobs.SendParameters(sends[0]));
|
||||
Assert.Equal((projectId, host.Store.Root), (parameters.ProjectId, parameters.WorkspaceRoot));
|
||||
Assert.Equal((projectId, host.Find(projectId)!.Store.Root), (parameters.ProjectId, parameters.WorkspaceRoot));
|
||||
Assert.Empty(parameters.RenderIds);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public sealed class WorkspaceLocalRenderTests(TestContext context)
|
||||
using (var menu = new ProjectMenuViewModel(host, source, session, ui))
|
||||
{
|
||||
await menu.RefreshAsync();
|
||||
var folder = host.Store.Find(projectId)!;
|
||||
var folder = host.Find(projectId)!;
|
||||
var before = folder.Versions().Count;
|
||||
|
||||
// Nothing changed: nothing saved.
|
||||
|
||||
Reference in new issue
Block a user