Widget opens Maps via maps://; onboarding prompts after Continue; forced first fetch

- Widget tap-to-directions now uses the native maps:// scheme instead of
  http://maps.apple.com. The universal-link http URL failed to open from a
  widget and fell back to launching the containing app; maps:// opens
  Apple Maps directly for both small (whole widget) and medium (per row).
- Onboarding: removed the Skip button (mandatory flow), and system prompts
  (location, notifications, local network) now fire only when the user taps
  Continue/Allow on each page — not when the page appears. Pages
  auto-advance once a permission is granted.
- After 'Start Using FuelBoard' the first data fetch is forced, so a
  reinstall that leaves a recent lastRefresh in app-group defaults can no
  longer skip the fetch and leave the station list empty. 35 tests pass.
This commit is contained in:
FuelBoard Contributor
2026-08-12 12:41:19 +01:00
parent 2a8de27571
commit 9ce0c83d66
4 changed files with 38 additions and 26 deletions
+6 -3
View File
@@ -182,13 +182,16 @@ struct ContentView: View {
.onChange(of: showOnboarding) { _, showing in
// After onboarding finishes (or the test re-run is dismissed),
// begin foreground location tracking if permission allows, and
// run the first data fetch (the relay probe during onboarding
// already surfaced the Local Network prompt).
// run the FIRST data fetch. This must be a forced refresh: a
// reinstall may leave a recent `lastRefresh` in the app-group
// defaults (which survive app deletion), which would make the
// cache-gated refresh skip the fetch and leave the station list
// empty on a brand-new install.
if !showing, FuelStore.loadHasCompletedOnboarding() {
locationManager.startForegroundTracking()
monitor.update(stations: stations, favourites: refreshedFavourites,
fuel: alertsFuel, radiusKM: alertsRadius)
Task { await refresh() }
Task { await refresh(force: true) }
}
}
.onChange(of: scenePhase) { _, newPhase in