fix(workspace): close the phase 5c review findings
Originals are now judged by their bytes, never by the media index: a removal or clean-up hashes every file under media/originals and deletes it only when the home holds that SHA-256; every other file, named or not, goes to the workspace trash. Trash entries are filled under a staging name that Empty never lists. A ledger can only name files inside exports/. Jobs follow the workspace: a copy, render or send resolves the folder that holds its project now (a moved workspace, a retry after a move) and waits while a move has not switched yet. A clean-up failure after the switch is a warning that keeps the journal for a later resume; entries that changed since they were copied are kept, and a same-volume rename refused across volumes falls back to copy and verify. Sends map a replayed version by content hash, or go with the project only, and note an old server that drops provenance. The media index (format 2) and project file (format 3) refuse older readers while they hold originals. Metered connections also hold sync downloads and server copies. The editor gains Send again, the Settings page can resume a stopped move, the disabled tooltips say why, and unused strings are pruned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09fcff4eb2
commit
2654683a12
125 files changed
+1618
-401
No files matched your search
@@ -693,13 +693,61 @@ public sealed class SettingsLogicTests
|
||||
Assert.True(rows.CanMove);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AMoveStoppedBeforeItEndedIsOfferedAgainAndHoldsChangeAndMove()
|
||||
{
|
||||
var stopped = true;
|
||||
var resumed = 0;
|
||||
var (_, rows, _) = WorkspaceRows(new FakeWorkspace(), move: () => Task.CompletedTask, isMoving: () => stopped, unfinished: () => stopped, resume: () =>
|
||||
{
|
||||
resumed++;
|
||||
stopped = false;
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
await rows.MeasureAsync();
|
||||
|
||||
// Change and Move say why they wait; Resume takes the move up.
|
||||
Assert.True(rows.CanResumeMove);
|
||||
Assert.Equal((Loc.L("Tooltips.Settings.Workspace.MoveUnfinished"), Loc.L("Tooltips.Settings.Workspace.MoveUnfinished")), (rows.ChangeToolTip, rows.MoveToolTip));
|
||||
Assert.False(rows.ChangeCommand.CanExecute(null));
|
||||
Assert.False(rows.MoveCommand.CanExecute(null));
|
||||
Assert.True(rows.ResumeMoveCommand.CanExecute(null));
|
||||
|
||||
rows.ResumeMoveCommand.Execute(null);
|
||||
await Chronos.App.Tests.Workspace.WorkspaceTestBed.UntilAsync(() => !rows.ResumeMoveCommand.IsRunning, "the move taken up");
|
||||
Assert.Equal(1, resumed);
|
||||
Assert.False(rows.CanResumeMove);
|
||||
Assert.Equal((Loc.L("Tooltips.Settings.ChangeWorkspace"), Loc.L("Tooltips.Settings.Workspace.Move")), (rows.ChangeToolTip, rows.MoveToolTip));
|
||||
Assert.True(rows.ChangeCommand.CanExecute(null));
|
||||
Assert.True(rows.MoveCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ADefaultMediaOrOpenPolicySetElsewhereReadsAsEverythingAppliesIt()
|
||||
{
|
||||
var (settings, rows, _) = WorkspaceRows();
|
||||
settings.WorkspaceDefaultMedia = "ORIGINALS";
|
||||
Assert.Equal(Chronos.Core.Project.BundleMedia.Originals, settings.EffectiveDefaultMedia);
|
||||
Assert.True(rows.IsDefaultOriginals);
|
||||
settings.WorkspaceDefaultMedia = "raw files";
|
||||
Assert.Equal(BundleMediaProxies, settings.EffectiveDefaultMedia);
|
||||
Assert.True(rows.IsDefaultProxies);
|
||||
|
||||
settings.WorkspaceOpenProject = (WorkspaceOpenPolicy)42;
|
||||
Assert.Equal(WorkspaceOpenPolicy.LastUsed, settings.EffectiveOpenPolicy);
|
||||
Assert.True(rows.IsOpenLastUsed);
|
||||
settings.WorkspaceOpenProject = WorkspaceOpenPolicy.Ask;
|
||||
Assert.Equal(WorkspaceOpenPolicy.Ask, settings.EffectiveOpenPolicy);
|
||||
Assert.False(rows.IsOpenLastUsed);
|
||||
}
|
||||
|
||||
private const int DeletePlansListed = Chronos.App.Archiving.DeletePlans.ListedLines;
|
||||
private const string BundleMediaProxies = Chronos.Core.Project.BundleMedia.Proxies;
|
||||
|
||||
private static ConfirmRequest? SettingsTrashRequest(WorkspaceTrashPlan plan) => WorkspaceSettingsRows.TrashRequest(plan);
|
||||
|
||||
private static (AppSettings Settings, WorkspaceSettingsRows Rows, Func<int> Saves) WorkspaceRows(FakeWorkspace? workspace = null, Func<Task>? move = null,
|
||||
Func<bool>? isMoving = null)
|
||||
Func<bool>? isMoving = null, Func<bool>? unfinished = null, Func<Task>? resume = null)
|
||||
{
|
||||
var settings = new AppSettings();
|
||||
var saves = 0;
|
||||
@@ -721,6 +769,8 @@ public sealed class SettingsLogicTests
|
||||
Notify = (title, message, isError) => workspace.Notices.Add((title, message, isError)),
|
||||
Move = move,
|
||||
IsMoving = isMoving ?? (() => false),
|
||||
HasUnfinishedMove = unfinished is null ? null : _ => Task.FromResult(unfinished()),
|
||||
ResumeMove = resume,
|
||||
};
|
||||
var rows = new WorkspaceSettingsRows(settings, () => saves++, () => @"C:\Users\me\AppData\Local\Chronos\workspace", () => { }, () => Task.CompletedTask, services);
|
||||
return (settings, rows, () => saves);
|
||||
|
||||
Reference in new issue
Block a user