fix(copies): close the fifth verification round of owner review 6

The metered hold now records the jobs it paused in the index and forgets
any job the user pauses, resumes, retries or cancels, so it never resumes
a pause of the user's and still resumes its own after a restart.

Drop... reports why its dry run is blocked instead of asking first, and
dropping the version Main uses lets Main use the version that stays,
with its hero and keyframes. That version reads "In Main".

Merges:
- A re-plan no longer hashes the other's photos again.
- A resumed merge verifies photos flagged damaged while it waited.
- A merge is blocked while the other's folder holds photos the index
  has not read; this is checked again under the lease before the trash.
- Choose each offers Keep both, Kept and Other, and blocks until every
  differing photo is chosen.
- Classes are named by role.

The Compare dialog:
- Its headings stay over their columns.
- The Projects part scrolls.
- Every confirmation line carries its own prefix, and a merge's facts
  carry none.
- A server card in a match offers Compare... alone.

The Italian strings follow the glossary.

Finding 9 (a local drop counting 0 photos) is not reproduced; a test now
keeps the count at 2.

Refs #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-17 20:51:23 +01:00
1 parent 2c06e7ac2b
commit bf7701d279
159 files changed
+1759 -126

No files matched your search

@@ -287,10 +287,64 @@ public sealed class CopyTextTests
[
Loc.L("Server.Copies.Plan.OnThisPc"),
" " + Loc.L("Server.Copies.Confirm.LastCopy", "IMG_0002.JPG"),
" IMG_0001.JPG",
// A replaced version under an "Only copy:" line carries its own prefix (owner review 6, verification round 5).
" " + Loc.L("Server.Copies.Confirm.Replaced", "IMG_0001.JPG"),
Loc.L("Server.Copies.Plan.OnServer", "Studio NAS"),
" IMG_0003.JPG",
" " + Loc.L("Server.Copies.Confirm.Replaced", "IMG_0003.JPG"),
], lines);
// To trash… and Delete on server…: the only copies first, the photos held elsewhere each with their prefix, once.
var trash = CopyDialogViewModel.Lines(lasts, ["IMG_0002.JPG", "IMG_0001.JPG", "IMG_0001.JPG"]).Split(Environment.NewLine);
Assert.SequenceEqual(
[
Loc.L("Server.Copies.Confirm.LastCopy", "IMG_0002.JPG"),
Loc.L("Server.Copies.Confirm.Elsewhere", "IMG_0001.JPG"),
], trash);
// A merge's facts are not photos held elsewhere: they carry no prefix, after the only copies.
var facts = CopyDialogViewModel.Lines(lasts, ["1 render moved"], elsewhere: false).Split(Environment.NewLine);
Assert.SequenceEqual(
[
Loc.L("Server.Copies.Confirm.LastCopy", "IMG_0002.JPG"),
"1 render moved",
], facts);
}
[Test]
public void AMergeNamesItsSidesByRoleAndAsksForAVersionOfEachDifferentPhoto()
{
// Class words: by role once a sequence is kept, oriented from the kept one; by place before.
var onlyHere = new CopyClassRow(new PhotoClassTotal(PhotoClass.OnlyHere, 38, 570_000_000, 0), CopyPhotoPolicy.Union, isMerge: true);
Assert.Equal(Loc.L("Server.Copies.Class.OnlyKept"), onlyHere.Text);
var raised = new List<string?>();
onlyHere.PropertyChanged += (_, e) => raised.Add(e.PropertyName);
onlyHere.Swapped = true;
Assert.Equal(Loc.L("Server.Copies.Class.OnlyOther"), onlyHere.Text);
Assert.Contains(nameof(CopyClassRow.Text), raised);
raised.Clear();
onlyHere.Places = ("Main archive", "Studio archive");
Assert.Equal(Loc.L("Server.Copies.Class.OnlyHere"), onlyHere.Text);
Assert.Contains(nameof(CopyClassRow.Text), raised);
Assert.Equal(Loc.L("Server.Copies.Class.DeletedOther"), CopyText.Class(PhotoClass.DeletedThere, merge: true));
Assert.Equal(Loc.L("Server.Copies.Class.Differs"), CopyText.Class(PhotoClass.Differs, merge: true));
Assert.Equal(Loc.L("Server.Copies.Class.OnlyHere"), new CopyClassRow(new PhotoClassTotal(PhotoClass.OnlyHere, 1, 1, 0)).Text);
// Choose each in a merge: its own tooltip, no Leave, and the unchosen block leads to the photos.
Assert.Equal(Loc.L("Tooltips.Server.Copies.Class.Differs.ChooseMerge"),
CopyText.ClassToolTip(PhotoClass.Differs, CopyPhotoPolicy.ChoosePerPhoto, isMerge: true));
Assert.Equal(Loc.L("Tooltips.Server.Copies.Class.Differs.Choose"), CopyText.ClassToolTip(PhotoClass.Differs, CopyPhotoPolicy.ChoosePerPhoto));
Assert.SequenceEqual([PhotoChoice.KeepBoth, PhotoChoice.TakeHere, PhotoChoice.TakeThere],
CopyDialogViewModel.VersionChoices(merge: true).Select(o => o.Value));
Assert.Contains(PhotoChoice.Leave, CopyDialogViewModel.VersionChoices(merge: false).Select(o => o.Value));
Assert.True(CopyText.HasChoose(CopyBlock.PhotosUnchosen));
// A version choice not made yet is read out as such, not as Leave.
var photo = new ComparedPhoto(PhotoClass.Differs, "k",
new CopyPhotoInput(Guid.NewGuid(), 0, "IMG_0004.JPG", "a", 10, null, false), new CopyPhotoInput(Guid.NewGuid(), 0, "IMG_0004.JPG", "b", 12, null, false),
1, 1, 10);
var row = new CopyPhotoRow(photo, isMerge: true, canBring: false, canChoose: true, CopyDialogViewModel.VersionChoices(true), null, () => { }, null);
Assert.Equal(Loc.L("Server.Copies.ControlFor", "IMG_0004.JPG", Loc.L("Server.Copies.Version.None")), row.ChoiceAccessibleName);
Assert.False(row.InMain);
}
[Test]