From cc1a335a49467a2a99b094c1f4246f8c11e3288f Mon Sep 17 00:00:00 2001 From: stopflock Date: Thu, 4 Dec 2025 19:08:18 -0600 Subject: [PATCH] Fix search/nav button offline behavior --- assets/changelog.json | 5 +++-- lib/screens/coordinators/navigation_coordinator.dart | 6 +++--- lib/widgets/map/map_overlays.dart | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/assets/changelog.json b/assets/changelog.json index 3ecee10..eca6e83 100644 --- a/assets/changelog.json +++ b/assets/changelog.json @@ -1,8 +1,9 @@ { "1.6.1": { "content": [ - "• IMPROVED: Navigation route calculation timeout increased from 15 to 30 seconds - better success rate for complex routes in dense areas", - "• TECHNICAL: Route timeout is now configurable in dev_config for easier future adjustments" + "• Navigation route calculation timeout increased from 15 to 30 seconds - better success rate for complex routes in dense areas", + "• Route timeout is now configurable in dev_config for easier future adjustments", + "• Fix accidentally opening edit sheet on node tap instead of tags sheet" ] }, "1.6.0": { diff --git a/lib/screens/coordinators/navigation_coordinator.dart b/lib/screens/coordinators/navigation_coordinator.dart index 81db9b5..e3b8eab 100644 --- a/lib/screens/coordinators/navigation_coordinator.dart +++ b/lib/screens/coordinators/navigation_coordinator.dart @@ -80,12 +80,12 @@ class NavigationCoordinator { }) { final appState = context.read(); - if (appState.isInRouteMode) { - // Show route overview (zoom out to show full route) + if (appState.showRouteButton) { + // Route button - show route overview and zoom to show route appState.showRouteOverview(); zoomToShowFullRoute(appState: appState, mapController: mapController); } else { - // Not in route - handle based on current state + // Search button - toggle search mode if (appState.isInSearchMode) { // Exit search mode appState.clearSearchResults(); diff --git a/lib/widgets/map/map_overlays.dart b/lib/widgets/map/map_overlays.dart index 9ca409e..e02cf99 100644 --- a/lib/widgets/map/map_overlays.dart +++ b/lib/widgets/map/map_overlays.dart @@ -159,7 +159,7 @@ class MapOverlays extends StatelessWidget { children: [ // Search/Navigation button - show search button always, show route button only in dev mode when online if (onSearchPressed != null) ...[ - if (appState.showSearchButton || (enableNavigationFeatures(offlineMode: appState.offlineMode) && appState.showRouteButton)) ...[ + if ((!appState.offlineMode && appState.showSearchButton) || appState.showRouteButton) ...[ FloatingActionButton( mini: true, heroTag: "search_nav",