From a1c1c21ebd95a78f0a3f99f0725f9f54a4df341a Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 27 Oct 2026 16:30:36 +0100 Subject: [PATCH] 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 (cherry picked from commit 275469284f895fc92e2569339809e18bf59d1d6a) (cherry picked from commit 76ba41f58983275ae4b1478edd403efb11da7c79) --- docs/ARCHITECTURE.md | 2 +- i18n/en/Archive.resx | 28 ++ i18n/en/Library.resx | 2 + i18n/en/Tooltips.resx | 15 + i18n/it/Archive.it.resx | 27 ++ i18n/it/Library.it.resx | 2 + i18n/it/Tooltips.it.resx | 15 + src/Chronos.App/Archive/ArchiveDialogs.xaml | 95 ++++- src/Chronos.App/Archive/ArchiveScenes.cs | 14 +- .../Archive/ConvertDialogViewModel.cs | 345 ++++++++++++++++ src/Chronos.App/Archive/ConvertPlans.cs | 130 ++++++ src/Chronos.App/Archive/ConvertUndo.cs | 171 ++++++++ src/Chronos.App/Archive/SampleReports.cs | 31 +- src/Chronos.App/Jobs/JobNotices.cs | 2 +- src/Chronos.App/Library/MassActions.cs | 8 +- src/Chronos.App/Sections/ArchiveView.xaml | 4 +- src/Chronos.App/Sections/ArchiveViewModel.cs | 22 +- src/Chronos.App/Sections/JobsViewModel.cs | 5 +- src/Chronos.App/Sections/LibraryView.xaml | 3 +- src/Chronos.App/Sections/LibraryViewModel.cs | 32 +- .../Archive/ArchiveScreenSmokeTests.cs | 23 ++ .../Archive/ConvertDialogTests.cs | 383 ++++++++++++++++++ .../Chronos.App.Tests/Jobs/JobNoticesTests.cs | 1 + .../Library/MassActionsTests.cs | 24 +- .../Windows/ShellNotificationTests.cs | 44 ++ 25 files changed, 1409 insertions(+), 19 deletions(-) create mode 100644 src/Chronos.App/Archive/ConvertDialogViewModel.cs create mode 100644 src/Chronos.App/Archive/ConvertPlans.cs create mode 100644 src/Chronos.App/Archive/ConvertUndo.cs create mode 100644 tests/Chronos.App.Tests/Archive/ConvertDialogTests.cs diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index a7bc25c0..a46f3f7c 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -72,7 +72,7 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | `Library` | Filter, facets, pager, timeline, saved views, quick and mass actions, remote cards and thumbnails, thumbnail cache, list export | | `Editor` | `EditorSession` (project, undo/redo, saving, merges), `ISequenceSource` (`LocalSequenceSource`, `RemoteSequenceSource`), the steps of the Edit path (`EditPath`: their order, each step's state, the step of each finding, the memory of the step shown; tabs Analysis, Frames, Exposure, Motion, Camera, Time, Stack, Export), `PreviewRenderer`, `ExportPlanner`, `ExportSync`, `SavedCopies`, `SequenceJobs`, `ProjectFiles` (save and open `.chronos` project files) | | `Import` | `CardPool` (inserted cards, remembered cards, folders), camera profiles, plans and choices, destinations (archive, folder, server through `ServerImportSink`), card actions (verified delete, format, eject) | -| `Archive` | `CurrentArchive`, `ArchiveTree`, figures for the charts, maintenance reports, Reorganize (`ReorganizeDialogViewModel`: folder, file and title templates each with its switch, the dry run, Apply queues the `move` job of that plan; `ReorganizePlans`: each template's check, the plan as rows and a summary; `ReorganizeOffer`: per archive, the templates Settings › Archive's toast offers, joined while that archive's toast is up), retag, delete and trash dialogs (`SequenceDeletion`, `DeletePlans`, `TrashEmptyPlans`: Empty… behind a dry run and a typed confirmation), `ArchiveFailures` | +| `Archive` | `CurrentArchive`, `ArchiveTree`, figures for the charts, maintenance reports, Reorganize (`ReorganizeDialogViewModel`: folder, file and title templates each with its switch, the dry run, Apply queues the `move` job of that plan; `ReorganizePlans`: each template's check, the plan as rows and a summary; `ReorganizeOffer`: per archive, the templates Settings › Archive's toast offers, joined while that archive's toast is up), Convert (`ConvertDialogViewModel`: format, JPEG quality and a mode chosen at every run, the dry run, Apply behind a typed confirmation for Replace queues the `convert` job of that plan; `ConvertPlans`: the plan as rows, a summary, the space line and the Replace confirmation; `ConvertUndo`: the Undo of a finished Replace, which restores its `Replaced` trash entries), retag, delete and trash dialogs (`SequenceDeletion`, `DeletePlans`, `TrashEmptyPlans`: Empty… behind a dry run and a typed confirmation), `ArchiveFailures` | | `Server` | `ServerSession`, `ConnectFlow` (trust on first use), `SyncHost` (sync engine, agent, metered hold, editor connections, Export Sync), sync table, `RemoteSequenceApi` | | `Jobs`, `Settings`, `About` | Job list and buffering, `JobNotices` (which job endings raise a toast; `JobEndings` lets a batch speak once); the schedules of Jobs › Scheduled (`DesktopScheduleHost`: the desktop's `IScheduleHost` and its system schedules `archive-scan`, `index-backup`, `housekeeping`; `CacheTrimStep`, the host's clean-up step; `SchedulesViewModel`, `ScheduleRowViewModel`, `ScheduleEditorViewModel` and `ScheduleDialogs.xaml`, the in-window editor; `ScheduleText`); settings rows (`LogSettingsRows`: Advanced's log rows), encoder and format inventories, `ProcessingTuning` (Settings › Rendering and Analysis applied to each job: parallelism, memory budget, quality), `InterfacePriority`, language catalog, naming preview; `AboutViewModel` (owned by the shell, not a section: Settings › About, the update notice of Settings › Updates and the update check on start), update check and download | | `Infrastructure` | `AppServices` (composition root; `SequenceReorganized`, raised after each Reorganize step, reloads an editor open on that sequence), `AppSettings`, `AppLogging` (Settings › Advanced › Logs applied to the log files from their first line, a launch that only hands over included, and at every save), `AppEnvironment` (installed or portable), `AppClock` (today's date, frozen by `--capture`), `StartWithWindows` (this copy's sign-in entry), `UiLanguage`, `LiveRegion`, `RenderNodeHost`, `DiagnosticsBundle`, `ShellActions` (BRIEF §8.6), `SingleInstance` (one Chronos per data folder; a later launch hands its file over a named pipe, or waits for a closing one to exit and starts in its place), device monitor | diff --git a/i18n/en/Archive.resx b/i18n/en/Archive.resx index 2a693e3c..a2399630 100644 --- a/i18n/en/Archive.resx +++ b/i18n/en/Archive.resx @@ -15,8 +15,10 @@ Wait until the changes are applied.long The set is empty: change the selection or the filter.long Nothing would change.long + Choose Replace or New sequence.long Turn on at least one template.long The archive must be online and writable.long + Nothing to convert: every photo is skipped or every sequence is blocked.long Wait for the dry run.long Wait until the archive is read.long A search is running; cancel it or wait.long @@ -39,15 +41,40 @@ The sequence changed after the plan; review the plan again.long: why a sequence is not converted in a conversion dry run The archive is offline or read-only.long: why a sequence is not converted in a conversion dry run The sequence file cannot be read.long: why a sequence is not converted in a conversion dry run + {0:N0} sequence converted + {0:N0} sequences converted + Format + Convert {0:N0} sequence + Convert {0:N0} sequences + Convert {0}long: dialog heading; {0} archive name + Mode + New sequence + Quality + Replace + Replace the photos of {0:N0} sequence?long + Replace the photos of {0:N0} sequences?long + {0} ({1}) are replaced by their conversion to {2}; the originals move to the archive's trash and can be restored until it is emptied.long: {0} photos, e.g. "120 photos"; {1} their size; {2} the format, e.g. "Linear DNG" + {0} → {1}sizes before and after a conversion Missing photos stay as they are.long: why photos are not converted in a conversion dry run Photos of a format this computer cannot read at full resolution stay as they are.long: why photos are not converted in a conversion dry run Photos read only from their embedded preview here stay as they are.long: why photos are not converted in a conversion dry run Photos already in this format stay as they are.long: why photos are not converted in a conversion dry run Unreadable photos stay as they are.long: why photos are not converted in a conversion dry run Photos never verified stay as they are; verify the sequence first.long: why photos are not converted in a conversion dry run + {0:N0} skippedphotos a conversion leaves as they are + {0:N0} skippedphotos a conversion leaves as they are Needs {0}, free {1}long: free space line of a conversion dry run; {0} and {1} sizes Needs {0}, only {1} free: free some space first.long: free space line of a conversion dry run; {0} and {1} sizes Needs {0}; the free space cannot be measured.long: free space line of a conversion dry run; {0} size + JPEGinvariant + Linear DNG + TIFF 16-bit + The originals could not come backlong + The replaced originals are no longer in the trash.long + Originals back in {0:N0} sequencelong + Originals back in {0:N0} sequenceslong + {0:N0} sequence had changed since: its originals came back as a new sequence.long + {0:N0} sequences had changed since: their originals came back as new sequences.long Folder to copy into the archivelong Move to trash Not moved: {0} · {1}long @@ -278,6 +305,7 @@ {0:N0} sequences · all Analyse Clear filter + Convert… Delete… Export CSV Set filter diff --git a/i18n/en/Library.resx b/i18n/en/Library.resx index 6bc44f48..8467f1a1 100644 --- a/i18n/en/Library.resx +++ b/i18n/en/Library.resx @@ -6,6 +6,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Analyse Clear selection + Convert… Delete… Download Export list @@ -32,6 +33,7 @@ The selected sequences have nothing to fetch from the server.long The server already has what the selected sequences hold.long Reorganize works on the sequences of one archive at a time.long + Convert works on the sequences of one archive at a time.long Only for sequences on this PC; the selection lives on the server.long A transfer of this sequence is already under way.long Clear filters diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx index 63103f3b..b1311411 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -27,6 +27,18 @@ Show every sequence of the selection again Close without changing anything · Esc Hide the sequences of this year + Queue a job that converts copies into new sequences · pause and resume it in Jobs + Type the number of photos to confirm, then queue a job that replaces them with their conversion · pause and resume it in Jobs + Linear DNG, 16-bit and lossless · read by every raw editor; the choice for archiving + 8-bit JPEG at the quality below · the smallest files; some detail is lost + The converted copies go into a new sequence beside each one; the originals stay as they are + The converted files take the photos' place in their sequences; the originals go to the archive's trash, restorable until it is emptied + The sequences whose photos are replaced + JPEG quality from 1 to 100 · 95 keeps fine detail; lower makes smaller files + Replace {0:N0} photo with its conversion; type the number above first + Replace {0:N0} photos with their conversion; type the number above first + 16-bit TIFF compressed without loss · large files every editor opens + Put the originals back from the trash in place of their conversions Move {0:N0} sequence to the trash; type the number above first Move {0:N0} sequences to the trash; type the number above first Change nothing @@ -82,6 +94,7 @@ Incremental scan: new, changed and removed files by modification time and size The selected years and sequences (all when nothing is selected), narrowed by camera, status or tag Run the deep analysis on every sequence in the set + Convert the photos of the set to JPEG, TIFF or DNG · dry run first, then a job Move the set to the archive's trash · shows the dry run, then asks you to type to confirm Export the set as CSV: one row per sequence Generate or refresh proxies @@ -469,6 +482,8 @@ Table with sortable columns Deep analysis of {0:N0} sequence on this PC · runs as one job Deep analysis of {0:N0} sequences on this PC · runs as one job + Convert the photos of {0:N0} sequence to JPEG, TIFF or DNG · dry run first, then a job + Convert the photos of {0:N0} sequences of their archive to JPEG, TIFF or DNG · dry run first, then a job Move {0:N0} sequence to its archive's trash · shows the dry run, then asks you to type to confirm Move {0:N0} sequences to their archive's trash · shows the dry run, then asks you to type to confirm Fetch what {0:N0} sequence lacks here (originals or renders) from the server · runs as a transfer job diff --git a/i18n/it/Archive.it.resx b/i18n/it/Archive.it.resx index 049a0213..9038136a 100644 --- a/i18n/it/Archive.it.resx +++ b/i18n/it/Archive.it.resx @@ -15,8 +15,10 @@ Attendi che le modifiche siano applicate. La selezione è vuota: cambia la selezione o il filtro. Non cambierebbe nulla. + Scegli Sostituisci o Nuova sequenza. Attiva almeno un modello. L'archivio deve essere raggiungibile e scrivibile. + Niente da convertire: ogni foto è esclusa o ogni sequenza è bloccata. Attendi la simulazione. Attendi la lettura dell'archivio. Una ricerca è in corso: annullala o attendi. @@ -36,15 +38,39 @@ La sequenza è cambiata dopo il piano; rivedi il piano. L'archivio non è raggiungibile o è di sola lettura. Il file della sequenza non si può leggere. + {0:N0} sequenza convertita + {0:N0} sequenze convertite + Formato + Converti {0:N0} sequenza + Converti {0:N0} sequenze + Converti {0} + Modalità + Nuova sequenza + Qualità + Sostituisci + Sostituire le foto di {0:N0} sequenza? + Sostituire le foto di {0:N0} sequenze? + {0} ({1}) vengono sostituite dalla loro conversione in {2}; gli originali vanno nel cestino dell'archivio e si possono ripristinare finché non viene svuotato. + {0} → {1} Le foto mancanti restano come sono. Le foto di un formato che questo computer non legge a piena risoluzione restano come sono. Le foto lette qui solo dalla loro anteprima incorporata restano come sono. Le foto già in questo formato restano come sono. Le foto illeggibili restano come sono. Le foto mai verificate restano come sono; verifica prima la sequenza. + {0:N0} esclusa + {0:N0} escluse Servono {0}, liberi {1} Servono {0}, liberi solo {1}: libera prima dello spazio. Servono {0}; lo spazio libero non si può misurare. + DNG lineare + TIFF 16 bit + Gli originali non sono potuti tornare + Gli originali sostituiti non sono più nel cestino. + Originali ripristinati in {0:N0} sequenza + Originali ripristinati in {0:N0} sequenze + {0:N0} sequenza era cambiata nel frattempo: i suoi originali sono tornati come nuova sequenza. + {0:N0} sequenze erano cambiate nel frattempo: i loro originali sono tornati come nuove sequenze. Cartella da copiare nell'archivio Sposta nel cestino Non spostata: {0} · {1} @@ -272,6 +298,7 @@ {0:N0} sequenze · tutte Analizza Togli filtro + Converti… Elimina… Esporta CSV Filtro selezione diff --git a/i18n/it/Library.it.resx b/i18n/it/Library.it.resx index 503df244..8dd01b6b 100644 --- a/i18n/it/Library.it.resx +++ b/i18n/it/Library.it.resx @@ -6,6 +6,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Analizza Deseleziona tutto + Converti… Elimina… Scarica Esporta elenco @@ -32,6 +33,7 @@ Le sequenze selezionate non hanno nulla da ricevere dal server. Il server ha già tutto ciò che contengono le sequenze selezionate. La riorganizzazione agisce sulle sequenze di un solo archivio alla volta. + La conversione agisce sulle sequenze di un solo archivio alla volta. Solo per sequenze su questo PC; la selezione si trova sul server. Un trasferimento di questa sequenza è già in corso. Azzera i filtri diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx index c5ee663e..d323cbd0 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -27,6 +27,18 @@ Mostra di nuovo tutte le sequenze della selezione Chiudi senza modificare nulla · Esc Nascondi le sequenze di quest'anno + Metti in coda un'attività che converte copie in nuove sequenze · mettila in pausa e riprendila in Attività + Digita il numero di foto per confermare, poi metti in coda un'attività che le sostituisce con la loro conversione · mettila in pausa e riprendila in Attività + DNG lineare, 16 bit e senza perdita · letto da ogni editor di RAW; la scelta per l'archivio + JPEG a 8 bit con la qualità indicata sotto · i file più piccoli; si perde un po' di dettaglio + Le copie convertite vanno in una nuova sequenza accanto a ciascuna; gli originali restano come sono + I file convertiti prendono il posto delle foto nelle loro sequenze; gli originali vanno nel cestino dell'archivio, ripristinabili finché non viene svuotato + Le sequenze di cui vengono sostituite le foto + Qualità JPEG da 1 a 100 · 95 conserva i dettagli fini; valori più bassi danno file più piccoli + Sostituisci {0:N0} foto con la sua conversione; prima digita il numero qui sopra + Sostituisci {0:N0} foto con la loro conversione; prima digita il numero qui sopra + TIFF a 16 bit compresso senza perdita · file grandi che ogni editor apre + Rimetti gli originali dal cestino al posto delle loro conversioni Sposta {0:N0} sequenza nel cestino; prima digita il numero indicato Sposta {0:N0} sequenze nel cestino; prima digita il numero indicato Non cambiare nulla @@ -82,6 +94,7 @@ Scansione incrementale: file nuovi, modificati e rimossi per data e dimensione Anni e sequenze selezionati (tutti se nulla è selezionato), ristretti per fotocamera, stato o tag Esegui l'analisi profonda su ogni sequenza della selezione + Converti le foto della selezione in JPEG, TIFF o DNG · prima la simulazione, poi un'attività Sposta la selezione nel cestino dell'archivio · mostra prima la simulazione, poi chiede di digitare per confermare Esporta la selezione in CSV: una riga per sequenza Crea o aggiorna i proxy @@ -468,6 +481,8 @@ Tabella con colonne ordinabili Analisi approfondita di {0:N0} sequenza su questo PC · un'unica attività Analisi approfondita di {0:N0} sequenze su questo PC · un'unica attività + Converti le foto di {0:N0} sequenza in JPEG, TIFF o DNG · prima la simulazione, poi un'attività + Converti le foto di {0:N0} sequenze del loro archivio in JPEG, TIFF o DNG · prima la simulazione, poi un'attività Sposta {0:N0} sequenza nel cestino del suo archivio · mostra prima la simulazione, poi chiede di digitare per confermare Sposta {0:N0} sequenze nel cestino del loro archivio · mostra prima la simulazione, poi chiede di digitare per confermare Ricevi dal server ciò che manca qui a {0:N0} sequenza (originali o render) · come attività di trasferimento diff --git a/src/Chronos.App/Archive/ArchiveDialogs.xaml b/src/Chronos.App/Archive/ArchiveDialogs.xaml index 3411efe6..72791fdb 100644 --- a/src/Chronos.App/Archive/ArchiveDialogs.xaml +++ b/src/Chronos.App/Archive/ArchiveDialogs.xaml @@ -6,7 +6,7 @@ xmlns:infra="clr-namespace:Chronos.App.Infrastructure" xmlns:shell="clr-namespace:Chronos.App.Shell"> - +