fix(archive): month labels per culture, localized failures with Retry, dialog errors and counts that never stay busy
Month columns use initials only where month names start with a cased letter, else month numbers (ja, ko, zh, vi, th, ar, he, fa). Failures of backup, relink, searches and orphan fixes become one localized sentence plus Retry. Rename and retag keep their failure in an error line; a new dry run clears it. The rebuild counts show the reason instead of Counting... when they cannot be counted. Index health follows the duplicates search. Paths and year ranges stay left to right in RTL text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
6 files changed
+245
-66
No files matched your search
@@ -4,6 +4,7 @@ using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Repositories;
|
||||
using Titano.Ui.Controls;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
|
||||
@@ -30,11 +31,26 @@ public enum OrphanKind
|
||||
public sealed record OrphanRow(OrphanKind Kind, string Title, string Detail, Guid? SequenceId);
|
||||
|
||||
/// <summary>A line of "Recent maintenance": date, operation and outcome.</summary>
|
||||
public sealed record MaintenanceRow(Guid JobId, string DateText, string Text, string StateText, JobState State);
|
||||
public sealed record MaintenanceRow(Guid JobId, string DateText, string Text, string StateText, JobState State)
|
||||
{
|
||||
/// <summary>The outcome's glyph and colour, as on the Jobs screen (paired with the word, never colour alone).</summary>
|
||||
public StatusKind StateKind => State switch
|
||||
{
|
||||
JobState.Running => StatusKind.Running,
|
||||
JobState.Queued => StatusKind.Queued,
|
||||
JobState.Paused => StatusKind.Paused,
|
||||
JobState.Done => StatusKind.Done,
|
||||
JobState.Failed => StatusKind.Failed,
|
||||
_ => StatusKind.Offline,
|
||||
};
|
||||
|
||||
public string StateToolTip => Loc.L("Tooltips.Jobs.State." + State);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Maintenance view's reports (BRIEF §12.5): duplicates across sequences, orphans with their safe fixes, and the
|
||||
/// recent archive jobs. Nothing here deletes a file; the only removal is of index rows whose sidecar is gone.
|
||||
/// recent archive jobs. Nothing here deletes a file; the only removal is of index rows whose sidecar is gone. Folders
|
||||
/// and paths are kept left to right inside right-to-left text (BRIEF §16).
|
||||
/// </summary>
|
||||
public static class MaintenanceReports
|
||||
{
|
||||
@@ -50,7 +66,8 @@ public static class MaintenanceReports
|
||||
{
|
||||
var first = g.Frames[0];
|
||||
var name = first.RelativePath[(first.RelativePath.LastIndexOf('/') + 1)..];
|
||||
var places = g.Frames.Select(f => Loc.L("Archive.Duplicates.Place", titles.GetValueOrDefault(f.SequenceId, f.RelativePath), f.RelativePath)).ToList();
|
||||
var places = g.Frames.Select(f => Loc.L("Archive.Duplicates.Place", titles.GetValueOrDefault(f.SequenceId, f.RelativePath),
|
||||
Formatting.LeftToRight(f.RelativePath))).ToList();
|
||||
return new DuplicateRow(name, Loc.Plural("Archive.Duplicates.Copies", g.Frames.Count), places, first.SequenceId);
|
||||
}),
|
||||
];
|
||||
@@ -63,16 +80,19 @@ public static class MaintenanceReports
|
||||
foreach (var s in report.Sequences)
|
||||
{
|
||||
byFolder.TryGetValue(s.Folder, out var location);
|
||||
var title = location?.Title ?? s.Folder;
|
||||
var title = location?.Title ?? Formatting.LeftToRight(s.Folder);
|
||||
if (s.UnindexedFiles.Count > 0)
|
||||
rows.Add(new OrphanRow(OrphanKind.UnlistedFiles, title, Loc.Plural("Archive.Orphans.Unlisted", s.UnindexedFiles.Count), location?.Id));
|
||||
if (s.MissingFiles.Count > 0)
|
||||
rows.Add(new OrphanRow(OrphanKind.MissingFiles, title, Loc.Plural("Archive.Orphans.Missing", s.MissingFiles.Count), location?.Id));
|
||||
}
|
||||
foreach (var missing in report.MissingSequences)
|
||||
rows.Add(new OrphanRow(OrphanKind.MissingSequence, missing.Title ?? missing.Folder, Loc.L("Archive.Orphans.NoSidecar", missing.Folder), missing.Id));
|
||||
{
|
||||
var folder = Formatting.LeftToRight(missing.Folder);
|
||||
rows.Add(new OrphanRow(OrphanKind.MissingSequence, missing.Title ?? folder, Loc.L("Archive.Orphans.NoSidecar", folder), missing.Id));
|
||||
}
|
||||
foreach (var folder in report.UnindexedFolders)
|
||||
rows.Add(new OrphanRow(OrphanKind.NewFolder, folder.Length == 0 ? "/" : folder, Loc.L("Archive.Orphans.NewFolder"), null));
|
||||
rows.Add(new OrphanRow(OrphanKind.NewFolder, Formatting.LeftToRight(folder.Length == 0 ? "/" : folder), Loc.L("Archive.Orphans.NewFolder"), null));
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user