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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
5 files changed
+46
-7
No files matched your search
@@ -1,6 +1,8 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Archiving;
|
||||
@@ -77,4 +79,14 @@ public sealed class DeletePlansTests
|
||||
Assert.Equal(Loc.Plural("Archive.Delete.More", 6), lines[^1]);
|
||||
Assert.False(request.IsDetailMonospaced, "names read in the UI font, not the fingerprint font");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ARefusedDeleteOrRestoreSaysWhyInOneSentence()
|
||||
{
|
||||
Assert.Equal(Loc.L("Archive.Error.StalePlan"), ArchiveFailures.Cause(new StaleDeletePlanException(Guid.NewGuid())));
|
||||
Assert.Equal(Loc.L("Archive.Error.InLibrary", "Harbour sunset"), ArchiveFailures.Cause(new SequenceInLibraryException(Guid.NewGuid(), "Harbour sunset")));
|
||||
Assert.Equal(Loc.L("Archive.Error.NewerFormat", "sequence.json", 9), ArchiveFailures.Cause(new NewerFormatException("/a/2026/x/.titano/sequence.json", 9)));
|
||||
Assert.Equal(Loc.L("Archive.Failed.Files"), ArchiveFailures.Cause(new DirectoryNotFoundException("/a/.titano/trash/0123 is not in the trash")),
|
||||
"the engine's own words stay in the log");
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,22 @@ public abstract class SequenceTrashTests(TestContext context) : DatabaseTest(con
|
||||
Assert.Equal(entry.Name, again.Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ASequenceBackInTheIndexIsNotRestoredOverIt()
|
||||
{
|
||||
var fx = await FixtureAsync();
|
||||
var sequences = await PopulateAsync(fx);
|
||||
var victim = sequences[1];
|
||||
var entry = (await fx.Service.DeleteAsync(await fx.Service.PlanDeleteAsync([victim.Id], null, fx.Ct), null, null, fx.Ct)).Single();
|
||||
await fx.Db.Sequences.UpsertAsync(victim);
|
||||
|
||||
var refused = await Assert.ThrowsAsync<SequenceInLibraryException>(() => fx.Service.RestoreAsync(fx.Archive.Id, entry.Name, fx.Ct));
|
||||
|
||||
Assert.Equal(victim.Id, refused.SequenceId);
|
||||
Assert.False(Directory.Exists(fx.Paths.Sequence(victim.Folder).Folder), "nothing moved");
|
||||
Assert.Equal(entry.Name, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ARestoreIntoATakenFolderUsesAFreeOneAndKeepsRendersReachable()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user