nav UX tweaks

This commit is contained in:
stopflock
2025-12-05 16:36:04 -06:00
parent b1a39a2320
commit 8c4f53ff7b
5 changed files with 44 additions and 11 deletions

View File

@@ -1,4 +1,10 @@
{
"1.6.3": {
"content": [
"• Fixed navigation sheet button flow - route to/from buttons no longer reappear after selecting second location",
"• Added cancel button when selecting second route point for easier exit from route planning"
]
},
"1.6.2": {
"content": [
"• Improved node rendering bounds - nodes appear slightly before sliding into view and stay visible until just after sliding out, eliminating edge blinking",

View File

@@ -61,7 +61,7 @@ const Duration kChangesetAutoCloseTimeout = Duration(minutes: 59); // Give up an
const double kChangesetCloseBackoffMultiplier = 2.0;
// Navigation routing configuration
const Duration kNavigationRoutingTimeout = Duration(seconds: 30); // HTTP timeout for routing requests
const Duration kNavigationRoutingTimeout = Duration(seconds: 60); // HTTP timeout for routing requests
// Suspected locations CSV URL
const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv';

View File

@@ -207,8 +207,15 @@ class NavigationState extends ChangeNotifier {
_routeEndAddress = _provisionalPinAddress;
}
// BRUTALIST FIX: Set calculating state BEFORE clearing isSettingSecondPoint
// to prevent UI from briefly showing route buttons again
_isSettingSecondPoint = false;
_isCalculating = true;
_routingError = null; // Clear any previous errors
// Notify listeners immediately to update UI before async calculation starts
notifyListeners();
_calculateRoute();
}

View File

@@ -93,8 +93,14 @@ class NavigationSheet extends StatelessWidget {
children: [
_buildDragHandle(),
// SEARCH MODE: Initial location with route options
if (navigationMode == AppNavigationMode.search && !appState.isSettingSecondPoint && !appState.isCalculating && !appState.showingOverview && provisionalLocation != null) ...[
// SEARCH MODE: Initial location with route options (only when no route points are set yet)
if (navigationMode == AppNavigationMode.search &&
!appState.isSettingSecondPoint &&
!appState.isCalculating &&
!appState.showingOverview &&
provisionalLocation != null &&
appState.routeStart == null &&
appState.routeEnd == null) ...[
_buildLocationInfo(
label: LocalizationService.instance.t('navigation.location'),
coordinates: provisionalLocation,
@@ -185,13 +191,27 @@ class NavigationSheet extends StatelessWidget {
const SizedBox(height: 16),
],
ElevatedButton.icon(
icon: const Icon(Icons.check),
label: Text(LocalizationService.instance.t('navigation.selectLocation')),
onPressed: appState.areRoutePointsTooClose ? null : () {
debugPrint('[NavigationSheet] Select Location button pressed');
appState.selectSecondRoutePoint();
},
Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.check),
label: Text(LocalizationService.instance.t('navigation.selectLocation')),
onPressed: appState.areRoutePointsTooClose ? null : () {
debugPrint('[NavigationSheet] Select Location button pressed');
appState.selectSecondRoutePoint();
},
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.close),
label: Text(LocalizationService.instance.t('actions.cancel')),
onPressed: () => appState.cancelNavigation(),
),
),
],
),
],

View File

@@ -1,7 +1,7 @@
name: deflockapp
description: Map public surveillance infrastructure with OpenStreetMap
publish_to: "none"
version: 1.6.2+28 # The thing after the + is the version code, incremented with each release
version: 1.6.3+29 # The thing after the + is the version code, incremented with each release
environment:
sdk: ">=3.5.0 <4.0.0" # oauth2_client 4.x needs Dart 3.5+