feat(app): Import and Archive manager screens with capture scenes and resources

Import (cards and folders): the card pool with remembered profiles and the
nickname field for new cards, the form (destination, scan, sessions, names
with live preview and tokens, duplicates, after-import choices), the plan
panel with editable session titles, Show plan, the archive import job or
the folder/server run with progress, the verification result and the
after-import actions (dry run, delete, format through the Windows dialog,
eject, open in Library), card-insertion toasts, automatic import into the
archive and resume after re-insertion. Deep analysis after import is queued
with ProcessingJobs at background priority.

Archive manager: archive picker, tree with availability, figure tiles and
charts, mass operations on the selected set, scan/rebuild (dialog)/verify/
duplicates/orphans/adopt/maintenance as jobs, and the maintenance view with
index health, recent runs and the duplicate and orphan reports with safe
fixes.

--capture renders import-<state> and archive-<view> from a simulated card
and sample reports; en and it resources for both screens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 22:20:10 +00:00
1 parent f7affe7840
commit a0e814885c
31 files changed
+4531 -28

No files matched your search

@@ -0,0 +1,73 @@
using System.Windows.Input;
using Titano.Core.Archiving;
using Titano.Core.Localization;
using Titano.Ui.Controls;
using Titano.Ui.Mvvm;
namespace Titano.App.Archiving;
/// <summary>A visible row of the archive tree: indentation, expander, title, figures and availability.</summary>
public sealed class ArchiveTreeRowViewModel(ArchiveTreeNode node, ArchiveAvailability availability, Action<ArchiveTreeNode> toggle) : ObservableObject
{
public ArchiveTreeNode Node { get; } = node;
public string Title => Node.Title;
public string Detail => Node.Detail;
/// <summary>16 px per level.</summary>
public System.Windows.Thickness IndentMargin => new(Node.Depth * 16, 0, 0, 0);
public bool HasChildren => Node.HasChildren;
public bool IsExpanded => Node.IsExpanded;
public bool IsArchive => Node.Kind == TreeNodeKind.Archive;
public bool IsYear => Node.Kind == TreeNodeKind.Year;
public string ToggleToolTip => Loc.L(Node.IsExpanded ? "Tooltips.Archive.Collapse" : "Tooltips.Archive.Expand");
public ICommand ToggleCommand { get; } = new RelayCommand(() => toggle(node));
/// <summary>The archive's availability (BRIEF §7: online, read-only, offline) on the archive row.</summary>
public StatusKind AvailabilityKind => availability switch
{
ArchiveAvailability.Online => StatusKind.Online,
ArchiveAvailability.ReadOnly => StatusKind.Warning,
_ => StatusKind.Offline,
};
public string AvailabilityText => Loc.L("Archive.Availability." + availability);
public string AvailabilityToolTip => Loc.L("Tooltips.Archive.Availability." + availability);
}
/// <summary>A line of "Index health" with its fix.</summary>
public sealed class HealthLineViewModel(HealthLine line, ICommand? fix) : ObservableObject
{
public HealthLine Line { get; } = line;
public string Text => Line.Text;
public StatusKind Kind => Line.IsOk ? StatusKind.Done : StatusKind.Warning;
public string KindToolTip => Loc.L(Line.IsOk ? "Tooltips.Archive.HealthOk" : "Tooltips.Archive.HealthWarning");
public bool HasFix => FixCommand is not null && Line.Action != HealthAction.None;
public ICommand? FixCommand { get; } = fix;
public string FixText => HasFix ? Loc.L("Archive.Health.Fix." + Line.Action) : string.Empty;
public string FixToolTip => HasFix ? Loc.L("Tooltips.Archive.Fix." + Line.Action) : string.Empty;
}
/// <summary>A duplicate group with its safe actions: open the first copy's sequence, show its folder.</summary>
public sealed class DuplicateRowViewModel(DuplicateRow row, ICommand open, ICommand reveal) : ObservableObject
{
public DuplicateRow Row { get; } = row;
public string Places => string.Join(" · ", Row.Places);
public ICommand OpenCommand { get; } = open;
public ICommand RevealCommand { get; } = reveal;
}
/// <summary>An orphan line with its fix (index, reconcile, remove the row, scan).</summary>
public sealed class OrphanRowViewModel(OrphanRow row, ICommand fix) : ObservableObject
{
public OrphanRow Row { get; } = row;
public StatusKind Kind => Row.Kind is OrphanKind.MissingFiles or OrphanKind.MissingSequence ? StatusKind.Warning : StatusKind.Queued;
public string KindText => Loc.L("Archive.Orphans.Kind." + Row.Kind);
public ICommand FixCommand { get; } = fix;
public string FixText => Loc.L("Archive.Orphans.Fix." + Row.Kind);
public string FixToolTip => Loc.L("Tooltips.Archive.Orphans." + Row.Kind);
}