feat(app): Convert sequences from the Archive manager and the Library, with Undo after a Replace

Owner review 2, R7 asks for mass conversion after import on the desktop too, with a choice at
every run between Replace and New sequence. The desktop now uses the engine's conversion, the
same plan and job as the web panel.

- Convert... in the Archive manager's mass operations (the set) and the Library's mass bar (the
  selection of one archive; server cards are left out, two archives are refused with their own
  reason). The dialog has the format (JPEG, TIFF 16-bit, Linear DNG, the archival default), a
  JPEG's quality (1-100, 95) and the mode, which starts unchosen at every open: Apply waits for
  it. Each choice has a tooltip that says what becomes of the originals.
- The dry run stays in the dialog and follows the choices: each sequence with its photos and
  sizes before and after, the photos that stay as they are with why, the sequences left as they
  are (busy, offline, unreadable), a summary and the free space line; a volume without the space
  blocks Apply. The mode does not change what converts, so choosing it plans nothing again.
- Apply asks to type the number of photos a Replace replaces, then queues the convert job of
  exactly the plan shown; New sequence leaves the originals as they are and asks nothing.
- When a Replace job ends, its toast offers Undo: for each sequence it converted, the newest
  Replaced trash entry made while it ran goes back (a sequence changed since gets its originals
  as a new sequence). Undo runs once and never from the Windows notification.
- The Library and the Archive screen read the sequences again after a conversion; --capture
  renders archive-convert from a sample plan.
- Strings in en and it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 275469284f895fc92e2569339809e18bf59d1d6a)
(cherry picked from commit 76ba41f58983275ae4b1478edd403efb11da7c79)
This commit is contained in:
Alby96 committed 2026-10-27 22:02:04 +01:00
1 parent 2143a093a2
commit a1c1c21ebd
25 files changed
+1409 -19

No files matched your search

@@ -11,6 +11,7 @@ using Chronos.App.Sections;
using Chronos.App.Shell;
using Chronos.App.Tests.Windows;
using Chronos.Core.Archiving;
using Chronos.Core.Conversion;
using Chronos.Core.Localization;
using Chronos.Testing;
using Chronos.Ui.Controls;
@@ -106,6 +107,21 @@ public sealed class ArchiveScreenSmokeTests
AssertEveryButtonIsNamed(app);
reorganize.CloseCommand.Execute(null);
await ArchiveScenes.ShowAsync(app.Shell, "convert");
var convert = Assert.NotNull(archive.Dialog as ConvertDialogViewModel);
Assert.Equal(ConvertMode.NewSequence, convert.Mode);
Assert.Count(6, convert.Rows, "the dry run lists the sequences, each with what converts or why it does not");
Assert.True(convert.IsSpaceFine);
Assert.Null(convert.ErrorText);
await app.ExpectAsync<ArchiveView>("archive-convert");
Assert.True(ButtonFor(app, convert.ApplyCommand).IsEnabled, "Apply follows the dry run and the mode chosen");
Assert.True(ButtonFor(app, convert.CloseCommand).IsDefault, "Enter takes the safe way out");
Assert.True(TextFor(app, convert.SpaceText!).IsVisible, "the free space line shows");
foreach (var choice in app.FindAll<RadioButton>().Where(r => r.IsVisible && IsInArchive(r))) Assert.NotNull(choice.ToolTip, "every choice says what it does");
AssertNoErrorShown(app);
AssertEveryButtonIsNamed(app);
convert.CloseCommand.Execute(null);
archive.RetagSetCommand.Execute(null);
var retag = Assert.NotNull(archive.Dialog as RetagDialogViewModel);
retag.Add.Text = "sunset";
@@ -144,6 +160,13 @@ public sealed class ArchiveScreenSmokeTests
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, folder.From).FlowDirection, "a folder before the move reads left to right");
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, folder.To).FlowDirection, "a folder after the move reads left to right");
reorganize.CloseCommand.Execute(null);
await ArchiveScenes.ShowAsync(app.Shell, "convert");
var convert = Assert.NotNull(archive.Dialog as ConvertDialogViewModel);
await app.ExpectAsync<ArchiveView>("archive-convert-ar");
var untitled = Assert.NotNull(convert.Rows.FirstOrDefault(r => r.IsNamePath), "a sequence without a title is named by its folder");
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, untitled.Name).FlowDirection, "its folder reads left to right");
convert.CloseCommand.Execute(null);
}
finally
{