From b21d27dbbce43e6f355ca483cc6e5115894ffb79 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 30 Sep 2026 12:52:39 +0300 Subject: [PATCH] Jump straight to notification tap and external deep link targets Whether to animate a route was decided after resuming the client services, by which time a notification tap or an external deep link had already made the app active, so the user watched a navigation animation from the room list. Read the app state as soon as the route arrives instead, so these land directly on their target while routes handled in the foreground keep animating. --- ElementX/Sources/Application/AppCoordinator.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 1f8fd1749..111a016b4 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -249,12 +249,14 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg } func handleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?) { + // Read before resuming the services, by which time a push tap or deep link will have made the app active. + let animated = appMediator.appState == .active Task { - await asyncHandleAppRoute(appRoute, windowType: windowType) + await asyncHandleAppRoute(appRoute, windowType: windowType, animated: animated) } } - private func asyncHandleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?) async { + private func asyncHandleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?, animated: Bool) async { MXLog.info("Handling app route: \(appRoute)") await resumeClientServices() @@ -269,12 +271,12 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg switch appRoute { case .accountProvisioningLink: if let authenticationFlowCoordinator { - authenticationFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active) + authenticationFlowCoordinator.handleAppRoute(appRoute, animated: animated) handled = true } default: if let userSessionFlowCoordinator { - userSessionFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active) + userSessionFlowCoordinator.handleAppRoute(appRoute, animated: animated) handled = true } }