merge: integration branch claude/keen-knuth-uhxv8w (Archive manager and UI kit review) into the Library workstream
The Archive manager's reviewed dialogs (live status lines, one-sentence errors, growing label columns, left-to-right paths) move into the shared ArchiveDialogs.xaml with their styles, so the Library's Delete and the Trash dialog use them too. Delete, Restore and Rate failures read as one sentence through ArchiveFailures, which now knows a stale delete plan, a newer sidecar and a sequence already back in the library (SequenceInLibraryException). The confirmation's plan lines in the UI font follow the reading direction; fingerprints stay left to right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
77 files changed
+1966
-468
No files matched your search
@@ -60,6 +60,12 @@ public sealed class StaleDeletePlanException(Guid sequenceId) : InvalidOperation
|
||||
public Guid SequenceId { get; } = sequenceId;
|
||||
}
|
||||
|
||||
/// <summary>A trash entry cannot come back: the index already holds its sequence (restored before, or scanned again); nothing moved.</summary>
|
||||
public sealed class SequenceInLibraryException(Guid sequenceId, string title) : InvalidOperationException(Loc.L("Archive.Error.InLibrary", title))
|
||||
{
|
||||
public Guid SequenceId { get; } = sequenceId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deleting sequences without erasing anything (BRIEF §0.2 rule 8, §12.2, §12.5): <see cref="PlanAsync"/> is the dry
|
||||
/// run; <see cref="DeleteAsync"/> moves each sequence folder whole — originals, proxies, exports and its sidecars — into
|
||||
@@ -188,7 +194,7 @@ public sealed class SequenceTrash
|
||||
/// sequence's id, as a scan would adopt it, with the title, tags, rating and notes the record kept. Returns the
|
||||
/// restored row. When it cannot be indexed, the folder goes back into the trash with its record.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">The index already holds that sequence.</exception>
|
||||
/// <exception cref="SequenceInLibraryException">The index already holds that sequence.</exception>
|
||||
/// <exception cref="DirectoryNotFoundException">The entry is not in the trash.</exception>
|
||||
public async Task<Sequence> RestoreAsync(Archive archive, string name, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -203,7 +209,7 @@ public sealed class SequenceTrash
|
||||
throw new DirectoryNotFoundException($"{name} is not in the trash of {archive.Name}.");
|
||||
var id = record.Sequence.Id;
|
||||
if (await _db.Sequences.GetAsync(id, cancellationToken).ConfigureAwait(false) is not null)
|
||||
throw new InvalidOperationException(Loc.L("Archive.Error.InLibrary", record.Sequence.DisplayTitle));
|
||||
throw new SequenceInLibraryException(id, record.Sequence.DisplayTitle);
|
||||
|
||||
var locations = (await _db.Sequences.ListLocationsAsync(archive.Id, cancellationToken).ConfigureAwait(false)).Select(l => l.Folder)
|
||||
.ToHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -37,7 +37,10 @@ public static class ProcessingJobs
|
||||
ArgumentNullException.ThrowIfNull(sequence);
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
var parameters = Parameters(export, sourceWidth, sourceHeight, project?.ToJson(), useProxies);
|
||||
return new ArchiveJobRequest(JobKind.Render, [sequence.Id], $"{sequence.DisplayTitle} → {parameters.PresetName}",
|
||||
// The label is stored as written, in the language of the moment like the preset name: its arrow points from the
|
||||
// sequence to the preset in that language's reading direction.
|
||||
var label = Loc.L(Loc.IsRightToLeft ? "Jobs.Target.RenderRtl" : "Jobs.Target.Render", sequence.DisplayTitle, parameters.PresetName);
|
||||
return new ArchiveJobRequest(JobKind.Render, [sequence.Id], label,
|
||||
JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user