From f8a050e484bc5cd5d0e9c573a1dfd1e2b05be445 Mon Sep 17 00:00:00 2001 From: systemblue Date: Wed, 10 Jun 2026 20:17:57 +0200 Subject: [PATCH] fix: refresh the merged notifications list when a push notification is opened (#71) **Why.** Tapping a push notification bumps `NavigationState.notificationsRefreshTrigger` so the notifications tab reloads on arrival. The single-instance `NotificationsOverviewView` observes the trigger; the merged multi-instance overview never did, so multi-instance users landed on a stale list that still showed the tapped thread as unread until a manual pull-to-refresh. **What changed.** `MergedNotificationsOverviewView` observes the same trigger with the same `onChange` the single-instance view uses, and reloads. **Verification.** Full `ForjiTests` suite passes (218 passed / 0 failed, iPhone 17 Pro, iOS 26.5, rebased onto current main). SwiftLint and SwiftFormat clean. The push-open path needs a real APNs round trip, so I couldn't exercise it end-to-end locally; the change mirrors the single-instance wiring line for line. I grant Stefan Hausotte an irrevocable, worldwide, royalty-free license to use, sublicense, and distribute my contribution, including through Apple's App Store under the project's App Store exception. Reviewed-on: https://codeberg.org/secana/Forji/pulls/71 --- Forji/Forji/Views/MergedNotificationsOverviewView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Forji/Forji/Views/MergedNotificationsOverviewView.swift b/Forji/Forji/Views/MergedNotificationsOverviewView.swift index 3e4fdcd..807e3af 100644 --- a/Forji/Forji/Views/MergedNotificationsOverviewView.swift +++ b/Forji/Forji/Views/MergedNotificationsOverviewView.swift @@ -6,6 +6,7 @@ struct MergedNotificationsOverviewView: View { @State private var pagination: PaginationState> @State private var statusFilter: String = "unread" + @Environment(NavigationState.self) private var navigationState init(manager: MultiInstanceManager) { self.manager = manager @@ -95,6 +96,9 @@ struct MergedNotificationsOverviewView: View { .onChange(of: statusFilter) { reloadNotifications(clearItems: true) } + .onChange(of: navigationState.notificationsRefreshTrigger) { + reloadNotifications() + } .errorAlert(message: $pagination.errorMessage, isPresented: $pagination.showError) }