Live-test fixes: CarPlay disfavor, widget location refresh, debug cheapest parity

1. CarPlay widget taps could never launch Maps — FuelBoard is not a
   CarPlay app, and Apple only lets a widget launch its own app in
   CarPlay when that app is CarPlay-enabled. Marked the widget as a
   disfavored CarPlay location (iOS 26+; no-op below): read-only in
   the car, no dead tap. Header comment updated to match reality.

2. Widgets now track the user's location: timeline refresh 15m -> 5m,
   and the app's location manager reloads all widget timelines after
   every significant move (250m filter, throttled to 60s), so the
   widget re-orders around the new position while driving instead of
   waiting for the next tick.

3. Debug 'Cheapest in range' no longer shows the ALERT prediction
   (alertsFuel + alert radius — a different pool by design). It now
   mirrors the app list exactly: the TOP-badge station for the
   selected fuel within the stationLimit radius (new DebugAppCheapest
   computed in ContentView, passed to Settings). Alert-prediction
   cheapest kept as fallback when the app view hasn't resolved.
This commit is contained in:
FuelBoard Contributor
2026-08-12 18:01:29 +01:00
parent d37aab04f1
commit f822bd2636
4 changed files with 95 additions and 13 deletions
+12
View File
@@ -18,6 +18,18 @@ struct DebugLocationStatus: Equatable {
var cheapestDistanceKM: Double?
}
/// App-view cheapest for the Debug section: mirrors EXACTLY what the Stations
/// list computes (selected fuel, stationLimit radius, current location), so
/// the debug "Cheapest in range" row matches the TOP badge in the app
/// not the alert prediction (which uses alertsFuel + alert radius, a
/// different pool by design).
struct DebugAppCheapest: Equatable {
let station: FuelStation
let fuel: FuelType
let radiusKM: Double
let distanceKM: Double
}
/// A station the user wants to see on a map set when a notification tap
/// can't hand off to Apple Maps (e.g. inside LiveContainer), so the app shows
/// an in-app map with directions instead.