feat(app): complete the Library: timeline, saved views, quick and mass actions, remote cards
The Library gets a third layout (year bands of photos per month over the card grid; a month narrows to its year and scrolls to it), saved views stored as app-scope settings rows, hover quick actions on cards and rows (open, analyse, render the sequence's preset, sync), the full mass actions bar (analyse, proxies, verify, tags, rating, move, upload, download, delete into the trash, CSV) with each button's reason when it cannot run, and, while signed in, the server's sequences without a local copy as remote cards filterable by origin. Delete shows the engine's dry run behind a typed confirmation and offers Undo; the Archive manager gets Delete… and a Trash dialog that restores sequences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
27 files changed
+2582
-422
No files matched your search
@@ -25,8 +25,9 @@ namespace Titano.App.Sections;
|
||||
/// <summary>
|
||||
/// Archive manager (BRIEF §12.5, Archive.html): the archive's tree (years, sequences) with its availability, its
|
||||
/// figures and charts, mass operations on the selected and filtered set (analyse, proxies, thumbnails, verify, rename,
|
||||
/// move, retag, CSV), and the operations on the whole archive as jobs (scan, rebuild with its dialog, verify,
|
||||
/// maintenance), plus the maintenance view: index health, duplicates and orphans with safe fixes, recent runs. The
|
||||
/// move, retag, CSV, delete into the trash), and the operations on the whole archive as jobs (scan, rebuild with its
|
||||
/// dialog, verify, maintenance), the trash, plus the maintenance view: index health, duplicates and orphans with safe
|
||||
/// fixes, recent runs. The
|
||||
/// tree selection is only ever changed by the user: reloads and expanding keep it.
|
||||
/// </summary>
|
||||
public sealed class ArchiveViewModel : SectionViewModel
|
||||
@@ -96,6 +97,8 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
MoveSetCommand = new AsyncRelayCommand(() => OpenRenameDialogAsync(RenameMode.Folders), () => HasSet() && IsOnline());
|
||||
RetagSetCommand = new RelayCommand(OpenRetag, () => HasSet() && IsOnline());
|
||||
ExportSetCommand = new AsyncRelayCommand(ExportAsync, HasSet);
|
||||
DeleteSetCommand = new AsyncRelayCommand(() => SequenceDeletion.RunAsync(Shell, [.. Set().Select(s => s.Id)]), () => HasSet() && IsOnline());
|
||||
TrashCommand = new AsyncRelayCommand(OpenTrashAsync, () => _archive is not null);
|
||||
|
||||
FindDuplicatesCommand = new AsyncRelayCommand(FindDuplicatesAsync, () => _archive is not null && _search is null);
|
||||
FindOrphansCommand = new AsyncRelayCommand(FindOrphansAsync, () => IsOnline() && _search is null);
|
||||
@@ -161,6 +164,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public string RenameSetToolTip => WhenSet("Tooltips.Archive.SetRename", needsOnline: true);
|
||||
public string MoveSetToolTip => WhenSet("Tooltips.Archive.SetMove", needsOnline: true);
|
||||
public string RetagSetToolTip => WhenSet("Tooltips.Archive.SetRetag", needsOnline: true);
|
||||
public string DeleteSetToolTip => WhenSet("Tooltips.Archive.SetDelete", needsOnline: true);
|
||||
|
||||
public ICommand ScanCommand { get; }
|
||||
public ICommand RebuildCommand { get; }
|
||||
@@ -177,6 +181,9 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public ICommand RelinkCommand { get; }
|
||||
public ICommand HistoryCommand { get; }
|
||||
|
||||
/// <summary>"Maintenance ▾ › Trash…": the sequences deleted from this archive, each restorable.</summary>
|
||||
public ICommand TrashCommand { get; }
|
||||
|
||||
// ---------------- Overview ----------------
|
||||
|
||||
public ObservableCollection<ArchiveTreeRowViewModel> TreeRows { get; } = [];
|
||||
@@ -239,6 +246,9 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public ICommand RetagSetCommand { get; }
|
||||
public ICommand ExportSetCommand { get; }
|
||||
|
||||
/// <summary>Moves the set to the archive's trash after its dry run and a typed confirmation.</summary>
|
||||
public ICommand DeleteSetCommand { get; }
|
||||
|
||||
/// <summary>The view reports the rows the user selected; the list's own clearing while rows are rebuilt is not a choice.</summary>
|
||||
public void SetSelection(IEnumerable<ArchiveTreeRowViewModel> rows)
|
||||
{
|
||||
@@ -310,7 +320,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
|
||||
// ---------------- Dialogs ----------------
|
||||
|
||||
/// <summary>The open in-window dialog (rebuild, rename, retag); null when none.</summary>
|
||||
/// <summary>The open in-window dialog (rebuild, rename, retag, trash); null when none.</summary>
|
||||
public ArchiveDialogViewModel? Dialog
|
||||
{
|
||||
get => _dialog;
|
||||
@@ -499,6 +509,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
OnPropertyChanged(nameof(RenameSetToolTip));
|
||||
OnPropertyChanged(nameof(MoveSetToolTip));
|
||||
OnPropertyChanged(nameof(RetagSetToolTip));
|
||||
OnPropertyChanged(nameof(DeleteSetToolTip));
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
}
|
||||
|
||||
@@ -625,6 +636,19 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
await dialog.PlanAsync();
|
||||
}
|
||||
|
||||
/// <summary>Opens the trash of the archive and reads it.</summary>
|
||||
public async Task OpenTrashAsync()
|
||||
{
|
||||
if (Services.Archives is not { } archives || _archive is not { } archive) return;
|
||||
var dialog = new TrashDialogViewModel(archives, archive, async () =>
|
||||
{
|
||||
await LoadAsync();
|
||||
await Shell.Library.RefreshAsync();
|
||||
}, CloseDialog);
|
||||
OpenDialog(dialog);
|
||||
await dialog.LoadAsync();
|
||||
}
|
||||
|
||||
private void OpenRetag()
|
||||
{
|
||||
if (Services.Archives is not { } archives) return;
|
||||
|
||||
Reference in new issue
Block a user