fix(app): archive picks, early import job ends and language switches
- Archive: picking another archive while the screen was reading kept the old archive's tree and figures while Scan, Verify and the set actions targeted the new one, and reloads asked for during a read were dropped. A load requested during a read now runs once more after it, a read whose archive is no longer picked shows nothing, and a new pick clears the tree and the online state until the picked archive is read. - Import: a job that ended before the screen recorded its id (a destination gone offline) left the screen copying forever; its state is read back once. A replaced import result is disposed, so it no longer stays alive through the language event with its whole plan. - Library: the timeline's month readouts are made again on a language switch. 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
+170
-7
No files matched your search
@@ -3,6 +3,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Library;
|
||||
using Titano.App.Sections;
|
||||
using Titano.App.Shell;
|
||||
@@ -153,6 +154,32 @@ public sealed class LibraryScreenSmokeTests
|
||||
trash.CloseCommand.Execute(null);
|
||||
});
|
||||
|
||||
/// <summary>A language switch makes the timeline's month readouts again, as it does the filters (BRIEF §16).</summary>
|
||||
[Test]
|
||||
public Task TheTimelineReadoutsFollowALanguageSwitch() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
await using var app = await ScreenSmokeTests.SampleApp.StartAsync();
|
||||
await app.Sample.FillAsync();
|
||||
await app.Shell.Services.Server.RestoreAsync();
|
||||
await app.Shell.Services.Sync.RefreshAsync();
|
||||
var library = app.Shell.Library;
|
||||
await LibraryScenes.ShowAsync(app.Shell, "timeline");
|
||||
var english = Readout(library);
|
||||
try
|
||||
{
|
||||
UiLanguage.Apply("it");
|
||||
var italian = Readout(library);
|
||||
Assert.NotEqual(english, italian, "the month readouts follow the language");
|
||||
}
|
||||
finally
|
||||
{
|
||||
UiLanguage.Apply("en");
|
||||
}
|
||||
Assert.Equal(english, Readout(library), "and come back with it");
|
||||
|
||||
static string Readout(LibraryViewModel library) => library.TimelineBands[0].ToolTips!.First(t => !string.IsNullOrEmpty(t))!;
|
||||
});
|
||||
|
||||
private static void Press(UIElement target, Key key) =>
|
||||
target.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(target)!, 0, key) { RoutedEvent = Keyboard.KeyDownEvent });
|
||||
|
||||
|
||||
Reference in new issue
Block a user