From def878f7733ee34136601417274d7865e6ee396b Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Fri, 29 May 2026 15:20:19 +0300 Subject: [PATCH] fix(ui): auto-refresh the unread anomaly badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nav unread counter was only recomputed when the Anomalies feed page loaded, so newly-detected anomalies didn't update it until the user clicked the tab. NavBody now polls the (cheap, indexed) server-side unread count every 15s — and once immediately on startup — using a fresh DI scope per tick, updating the singleton AnomalyBrowsingState, which re-renders the badge only when the count actually changes. Build clean, all 568 tests green. --- src/Marathon.UI/Components/NavBody.razor | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/Marathon.UI/Components/NavBody.razor b/src/Marathon.UI/Components/NavBody.razor index 5c12a22..e337411 100644 --- a/src/Marathon.UI/Components/NavBody.razor +++ b/src/Marathon.UI/Components/NavBody.razor @@ -1,6 +1,9 @@ @implements IDisposable +@using Microsoft.Extensions.DependencyInjection @inject IStringLocalizer L @inject AnomalyBrowsingState AnomalyState +@inject IServiceScopeFactory ScopeFactory +@inject ILogger Logger