fix(archive): focus returns safely after a dialog; Retry of a relink asks for the folder again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-06 08:21:44 +00:00
1 parent b7cf8e8faf
commit c5c6b801d9
3 files changed
+32 -9

No files matched your search

+4 -7
View File
@@ -726,14 +726,10 @@ public sealed class ArchiveViewModel : SectionViewModel
/// <summary>A moved archive keeps its id: opening it at the new root relinks every sequence (BRIEF §12.5 Move archive).</summary>
private async Task RelinkAsync()
{
var folder = Services.Dialogs.PickFolder(Loc.L("Archive.Relink.Title"));
if (folder is not null) await RelinkAsync(folder);
}
private async Task RelinkAsync(string folder)
{
if (Services.Archives is not { } archives) return;
var folder = Services.Dialogs.PickFolder(Loc.L("Archive.Relink.Title"));
if (folder is null) return;
try
{
var archive = await Task.Run(() => archives.OpenAsync(folder));
@@ -747,7 +743,8 @@ public sealed class ArchiveViewModel : SectionViewModel
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or DatabaseException)
{
Log.Warning("archive", $"Relinking {folder} failed", ex);
NotifyFailure("Archive.Relink.Failed", ex, new AsyncRelayCommand(() => RelinkAsync(folder)));
// Retry asks for the folder again: the same one once its drive is back, or the right one.
NotifyFailure("Archive.Relink.Failed", ex, RelinkCommand);
}
}