fix(app): Library and Archive delete, quick actions and toolbar after review
Delete… runs in an in-window dialog shared by the Library and the Archive manager: the dry run and the move into the trash report progress and stop on Cancel, the toast counts only what really moved, and its Undo reports failures. The confirmation names at most six moves and three refusals in the UI font. Delete… stands apart at the far right of both bars and last in the tab order. The toolbar's filters wrap instead of pushing out the right-hand group at 1200 px. Card and row quick actions show while selected or focused, so Tab reaches them; Analyse and Render are disabled with a reason when nothing can run them, and say so in a toast if the session drops. Remote cards get their own card, Analyse and Render tooltips; the details panel's Folder and the saved-view menu say why they are disabled. Status offers Rendered, Not rendered and Synced. Remote cards count in the Year and Camera choices and the timeline. The trash dialog shows one sentence when empty. --capture adds archive-trash and library-viewname. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
29 files changed
+602
-170
No files matched your search
@@ -132,6 +132,23 @@
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Delete…: how far the dry run, then the move into the trash, has got; Cancel stops between two sequences. -->
|
||||
<DataTemplate DataType="{x:Type ar:DeleteDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="460">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" TextTrimming="CharacterEllipsis" />
|
||||
<ProgressBar Maximum="1" Value="{Binding Progress, Mode=OneWay}" Margin="0,16,0,0" AutomationProperties.Name="{Binding Heading}"
|
||||
AutomationProperties.HelpText="{Binding BusyText}" />
|
||||
<DockPanel Margin="0,18,0,0">
|
||||
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
|
||||
IsDefault="True" MinWidth="96" />
|
||||
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"
|
||||
Typography.NumeralAlignment="Tabular" Margin="0,0,12,0" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- The archive's trash: deleted sequences, newest first, each with Restore. -->
|
||||
<DataTemplate DataType="{x:Type ar:TrashDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="640" MaxHeight="520">
|
||||
@@ -144,7 +161,9 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" TextTrimming="CharacterEllipsis" />
|
||||
<TextBlock Grid.Row="1" Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,8,0,8" Typography.NumeralAlignment="Tabular" />
|
||||
<ListBox Grid.Row="2" ItemsSource="{Binding Rows}" MinHeight="120" AutomationProperties.Name="{l:Loc Archive.Trash.List}" KeyboardNavigation.TabNavigation="Continue">
|
||||
<!-- An empty trash is the summary sentence alone. -->
|
||||
<ListBox Grid.Row="2" ItemsSource="{Binding Rows}" MinHeight="120" AutomationProperties.Name="{l:Loc Archive.Trash.List}" KeyboardNavigation.TabNavigation="Continue"
|
||||
Visibility="{Binding HasRows, Converter={StaticResource BoolToVisibility}}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
|
||||
@@ -5,11 +5,11 @@ namespace Titano.App.Archiving;
|
||||
/// <summary>
|
||||
/// The Archive views that <c>--capture</c> renders (<c>archive-<view>-<theme>.png</c>) and the screen smoke
|
||||
/// tests check, on the sample archive: the tree with figures and charts, the maintenance view with its reports, the
|
||||
/// rebuild dialog, and the Move dialog with its dry run.
|
||||
/// rebuild dialog, the Move dialog with its dry run, and the trash (Maintenance › Trash…) with deleted sequences.
|
||||
/// </summary>
|
||||
public static class ArchiveScenes
|
||||
{
|
||||
public static readonly IReadOnlyList<string> Views = ["overview", "maintenance", "rebuild", "move"];
|
||||
public static readonly IReadOnlyList<string> Views = ["overview", "maintenance", "rebuild", "move", "trash"];
|
||||
|
||||
public static async Task ShowAsync(ShellViewModel shell, string view)
|
||||
{
|
||||
@@ -41,6 +41,11 @@ public static class ArchiveScenes
|
||||
await move.PlanAsync();
|
||||
}
|
||||
break;
|
||||
case "trash":
|
||||
archive.ViewIndex = 1;
|
||||
await archive.OpenTrashAsync();
|
||||
if (archive.Dialog is TrashDialogViewModel trash && archive.SelectedArchive is { } shown) trash.Show(SampleReports.Trash(shown.Id, locations));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(view), view, "Unknown Archive view.");
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public static class DeletePlans
|
||||
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),
|
||||
IsDetailMonospaced = false,
|
||||
DetailToolTip = Loc.L("Tooltips.Archive.DeletePlan"),
|
||||
SafeText = Loc.L("Archive.Delete.Keep"),
|
||||
SafeToolTip = Loc.L("Tooltips.Archive.DeleteKeep"),
|
||||
|
||||
@@ -5,7 +5,7 @@ using Titano.Data.Repositories;
|
||||
namespace Titano.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// Capture and smoke-test data ONLY: maintenance reports and rebuild counts over the sample archive's sequences
|
||||
/// Capture and smoke-test data ONLY: maintenance reports, rebuild counts and trash rows over the sample archive's sequences
|
||||
/// (the sample index has no sidecars on disk, so the real searches would find nothing to show).
|
||||
/// </summary>
|
||||
public static class SampleReports
|
||||
@@ -31,6 +31,17 @@ public static class SampleReports
|
||||
? new OrphanReport([], [], [])
|
||||
: new OrphanReport([new SequenceOrphans(sequences[2].Folder, ["IMG_0412.CR2", "IMG_0413.CR2"], [])], [sequences[3]], ["2024/2024-12-31 Unsorted"]);
|
||||
|
||||
/// <summary>The trash dialog's rows: the first two sample sequences, deleted an hour and a day ago (nothing moves on disk).</summary>
|
||||
public static IReadOnlyList<TrashEntry> Trash(Guid archiveId, IReadOnlyList<SequenceLocation> sequences)
|
||||
{
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
return
|
||||
[
|
||||
.. sequences.Take(2).Select((s, i) => new TrashEntry(archiveId, s.Id.ToString("N"), s.Id, s.Title ?? s.Folder, s.Folder, 1_200 * (i + 1), 1_206 * (i + 1),
|
||||
31_457_280L * 1_200 * (i + 1), now.AddHours(-1 - (23 * i)), Environment.UserName)),
|
||||
];
|
||||
}
|
||||
|
||||
/// <summary>What the rebuild dialog counts: a sidecar in every sequence folder but the last two, read by metadata instead.</summary>
|
||||
public static IReadOnlyList<SequenceFolder> Folders(IReadOnlyList<SequenceLocation> sequences)
|
||||
{
|
||||
|
||||
@@ -52,12 +52,16 @@ public sealed class TrashDialogViewModel : ArchiveDialogViewModel
|
||||
{
|
||||
if (!Set(ref _rows, value)) return;
|
||||
OnPropertyChanged(nameof(IsEmpty));
|
||||
OnPropertyChanged(nameof(HasRows));
|
||||
OnPropertyChanged(nameof(SummaryText));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmpty => _rows.Count == 0;
|
||||
|
||||
/// <summary>The list shows; an empty trash is its summary sentence alone.</summary>
|
||||
public bool HasRows => _rows.Count > 0;
|
||||
|
||||
/// <summary>"3 sequences · 182 GB", or "The trash is empty".</summary>
|
||||
public string SummaryText => _rows.Count == 0 ? Loc.L("Archive.Trash.Empty")
|
||||
: Loc.Plural("Shell.Status.Sequences", _rows.Count) + " · " + Formatting.Bytes(_rows.Sum(r => r.Entry.Bytes));
|
||||
|
||||
Reference in new issue
Block a user