From f3a09e9dfba491dce52bee33e5897ab010355364 Mon Sep 17 00:00:00 2001 From: Maxime Landry Date: Tue, 20 Oct 2026 14:37:27 -0400 Subject: [PATCH] Count failed operations in the operations panel header The header said "3 of 3 operations completed" when some of them failed. With the panel collapsed it is the only text left, next to a small red dot. When the batch has failures, the header now uses the existing "{0} of {1} succeeded, {2} failed" string, already used by the summary toast. Co-Authored-By: Claude Opus 5.5 --- src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs b/src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs index 78fab048c1..f90b016d11 100644 --- a/src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs +++ b/src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs @@ -99,8 +99,15 @@ public string OperationsHeaderText int total = _operationBatch.Count; if (total == 0) return CoreTools.Translate("Operations"); + // Name the failures, so a collapsed panel does not read as "all good" when some failed. + int failed = _operationBatch.Count(o => o.Status is OperationStatus.Failed); + if (failed > 0) + { + int succeeded = _operationBatch.Count(o => o.Status is OperationStatus.Succeeded); + return CoreTools.Translate("{0} of {1} succeeded, {2} failed", succeeded, total, failed); + } int completed = _operationBatch.Count(o => - o.Status is OperationStatus.Succeeded or OperationStatus.Failed or OperationStatus.Canceled); + o.Status is OperationStatus.Succeeded or OperationStatus.Canceled); return CoreTools.Translate("{0} of {1} operations completed", completed, total); } }