feat(workspace): clean-up of media, size limit and workspace trash
Phase 5c P4. The workspace no longer grows without bound: a daily workspace-cleanup system schedule (04:30, catch-up) removes the media of projects in step with their home that were not opened for Clean after, and the size limit removes the least recently used after each copy. Each project kept is logged with its reason (open in Edit, not in step, home offline, jobs pending, renders not sent, unreadable, just copied). - WorkspaceCleaner: cleans under the project's lease, re-checking every condition; the originals the home no longer holds go to the workspace trash, never away. The media index is marked Cleaned, so the project reads as MediaRemoved and opening it copies the media again. - WorkspaceTrash: lists entries with a fingerprint, and empties only the plan the user confirmed (refused when the trash changed since). - Trash dialog view model and view: Erase is enabled only after the user types the number of entries. - Removing a copy counts the unsent renders and the last originals. Send first queues the renders' sending and refuses the removal until they are sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e1c67f531
commit
f86630c77a
19 files changed
+1595
-44
No files matched your search
@@ -30,9 +30,9 @@ public sealed class SchedulesViewModelTests
|
||||
using var vm = await fx.ViewModelAsync();
|
||||
|
||||
Assert.True(vm.IsRunning && vm.IsLoaded && vm.HasRows, "the schedules are listed");
|
||||
Assert.SequenceEqual(["Archive scan", "Index backup", "Housekeeping"], vm.Rows.Select(r => r.Name));
|
||||
Assert.SequenceEqual(["Every 10 minutes", "Every day", "Daily at " + ScheduleText.Time(new TimeOnly(4, 0))], vm.Rows.Select(r => r.WhenText));
|
||||
Assert.SequenceEqual(["Archive scan", "Index backup", "Clean-up"], vm.Rows.Select(r => r.ActionText));
|
||||
Assert.SequenceEqual(["Archive scan", "Index backup", "Housekeeping", "Workspace clean-up"], vm.Rows.Select(r => r.Name));
|
||||
Assert.SequenceEqual(["Every 10 minutes", "Every day", "Daily at " + ScheduleText.Time(new TimeOnly(4, 0)), "Daily at " + ScheduleText.Time(new TimeOnly(4, 30))], vm.Rows.Select(r => r.WhenText));
|
||||
Assert.SequenceEqual(["Archive scan", "Index backup", "Clean-up", "Clean-up"], vm.Rows.Select(r => r.ActionText));
|
||||
Assert.True(vm.Rows.All(r => r.IsSystem && r.IsEnabled && r.LastText == "never run" && r.LastKind == StatusKind.Offline), "nothing ran yet");
|
||||
// The scan's next run is ten minutes away, today.
|
||||
Assert.Equal(ScheduleText.Moment(fx.Clock.Now.AddMinutes(10)), vm.Rows[0].NextText);
|
||||
@@ -41,9 +41,9 @@ public sealed class SchedulesViewModelTests
|
||||
// A schedule the user creates joins the list after the system ones.
|
||||
var created = await fx.Scheduler!.CreateAsync(new CreateScheduleRequest("Weekly check", ScheduleActions.Verify, new RecurrenceDto("weekly", Time: "02:30", Days: ["mon", "thu"])), null);
|
||||
Assert.Null(created.Problem);
|
||||
Assert.Equal("Weekly check", vm.Rows[3].Name);
|
||||
Assert.Equal("Weekly check", vm.Rows[4].Name);
|
||||
Assert.Equal(ScheduleText.DayShort(DayOfWeek.Monday) + ", " + ScheduleText.DayShort(DayOfWeek.Thursday) + " at " + ScheduleText.Time(new TimeOnly(2, 30)),
|
||||
vm.Rows[3].WhenText);
|
||||
vm.Rows[4].WhenText);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -141,11 +141,11 @@ public sealed class SchedulesViewModelTests
|
||||
Assert.False(scan.DeleteCommand.CanExecute(null));
|
||||
Assert.False(mine.ResetCommand.CanExecute(null));
|
||||
await vm.DeleteAsync(mine);
|
||||
Assert.Count(4, vm.Rows);
|
||||
Assert.Count(5, vm.Rows);
|
||||
answer = true;
|
||||
vm.Selected = mine;
|
||||
await vm.DeleteAsync(mine);
|
||||
Assert.Count(3, vm.Rows);
|
||||
Assert.Count(4, vm.Rows);
|
||||
Assert.Null(vm.Selected);
|
||||
Assert.Null(await fx.Db.Schedules.GetAsync(mine.Id));
|
||||
|
||||
@@ -172,7 +172,7 @@ public sealed class SchedulesViewModelTests
|
||||
|
||||
await vm.DeleteAsync(mine);
|
||||
Assert.SequenceEqual([Loc.L("Jobs.Schedule.Failed")], toasts);
|
||||
Assert.Count(4, vm.Rows);
|
||||
Assert.Count(5, vm.Rows);
|
||||
Assert.Contains(mine, vm.Rows);
|
||||
Assert.NotNull(await fx.Db.Schedules.GetAsync(mine.Id));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user