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
@@ -0,0 +1,47 @@
|
||||
using System.Globalization;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
|
||||
/// <summary>The words of a delete dry run (<see cref="DeletePlan"/>): the destructive confirmation and the lines of what cannot move.</summary>
|
||||
public static class DeletePlans
|
||||
{
|
||||
/// <summary>Sequences named one by one in the confirmation; the rest are counted.</summary>
|
||||
public const int ListedLines = 8;
|
||||
|
||||
/// <summary>The destructive confirmation of a plan; null when nothing in it can move.</summary>
|
||||
public static ConfirmRequest? Request(DeletePlan plan)
|
||||
{
|
||||
if (plan.Steps.Count == 0) return null;
|
||||
var count = plan.Steps.Count.ToString(CultureInfo.InvariantCulture);
|
||||
var lines = plan.Steps.Take(ListedLines).Select(s => Loc.L("Archive.Delete.Line", s.Sequence.DisplayTitle,
|
||||
Loc.Plural("Shell.Status.Photos", s.Sequence.FrameCount), Formatting.Bytes(s.Bytes))).ToList();
|
||||
if (plan.Steps.Count > ListedLines) lines.Add(Loc.Plural("Archive.Delete.More", plan.Steps.Count - ListedLines));
|
||||
lines.AddRange(Blocked(plan, ListedLines));
|
||||
return new ConfirmRequest
|
||||
{
|
||||
Heading = Loc.Plural("Archive.Delete.Heading", plan.Steps.Count),
|
||||
Message = Loc.L("Archive.Delete.Message", Loc.Plural("Shell.Status.Photos", plan.Frames), Loc.Plural("Archive.Delete.Files", plan.Files),
|
||||
Formatting.Bytes(plan.Bytes)),
|
||||
Detail = string.Join(Environment.NewLine, lines),
|
||||
DetailToolTip = Loc.L("Tooltips.Archive.DeletePlan"),
|
||||
SafeText = Loc.L("Archive.Delete.Keep"),
|
||||
SafeToolTip = Loc.L("Tooltips.Archive.DeleteKeep"),
|
||||
ActionText = Loc.L("Archive.Delete.Action"),
|
||||
ActionToolTip = Loc.Plural("Tooltips.Archive.DeleteAction", plan.Steps.Count),
|
||||
IsDestructive = true,
|
||||
TypedConfirmation = count,
|
||||
TypedPrompt = Loc.L("Archive.Delete.Type", count),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>"Not moved: Comet over the ridge · a job is working on it", at most <paramref name="max"/> lines.</summary>
|
||||
public static IReadOnlyList<string> Blocked(DeletePlan plan, int max)
|
||||
{
|
||||
var lines = plan.Blocked.Take(max).Select(b => Loc.L("Archive.Delete.Blocked", b.Sequence.DisplayTitle, Loc.L("Archive.Delete.Reason." + b.Reason))).ToList();
|
||||
if (plan.Blocked.Count > max) lines.Add(Loc.Plural("Archive.Delete.More", plan.Blocked.Count - max));
|
||||
return lines;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user