Clarify Best Value route confidence
This commit is contained in:
@@ -2,6 +2,12 @@ import SwiftUI
|
||||
import MapKit
|
||||
import UIKit
|
||||
|
||||
/// DEBUG-only explanation of the Best Value numbers for one station. It carries
|
||||
/// no precise user coordinates and is never persisted.
|
||||
struct FuelSavingsJourneyDiagnostics {
|
||||
let rows: [(label: String, value: String)]
|
||||
}
|
||||
|
||||
/// Detail sheet for a tapped station (when Settings → Tap station = More info).
|
||||
/// Shows a small map preview, the address, distance from the current location,
|
||||
/// and a Directions button that opens Apple Maps — the same destination a direct
|
||||
@@ -14,6 +20,7 @@ struct StationDetailView: View {
|
||||
var fuelSavings: FuelSavingsAvailability? = nil
|
||||
var fuelSavingsAmount: FuelSavingsFillAmount = FuelSavingsSettings.defaultPreferredAmount
|
||||
var savingsBaselineStationName: String? = nil
|
||||
var journeyDiagnostics: FuelSavingsJourneyDiagnostics? = nil
|
||||
/// Whether this station is starred for the fuel currently being viewed, and
|
||||
/// the toggle that flips it. Passed from the list that opened the sheet, so
|
||||
/// the star here and the star on the row are the same fuel-scoped
|
||||
@@ -86,6 +93,18 @@ struct StationDetailView: View {
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if let journeyDiagnostics {
|
||||
Section("Best Value Diagnostics") {
|
||||
ForEach(journeyDiagnostics.rows, id: \.label) { row in
|
||||
LabeledContent(row.label, value: row.value)
|
||||
.font(.caption)
|
||||
.monospacedDigit()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Section {
|
||||
Button {
|
||||
if let url = station.mapsDirectionsURL {
|
||||
|
||||
Reference in New Issue
Block a user