From 2050c0e8fd078cff3d31bed4d871e4ce3baed95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:50:09 -0400 Subject: [PATCH] fix(notification-service): track latest section for batch summary --- src/main/notification-service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/notification-service.ts b/src/main/notification-service.ts index 3fd0308e..05061f59 100644 --- a/src/main/notification-service.ts +++ b/src/main/notification-service.ts @@ -23,6 +23,7 @@ interface NotificationServiceDependencies { interface BatchState { count: number; timer: ReturnType; + /** Latest section observed during the window. Summary navigates here on click. */ section: SectionId; } @@ -100,8 +101,13 @@ export function createNotificationService(deps: NotificationServiceDependencies) return; } - // Accumulate -- do not fire individual notification + // Accumulate -- do not fire individual notification. + // Track the most recent section so the summary links to where the latest event happened. existing.count++; + const nextSection = options.navigation?.section; + if (nextSection) { + existing.section = nextSection; + } } function flushBatch(key: string) {