fix(app): notification clicks run only what the toast names, batches speak once, warnings get badges

- Toast.RunsFromNotification: a click on a Windows notification restores the window and runs the toast's
  action only when the toast opts in (card detected: Import; interrupted import: Resume; job finished: Open;
  navigation to Import or Jobs) and it is the only notification shown since the icon appeared. Cancel, Undo
  and Retry stay in the window, and the notification text no longer offers them.
- Job endings are coalesced: finished jobs of one kind wait until no job of that kind the user waits for is
  queued or running, then one toast says how many finished ("12 jobs finished", action Jobs); failures of one
  update share one toast. Server > Upload all no longer raises one toast and one notification per sequence.
- Every failure that is not upkeep (scan, thumbnails, proxies, light analysis) is announced, including move,
  adopt and user downloads; finished moves and adoptions are announced too.
- Rail badges: Library counts the sequences with warnings (the Warnings filter), refreshed after analyses;
  Archive counts the index health lines that need attention.
- Tests: the balloon click path, the --minimized restore to a saved maximised window, batch and failure
  coalescing, and the new badges.

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-12 10:35:19 +00:00
1 parent 97c6484c74
commit 6417e2b3c2
15 files changed
+438 -64

No files matched your search

@@ -700,6 +700,7 @@ public sealed class LibraryViewModel : SectionViewModel
_hasArchive = (await _db.Archives.ListAsync()).Count > 0;
Shell.SetLibraryTotals(stats.Sequences, stats.Photos, stats.Bytes);
_localStats = stats;
await CountWarningsAsync();
_suppressReload = true;
var tag = _tag.Value;
@@ -1025,6 +1026,8 @@ public sealed class LibraryViewModel : SectionViewModel
if (job.Kind is JobKind.Scan or JobKind.Rebuild or JobKind.Import or JobKind.Adopt or JobKind.Move or JobKind.UploadCommit
|| SyncService.TransferKind(job) is SyncTransferKind.DownloadOriginals or SyncTransferKind.GetExports)
await RefreshAsync();
else if (job.Kind is JobKind.LightAnalyse or JobKind.DeepAnalyse)
await CountWarningsAsync();
}
catch (DatabaseException ex)
{
@@ -1032,6 +1035,15 @@ public sealed class LibraryViewModel : SectionViewModel
}
}
/// <summary>
/// The rail badge counts the sequences of this PC with warnings (BRIEF §12.1 "badge counts (warnings, …)"), the
/// ones the Warnings filter shows; analyses change it.
/// </summary>
private async Task CountWarningsAsync()
{
if (_db is not null) Badge = await _db.Sequences.CountAsync(new SequenceQuery { WithStatus = SequenceStatus.HasWarnings });
}
/// <summary>Open: the editor for a sequence here; for a remote card, with proxies (fetched first when this PC has none).</summary>
private async Task OpenAsync(SequenceItem item)
{