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:
31 files changed
+4531
-28
No files matched your search
@@ -0,0 +1,49 @@
|
||||
using Titano.App.Shell;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The Import states that <c>--capture</c> renders (<c>import-<state>-<theme>.png</c>) and the screen smoke
|
||||
/// tests check, on the card of <see cref="SampleCards"/>: the card just inserted with its plan and sessions (and the
|
||||
/// insertion toast), "Show plan", and the verification result with the after-import actions.
|
||||
/// </summary>
|
||||
public static class ImportScenes
|
||||
{
|
||||
public static readonly IReadOnlyList<string> States = ["plan", "showplan", "done"];
|
||||
|
||||
public static async Task ShowAsync(ShellViewModel shell, string state)
|
||||
{
|
||||
var import = shell.Import;
|
||||
shell.Navigate(SectionKey.Import);
|
||||
switch (state)
|
||||
{
|
||||
case "plan":
|
||||
var card = SampleCards.Card(shell.Services.Environment.DataDirectory);
|
||||
if (import.Result is not null) import.NewImportCommand.Execute(null);
|
||||
import.CloseDetailsCommand.Execute(null);
|
||||
await import.RefreshSourcesAsync();
|
||||
import.SelectSource(card.Identity);
|
||||
import.KeepCard = true;
|
||||
await import.WaitForPlanAsync();
|
||||
if (import.Sessions.Count > 0)
|
||||
{
|
||||
var sunset = import.Sessions[^1].Title;
|
||||
sunset.Text = "Harbour sunset";
|
||||
sunset.Commit();
|
||||
}
|
||||
await import.CardInsertedAsync(card);
|
||||
break;
|
||||
case "showplan":
|
||||
import.ShowPlanCommand.Execute(null);
|
||||
break;
|
||||
case "done":
|
||||
import.CloseDetailsCommand.Execute(null);
|
||||
import.DeleteImported = true;
|
||||
var plan = import.Plan ?? throw new InvalidOperationException("The sample card has no plan.");
|
||||
import.ShowResult(SampleCards.Outcome(plan)).ShowErase(SampleCards.Erase(plan), plan.FileCount);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(state), state, "Unknown Import state.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user