From fd47813bdf9ad43e0914688b48cba92523142e54 Mon Sep 17 00:00:00 2001 From: stopflock Date: Fri, 3 Oct 2025 00:09:25 -0500 Subject: [PATCH] Optional navigation features --- lib/dev_config.dart | 3 +++ lib/screens/home_screen.dart | 22 ++++++++++++---------- lib/screens/settings_screen.dart | 19 +++++++++++-------- lib/widgets/map/map_overlays.dart | 6 +++--- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/lib/dev_config.dart b/lib/dev_config.dart index ffa4c1f..fc34336 100644 --- a/lib/dev_config.dart +++ b/lib/dev_config.dart @@ -41,6 +41,9 @@ const String kClientVersion = '1.0.2'; // Development/testing features - set to false for production builds const bool kEnableDevelopmentModes = false; // Set to false to hide sandbox/simulate modes and force production mode +// Navigation features - set to false to hide navigation UI elements while in development +const bool kEnableNavigationFeatures = kEnableDevelopmentModes; // Hide navigation until fully implemented + // Marker/node interaction const int kCameraMinZoomLevel = 10; // Minimum zoom to show nodes (Overpass) const int kOsmApiMinZoomLevel = 13; // Minimum zoom for OSM API bbox queries (sandbox mode) diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 77aca96..f708f53 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -433,13 +433,15 @@ class _HomeScreenState extends State with TickerProviderStateMixin { _editSheetShown = false; } - // Auto-open navigation sheet when needed - simplified logic - final shouldShowNavSheet = appState.isInSearchMode || appState.showingOverview; - if (shouldShowNavSheet && !_navigationSheetShown) { - _navigationSheetShown = true; - WidgetsBinding.instance.addPostFrameCallback((_) => _openNavigationSheet()); - } else if (!shouldShowNavSheet) { - _navigationSheetShown = false; + // Auto-open navigation sheet when needed - simplified logic (only in dev mode) + if (kEnableNavigationFeatures) { + final shouldShowNavSheet = appState.isInSearchMode || appState.showingOverview; + if (shouldShowNavSheet && !_navigationSheetShown) { + _navigationSheetShown = true; + WidgetsBinding.instance.addPostFrameCallback((_) => _openNavigationSheet()); + } else if (!shouldShowNavSheet) { + _navigationSheetShown = false; + } } // Pass the active sheet height directly to the map @@ -498,15 +500,15 @@ class _HomeScreenState extends State with TickerProviderStateMixin { sheetHeight: activeSheetHeight, selectedNodeId: _selectedNodeId, onNodeTap: openNodeTagSheet, - onSearchPressed: _onNavigationButtonPressed, + onSearchPressed: kEnableNavigationFeatures ? _onNavigationButtonPressed : null, onUserGesture: () { if (appState.followMeMode != FollowMeMode.off) { appState.setFollowMeMode(FollowMeMode.off); } }, ), - // Search bar (slides in when in search mode) - if (appState.isInSearchMode) + // Search bar (slides in when in search mode) - only in dev mode + if (kEnableNavigationFeatures && appState.isInSearchMode) Positioned( top: 0, left: 0, diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 7bbc30c..f63c4c8 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -39,14 +39,17 @@ class SettingsScreen extends StatelessWidget { ), const Divider(), - _buildNavigationTile( - context, - icon: Icons.navigation, - title: locService.t('navigation.navigationSettings'), - subtitle: locService.t('navigation.navigationSettingsSubtitle'), - onTap: () => Navigator.pushNamed(context, '/settings/navigation'), - ), - const Divider(), + // Only show navigation settings in development builds + if (kEnableNavigationFeatures) ...[ + _buildNavigationTile( + context, + icon: Icons.navigation, + title: locService.t('navigation.navigationSettings'), + subtitle: locService.t('navigation.navigationSettingsSubtitle'), + onTap: () => Navigator.pushNamed(context, '/settings/navigation'), + ), + const Divider(), + ], _buildNavigationTile( context, diff --git a/lib/widgets/map/map_overlays.dart b/lib/widgets/map/map_overlays.dart index 4279b93..0b357a3 100644 --- a/lib/widgets/map/map_overlays.dart +++ b/lib/widgets/map/map_overlays.dart @@ -121,8 +121,8 @@ class MapOverlays extends StatelessWidget { builder: (context, appState, child) { return Column( children: [ - // Navigation button - simplified logic - if (onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton)) + // Navigation button - simplified logic (only show in dev mode) + if (kEnableNavigationFeatures && onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton)) ...[ FloatingActionButton( mini: true, heroTag: "search_nav", @@ -132,8 +132,8 @@ class MapOverlays extends StatelessWidget { : LocalizationService.instance.t('navigation.searchLocation'), child: Icon(appState.showRouteButton ? Icons.route : Icons.search), ), - if (onSearchPressed != null && (appState.showSearchButton || appState.showRouteButton)) const SizedBox(height: 8), + ], // Layer selector button const LayerSelectorButton(),