feat: honour Tap station action in widgets
Small widgetURL and medium list Links route through StationTapAction via FuelStation.tapDestinationURL: Open map keeps the Maps URL, More info uses a fuelboard://station deep link (stationID plus coordinate/name fallback). Deep link carries fallback coords; ContentView presents the detail sheet when the station is cached, else the map sheet. Live Activity detailURL upgraded to the same rich link.
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
//
|
||||
// Lives in the widget extension (the standard host for ActivityConfiguration).
|
||||
// Shows the cheapest station for the pinned fuel within the app's chosen
|
||||
// radius. Tapping anywhere opens Apple Maps directions to that station.
|
||||
// radius. Tapping honours Settings → Tap station: Open map opens Apple Maps
|
||||
// directions to that station, More info opens the detail sheet in the app.
|
||||
//
|
||||
// ADAPTIVE LAYOUT: the Lock Screen body provides two layouts and lets
|
||||
// ViewThatFits pick by available width, but the narrow `.small` family is NOT
|
||||
@@ -254,8 +255,19 @@ extension FuelBoardLiveActivityAttributes.ContentState {
|
||||
}
|
||||
|
||||
/// In-app deep link to the station's detail sheet, used when
|
||||
/// Settings → Tap station = More info.
|
||||
/// Settings → Tap station = More info. Carries coordinate/name fallback
|
||||
/// so the app can still show the map sheet when the station has left
|
||||
/// the cache.
|
||||
var detailURL: URL {
|
||||
URL(string: "fuelboard://station?stationID=\(stationID)")!
|
||||
var components = URLComponents()
|
||||
components.scheme = "fuelboard"
|
||||
components.host = "station"
|
||||
components.queryItems = [
|
||||
URLQueryItem(name: "stationID", value: stationID),
|
||||
URLQueryItem(name: "lat", value: String(lat)),
|
||||
URLQueryItem(name: "lng", value: String(lng)),
|
||||
URLQueryItem(name: "name", value: stationName),
|
||||
]
|
||||
return components.url!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user