Compare commits

..

4 Commits

Author SHA1 Message Date
stopflock
6cda350f22 Got rid of some redundant / can never happen type of if statements 2025-12-04 21:12:17 -06:00
stopflock
89f8ad2e0a Clean up nav state when offline mode is enabled 2025-12-04 19:34:51 -06:00
stopflock
cc1a335a49 Fix search/nav button offline behavior 2025-12-04 19:08:18 -06:00
stopflock
473d65c83e Was accidentally calling edit sheet on node tap instead of tags shet 2025-12-04 18:29:43 -06:00
6 changed files with 43 additions and 39 deletions

View File

@@ -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": {

View File

@@ -38,8 +38,7 @@ class MapInteractionHandler {
debugPrint('[MapInteractionHandler] Could not center map on node: $e');
}
// Start edit session for the node
appState.startEditSession(node);
// Note: Edit session is NOT started here - only when user explicitly presses Edit button
}
/// Handle suspected location tap with selection and highlighting

View File

@@ -80,12 +80,12 @@ class NavigationCoordinator {
}) {
final appState = context.read<AppState>();
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();

View File

@@ -385,14 +385,20 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
_sheetCoordinator.setEditSheetShown(false);
}
// Auto-open navigation sheet when needed - simplified logic (only in dev mode)
// Auto-open navigation sheet when needed - only when online and in nav features mode
if (kEnableNavigationFeatures) {
final shouldShowNavSheet = appState.isInSearchMode || appState.showingOverview;
final shouldShowNavSheet = !appState.offlineMode && (appState.isInSearchMode || appState.showingOverview);
if (shouldShowNavSheet && !_sheetCoordinator.navigationSheetShown) {
_sheetCoordinator.setNavigationSheetShown(true);
WidgetsBinding.instance.addPostFrameCallback((_) => _openNavigationSheet());
} else if (!shouldShowNavSheet) {
} else if (!shouldShowNavSheet && _sheetCoordinator.navigationSheetShown) {
_sheetCoordinator.setNavigationSheetShown(false);
// When sheet should close (including going offline), clean up navigation state
if (appState.offlineMode) {
WidgetsBinding.instance.addPostFrameCallback((_) {
appState.cancelNavigation();
});
}
}
}
@@ -491,8 +497,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
}
},
),
// Search bar (slides in when in search mode) - only online since search doesn't work offline
if (!appState.offlineMode && appState.isInSearchMode)
// Search bar (slides in when in search mode)
if (appState.isInSearchMode)
Positioned(
top: 0,
left: 0,

View File

@@ -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",

View File

@@ -101,32 +101,30 @@ class NavigationSheet extends StatelessWidget {
address: provisionalAddress,
),
const SizedBox(height: 16),
// Only show routing buttons if navigation features are enabled
if (enableNavigationFeatures(offlineMode: appState.offlineMode)) ...[
Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.directions),
label: Text(LocalizationService.instance.t('navigation.routeTo')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: false);
},
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.my_location),
label: Text(LocalizationService.instance.t('navigation.routeFrom')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: true);
},
),
),
],
),
],
// Show routing buttons (sheet only opens when online, so always available)
Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.directions),
label: Text(LocalizationService.instance.t('navigation.routeTo')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: false);
},
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.my_location),
label: Text(LocalizationService.instance.t('navigation.routeFrom')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: true);
},
),
),
],
),
],
// SETTING SECOND POINT: Show both points and select button