From 007c5b281d02e92ec65792509cfcd0af20795e1e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 20:42:36 +0000 Subject: [PATCH] fix(app): the view-name dialog and remote cards follow the reviewed dialog kit Save view and Rename view use the growing label column and show a failed save as one sentence in the dialog. The Library reads a remote card's proxy cache off the UI thread, sets a sequence's folder left to right and centres the Rating chevron. A sequence back in the index refuses a restore with SequenceInLibraryException, tested with the one-sentence causes of a refused delete or restore. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.App/Library/LibraryActions.cs | 5 +++-- .../Library/ViewNameDialogViewModel.cs | 8 ++++++++ src/Titano.App/Sections/LibraryView.xaml | 12 +++++++----- .../Titano.App.Tests/Library/DeletePlansTests.cs | 12 ++++++++++++ .../Archiving/SequenceTrashTests.cs | 16 ++++++++++++++++ 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/Titano.App/Library/LibraryActions.cs b/src/Titano.App/Library/LibraryActions.cs index 8c76997d..13b70ca9 100644 --- a/src/Titano.App/Library/LibraryActions.cs +++ b/src/Titano.App/Library/LibraryActions.cs @@ -139,7 +139,8 @@ public sealed class LibraryActions(ShellViewModel shell) NotConnected(); return null; } - if (remote.Service.OpenRemote(remote.Server, sequence.Id) is not null) + // The proxy cache is read off the UI thread: its manifest holds every frame. + if (await Task.Run(() => remote.Service.OpenRemote(remote.Server, sequence.Id)) is not null) { shell.OpenSequence(sequence.Id); return null; @@ -223,7 +224,7 @@ public sealed class LibraryActions(ShellViewModel shell) /// The project of a remote card: from its proxy cache when it was opened here, else from the server's manifest; and its frame size when cached. private static async Task<(ProjectSettings Project, int Width, int Height)> RemoteProjectAsync(RemoteSource remote, Guid id) { - if (remote.Service.OpenRemote(remote.Server, id) is { } cached) + if (await Task.Run(() => remote.Service.OpenRemote(remote.Server, id)) is { } cached) { var frame = cached.Frames.FirstOrDefault(f => f.Width > 0); var size = frame is null ? (0, 0) : frame.Orientation is >= 5 and <= 8 ? (frame.Height, frame.Width) : (frame.Width, frame.Height); diff --git a/src/Titano.App/Library/ViewNameDialogViewModel.cs b/src/Titano.App/Library/ViewNameDialogViewModel.cs index 973b6dc9..982c7ffc 100644 --- a/src/Titano.App/Library/ViewNameDialogViewModel.cs +++ b/src/Titano.App/Library/ViewNameDialogViewModel.cs @@ -1,7 +1,9 @@ using System.Windows.Input; using Titano.App.Archiving; using Titano.App.Settings; +using Titano.Core.Diagnostics; using Titano.Core.Localization; +using Titano.Data; using Titano.Ui.Mvvm; namespace Titano.App.Library; @@ -38,12 +40,18 @@ public sealed class ViewNameDialogViewModel : ArchiveDialogViewModel private async Task SaveAsync() { + ClearError(); IsBusy = true; try { await _save(Name.Text.Trim()); Close(); } + catch (DatabaseException ex) + { + Log.Warning("library", "Saving a view failed", ex); + ShowError(ex); + } finally { IsBusy = false; diff --git a/src/Titano.App/Sections/LibraryView.xaml b/src/Titano.App/Sections/LibraryView.xaml index f8107f39..de9c9183 100644 --- a/src/Titano.App/Sections/LibraryView.xaml +++ b/src/Titano.App/Sections/LibraryView.xaml @@ -91,10 +91,10 @@ - + - + @@ -103,7 +103,7 @@ ToolTip="{Binding SaveToolTip}" IsDefault="True" MinWidth="96" Margin="8,0,0,0" />