Add Best Value small widget and standardise Closest wording
This commit is contained in:
@@ -21,8 +21,8 @@ struct FavouritesView: View {
|
||||
/// still never touches the Settings default.
|
||||
let fuelSavingsSettings: FuelSavingsSettings
|
||||
@Binding var fuelSavingsAmount: FuelSavingsFillAmount
|
||||
/// Estimated saving for a favourite, against the nearest eligible station —
|
||||
/// the same baseline and definition the Stations list uses.
|
||||
/// Estimated saving for a favourite, against the closest eligible station by
|
||||
/// journey distance — the same baseline and definition the Stations list uses.
|
||||
var savingsForStation: (FuelStation) -> FuelSavingsAvailability? = { _ in nil }
|
||||
var journeyDiagnosticsForStation: (FuelStation) -> FuelSavingsJourneyDiagnostics? = { _ in nil }
|
||||
var onToggleFavourite: (FuelStation, FuelType) -> Void = { _, _ in }
|
||||
@@ -149,7 +149,7 @@ struct FavouritesView: View {
|
||||
referencePricePencePerLitre: cheapestPrice
|
||||
)
|
||||
} footer: {
|
||||
Text(String(localized: "Savings below are estimated against the nearest station with a price for this fuel — the same baseline as the Stations list.", comment: "Favourites fuel-savings explanation"))
|
||||
Text(String(localized: "Savings below are estimated against the closest eligible station by journey distance — the same baseline as the Stations list.", comment: "Favourites fuel-savings explanation"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ struct FuelSavingsSummaryView: View {
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.75)
|
||||
.layoutPriority(1)
|
||||
.accessibilityLabel("Comparison: \(comparisonLabel(for: result))")
|
||||
}
|
||||
@@ -131,8 +130,16 @@ struct FuelSavingsSummaryView: View {
|
||||
// room for. The old shape led with a status word + headline that
|
||||
// matched neither the listing nor each other.
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
capsule(for: result, compact: false)
|
||||
.accessibilityLabel(accessibilityHeadline(for: result))
|
||||
HStack(alignment: .firstTextBaseline, spacing: 6) {
|
||||
capsule(for: result, compact: false)
|
||||
.accessibilityLabel(accessibilityHeadline(for: result))
|
||||
Text(comparisonLabel(for: result))
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
.layoutPriority(1)
|
||||
.accessibilityLabel("Comparison: \(comparisonLabel(for: result))")
|
||||
}
|
||||
LabeledContent("Your fill-up", value: amountText)
|
||||
LabeledContent("Fuel you'll receive", value: String(format: "%.2f litres", result.fillLitres))
|
||||
.monospacedDigit()
|
||||
@@ -147,11 +154,11 @@ struct FuelSavingsSummaryView: View {
|
||||
.accessibilityLabel(spokenExtraTravel(for: result, fallback: extraTravel))
|
||||
}
|
||||
if result.status == .baseline {
|
||||
Text("Your closest station with a price for this fuel — every other saving is measured against it.")
|
||||
Text("Your closest eligible station by journey distance is the baseline — every other saving is measured against it.")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
Text("Compared with \(baselineStationName ?? "your nearest station").")
|
||||
Text("Compared with \(baselineStationName ?? "your closest station").")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
LabeledContent(
|
||||
@@ -247,7 +254,6 @@ struct FuelSavingsSummaryView: View {
|
||||
.accessibilityHidden(true)
|
||||
Text(result.capsuleHeadline())
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.8)
|
||||
}
|
||||
.font(compact ? .caption.weight(.semibold) : .headline)
|
||||
.foregroundStyle(capsuleColor(for: result.status))
|
||||
|
||||
@@ -14,7 +14,7 @@ struct HowBestValueSheet: View {
|
||||
List {
|
||||
Section {
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text("Best Value compares each station with the closest one. It works out what you could save at the pump, then takes off the fuel used for the extra return journey.")
|
||||
Text("Best Value compares each station with the closest eligible station by journey distance. It works out what you could save at the pump, then takes off the fuel used for the extra return journey.")
|
||||
Text("Your fill-up amount and MPG are used to show whether you could save overall.")
|
||||
Text("Results are marked “Approx.” until road distances are available.")
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
@@ -156,7 +156,7 @@ struct OnboardingView: View {
|
||||
permissionStatusLabel(
|
||||
granted: prompter.locationGranted,
|
||||
denied: prompter.locationDenied,
|
||||
deniedText: String(localized: "Location was denied. You can still browse all stations, but \"nearest\" sorting needs it.", comment: "Onboarding location denied text")
|
||||
deniedText: String(localized: "Location was denied. You can still browse all stations, but \"closest\" sorting needs it.", comment: "Onboarding location denied text")
|
||||
)
|
||||
.padding(.top, 24)
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ struct SettingsView: View {
|
||||
} header: {
|
||||
Text("Debug")
|
||||
} footer: {
|
||||
Text("The first button applies the real criteria — cheapest \(alertsFuel.displayName.lowercased()) station within \(distanceUnit.format(alertsRadiusKM)) of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (nearest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius.")
|
||||
Text("The first button applies the real criteria — cheapest \(alertsFuel.displayName.lowercased()) station within \(distanceUnit.format(alertsRadiusKM)) of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (closest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius.")
|
||||
}
|
||||
.onAppear { onRefreshDebugStatus() }
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ struct StationsView: View {
|
||||
}
|
||||
if location != nil {
|
||||
if sortMode == .closest {
|
||||
return "\(mode) \(fuel) stations — nearest first, best value within \(miles) \(unit) · \(ratio) stations updated"
|
||||
return "\(mode) \(fuel) stations — closest first, best value within \(miles) \(unit) · \(ratio) stations updated"
|
||||
}
|
||||
return "\(mode) \(fuel) within \(miles) \(unit) — \(ratio) stations updated · \(tapHint)"
|
||||
}
|
||||
@@ -93,7 +93,7 @@ struct StationsView: View {
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
// In Closest mode the whole country is the pool — the
|
||||
// radius is meaningless ("nearest" must never return an
|
||||
// radius is meaningless ("closest" must never return an
|
||||
// empty state), so the picker is disabled but its value is
|
||||
// kept for when the user switches back to Cheapest.
|
||||
.disabled(sortMode == .closest)
|
||||
|
||||
@@ -94,7 +94,8 @@ struct WidgetMockScreen: View {
|
||||
isFavourites: false,
|
||||
location: location,
|
||||
locationSource: location != nil ? "live" : "none",
|
||||
unit: FuelStore.loadDistanceUnit()
|
||||
unit: FuelStore.loadDistanceUnit(),
|
||||
bestValueResult: nil
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"TOP" = "TOP";
|
||||
|
||||
/* Stations tab */
|
||||
"Closest %@ stations — nearest first, best value within %lld %@ · %lld stations" = "Closest %@ stations — nearest first, best value within %lld %@ · %lld stations";
|
||||
"Closest %@ stations — closest first, best value within %lld %@ · %lld stations" = "Closest %@ stations — closest first, best value within %lld %@ · %lld stations";
|
||||
"Cheapest %@ within %lld %@ — %lld stations · tap a station for directions." = "Cheapest %@ within %lld %@ — %lld stations · tap a station for directions.";
|
||||
"%@ %@ — tap a station for directions." = "%@ %@ — tap a station for directions.";
|
||||
"Fuel type" = "Fuel type";
|
||||
@@ -81,7 +81,7 @@
|
||||
"Test alert notification (real data)" = "Test alert notification (real data)";
|
||||
"Send plain test notification" = "Send plain test notification";
|
||||
"Debug" = "Debug";
|
||||
"The first button applies the real criteria — cheapest %@ station within %@ of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (nearest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius." = "The first button applies the real criteria — cheapest %@ station within %@ of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (nearest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius.";
|
||||
"The first button applies the real criteria — cheapest %@ station within %@ of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (closest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius." = "The first button applies the real criteria — cheapest %@ station within %@ of you — and sends the actual station's name, price and coordinates. The second fires with no criteria at all (closest seller), still carrying a real station, just to verify a notification appears and tapping it opens directions. Cheapest in range mirrors the app list (selected fuel + distance); the in-range count mirrors the alert radius.";
|
||||
"Widget Diagnostics" = "Widget Diagnostics";
|
||||
"Each beacon is written by the widget extension at the end of every timeline entry for that intent type (keychain, so it survives free-SideStore installs). A missing SMALL beacon after adding the small widget means its timeline never reaches the provider. Installed widgets come from WidgetCenter." = "Each beacon is written by the widget extension at the end of every timeline entry for that intent type (keychain, so it survives free-SideStore installs). A missing SMALL beacon after adding the small widget means its timeline never reaches the provider. Installed widgets come from WidgetCenter.";
|
||||
"SMALL: %@" = "SMALL: %@";
|
||||
@@ -139,7 +139,7 @@
|
||||
"Connection shows the source of the current prices (CSV mirror or API). Data updated is the latest price change reported by the GOV.UK server itself. Prices use the UK Fuel Finder dataset (Open Government Licence) and refresh up to twice a day." = "Connection shows the source of the current prices (CSV mirror or API). Data updated is the latest price change reported by the GOV.UK server itself. Prices use the UK Fuel Finder dataset (Open Government Licence) and refresh up to twice a day.";
|
||||
"Prices near you" = "Prices near you";
|
||||
"FuelBoard uses your location to show prices around you and rank stations by distance. Your position never leaves the device." = "FuelBoard uses your location to show prices around you and rank stations by distance. Your position never leaves the device.";
|
||||
"Location was denied. You can still browse all stations, but \"nearest\" sorting needs it." = "Location was denied. You can still browse all stations, but \"nearest\" sorting needs it.";
|
||||
"Location was denied. You can still browse all stations, but \"closest\" sorting needs it." = "Location was denied. You can still browse all stations, but \"closest\" sorting needs it.";
|
||||
"Allowed" = "Allowed";
|
||||
"The system prompt will appear next." = "The system prompt will appear next.";
|
||||
"FuelBoard can notify you when you're approaching the cheapest station in your alert radius — even with the app closed. You can switch this off in the Alerts tab." = "FuelBoard can notify you when you're approaching the cheapest station in your alert radius — even with the app closed. You can switch this off in the Alerts tab.";
|
||||
|
||||
@@ -457,15 +457,15 @@ final class FuelSavingsEstimateTests: XCTestCase {
|
||||
func testCompactComparisonLabelUsesGenericNearestStationWording() {
|
||||
XCTAssertEqual(
|
||||
FuelSavingsFormat.comparisonLabel(status: .worthTheDrive),
|
||||
"vs nearest station"
|
||||
"vs closest station"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
FuelSavingsFormat.comparisonLabel(status: .notWorthTheDrive),
|
||||
"vs nearest station"
|
||||
"vs closest station"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
FuelSavingsFormat.comparisonLabel(status: .breakEven),
|
||||
"vs nearest station"
|
||||
"vs closest station"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
FuelSavingsFormat.comparisonLabel(status: .baseline),
|
||||
@@ -505,7 +505,7 @@ final class FuelSavingsEstimateTests: XCTestCase {
|
||||
netSavingGBP: 0,
|
||||
status: .baseline
|
||||
)
|
||||
XCTAssertEqual(baseline.capsuleHeadline(), "Closest station · your baseline")
|
||||
XCTAssertEqual(baseline.capsuleHeadline(), "Closest station")
|
||||
|
||||
let saving = FuelSavingsResult(
|
||||
fillLitres: 30,
|
||||
|
||||
@@ -95,7 +95,8 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
data: FuelPriceWidgetEntryData(
|
||||
date: Date(), stations: Array(sample.prefix(8)),
|
||||
fuel: .e10, sort: .cheapest, isFavourites: false,
|
||||
location: nil, locationSource: "none", unit: unit
|
||||
location: nil, locationSource: "none", unit: unit,
|
||||
bestValueResult: nil
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -146,7 +147,8 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
// Per-widget config: fuel + sort + distance come from THIS widget instance.
|
||||
let fuel = FuelType(rawValue: configuration.fuel.rawValue) ?? .e10
|
||||
let isFavourites = configuration.sort == .favourites
|
||||
let sort: SortMode = configuration.sort == .closest ? .closest : .cheapest
|
||||
let sort: SortMode = configuration.sort == .closest ? .closest :
|
||||
(configuration.sort == .worthTheDrive ? .worthTheDrive : .cheapest)
|
||||
let radiusKM = Double(configuration.distance.miles) * FuelSavingsCalculator.kilometresPerMile
|
||||
|
||||
// 1) Try a fresh location fix (bounded to a few seconds). The fix's own
|
||||
@@ -200,6 +202,7 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
|
||||
// 3) Load + order stations per widget mode.
|
||||
let ordered: [FuelStation]
|
||||
var bestValueResult: FuelSavingsResult?
|
||||
if isFavourites {
|
||||
let favourites = FuelStore.loadFavourites()
|
||||
.filter { $0.station.prices[$0.fuel] != nil }
|
||||
@@ -265,7 +268,7 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
let filtered = stations.filter { $0.prices[fuel] != nil }
|
||||
switch sort {
|
||||
case .closest:
|
||||
// Nearest first; price only breaks ties.
|
||||
// Closest first; price only breaks ties.
|
||||
ordered = filtered.sorted { lhs, rhs in
|
||||
if let origin {
|
||||
let lDist = FuelStore.displayDistanceKM(station: lhs, userLat: origin.lat, userLng: origin.lng)
|
||||
@@ -274,9 +277,59 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
}
|
||||
return lhs.prices[fuel]! < rhs.prices[fuel]!
|
||||
}
|
||||
case .cheapest, .worthTheDrive:
|
||||
// Cheapest first; distance only breaks ties. Worth-the-Drive is app-only;
|
||||
// widgets fall back to cheapest ordering if a stored config ever carries it.
|
||||
case .worthTheDrive:
|
||||
guard let origin else {
|
||||
ordered = filtered.sorted { $0.prices[fuel]! < $1.prices[fuel]! }
|
||||
break
|
||||
}
|
||||
let journey: (FuelStation) -> FuelSavingsJourney? = { station in
|
||||
if let meters = FuelStore.roadJourneyMeters(for: station, userLat: origin.lat, userLng: origin.lng) {
|
||||
let confidence: JourneyConfidence = FuelStore.hasMeasuredReturnRoadDistance(
|
||||
for: station, userLat: origin.lat, userLng: origin.lng
|
||||
) ? .confirmed : .estimated
|
||||
return FuelSavingsJourney(
|
||||
miles: meters / FuelSavingsCalculator.metresPerMile,
|
||||
basis: .roadRoute,
|
||||
confidence: confidence
|
||||
)
|
||||
}
|
||||
return FuelSavingsJourney(
|
||||
miles: FuelStore.displayDistanceKM(station: station, userLat: origin.lat, userLng: origin.lng) /
|
||||
FuelSavingsCalculator.kilometresPerMile * 2,
|
||||
basis: .straightLine,
|
||||
confidence: .estimated
|
||||
)
|
||||
}
|
||||
let settings = FuelStore.loadFuelSavingsSettings()
|
||||
guard settings.isConfigured else {
|
||||
ordered = filtered.sorted { $0.prices[fuel]! < $1.prices[fuel]! }
|
||||
break
|
||||
}
|
||||
let amount = settings.preferredAmount
|
||||
let baseline = FuelSavingsEstimator.baselineStation(filtered, fuel: fuel, journeyMiles: journey)
|
||||
let ranked = FuelSavingsEstimator.ranked(
|
||||
filtered,
|
||||
fuel: fuel,
|
||||
baseline: baseline,
|
||||
settings: settings,
|
||||
amount: amount,
|
||||
journeyMiles: journey
|
||||
)
|
||||
ordered = ranked
|
||||
if let first = ranked.first, let baseline {
|
||||
let baselineJourney = journey(baseline)
|
||||
let result = FuelSavingsEstimator.availability(
|
||||
station: first,
|
||||
fuel: fuel,
|
||||
baseline: baseline,
|
||||
settings: settings,
|
||||
amount: amount,
|
||||
journey: journey(first),
|
||||
baselineJourney: baselineJourney
|
||||
)
|
||||
bestValueResult = result?.result
|
||||
}
|
||||
case .cheapest:
|
||||
ordered = filtered.sorted { lhs, rhs in
|
||||
let lPrice = lhs.prices[fuel]!
|
||||
let rPrice = rhs.prices[fuel]!
|
||||
@@ -295,7 +348,7 @@ struct FuelPriceTimelineProvider<Configuration: WidgetConfigurationIntent & Widg
|
||||
date: Date(), stations: Array(ordered.prefix(8)),
|
||||
fuel: fuel, sort: sort, isFavourites: isFavourites,
|
||||
location: origin, locationSource: source,
|
||||
unit: unit
|
||||
unit: unit, bestValueResult: bestValueResult
|
||||
)
|
||||
), originSource)
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ enum WidgetFuel: String, AppEnum, CaseIterable, Codable {
|
||||
enum WidgetSort: String, AppEnum, CaseIterable, Codable {
|
||||
case cheapest
|
||||
case closest
|
||||
case worthTheDrive
|
||||
case favourites
|
||||
|
||||
static var typeDisplayRepresentation: TypeDisplayRepresentation = "Sort by"
|
||||
@@ -37,6 +38,7 @@ enum WidgetSort: String, AppEnum, CaseIterable, Codable {
|
||||
static var caseDisplayRepresentations: [WidgetSort: DisplayRepresentation] = [
|
||||
.cheapest: "Cheapest",
|
||||
.closest: "Closest",
|
||||
.worthTheDrive: "Best Value",
|
||||
.favourites: "Favourites",
|
||||
]
|
||||
}
|
||||
@@ -112,9 +114,17 @@ struct FuelBoardWidgetConfigurationIntent: WidgetConfigurationIntent, WidgetConf
|
||||
\.$sort
|
||||
}
|
||||
} otherwise: {
|
||||
Summary("Show \(\.$fuel) by \(\.$sort)") {
|
||||
\.$fuel
|
||||
\.$sort
|
||||
When(\.$sort, .equalTo, WidgetSort.worthTheDrive) {
|
||||
Summary("Show \(\.$fuel) by \(\.$sort) within \(\.$distance)") {
|
||||
\.$fuel
|
||||
\.$sort
|
||||
\.$distance
|
||||
}
|
||||
} otherwise: {
|
||||
Summary("Show \(\.$fuel) by \(\.$sort)") {
|
||||
\.$fuel
|
||||
\.$sort
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,12 @@ struct FuelPriceWidgetEntryData {
|
||||
let date: Date
|
||||
let stations: [FuelStation] // already filtered + sorted per config
|
||||
let fuel: FuelType
|
||||
let sort: SortMode // per-widget: cheapest | closest
|
||||
let isFavourites: Bool // favourites mode: pinned stations, cheapest-first
|
||||
let sort: SortMode // per-widget: cheapest | closest | Best Value
|
||||
let isFavourites: Bool // favourites mode: pinned stations
|
||||
let location: Coordinate?
|
||||
let locationSource: String // "live" | "cached" | "none"
|
||||
let unit: DistanceUnit // user's display unit for distances
|
||||
let bestValueResult: FuelSavingsResult? // only populated for the small Best Value face
|
||||
}
|
||||
|
||||
/// The widget face, parameterised by family so the app can preview it.
|
||||
@@ -67,9 +68,11 @@ struct FuelPriceWidgetContent: View {
|
||||
|
||||
private var heading: String {
|
||||
if entry.isFavourites { return "Favourite \(entry.fuel.displayName)" }
|
||||
return entry.sort == .closest
|
||||
? "Closest \(entry.fuel.displayName)"
|
||||
: "Cheapest \(entry.fuel.displayName)"
|
||||
switch entry.sort {
|
||||
case .closest: return "Closest \(entry.fuel.displayName)"
|
||||
case .worthTheDrive: return "Best Value \(entry.fuel.displayName)"
|
||||
case .cheapest: return "Cheapest \(entry.fuel.displayName)"
|
||||
}
|
||||
}
|
||||
|
||||
private var singleStation: some View {
|
||||
@@ -85,7 +88,15 @@ struct FuelPriceWidgetContent: View {
|
||||
Text(station.name)
|
||||
.font(.headline)
|
||||
.lineLimit(1)
|
||||
if let price = station.prices[entry.fuel] {
|
||||
if entry.sort == .worthTheDrive, let result = entry.bestValueResult {
|
||||
Text(result.headline(compact: true))
|
||||
.font(.title3.weight(.bold))
|
||||
.lineLimit(1)
|
||||
Text(result.status == .baseline ? "your baseline" : "vs closest station")
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
} else if let price = station.prices[entry.fuel] {
|
||||
FuelStore.priceTextAttributed(price, size: 26, weight: .bold, color: .green)
|
||||
}
|
||||
if let location = entry.location {
|
||||
|
||||
@@ -144,10 +144,10 @@ enum FuelSavingsFormat {
|
||||
}
|
||||
|
||||
/// Compact comparison copy kept outside the coloured verdict capsule.
|
||||
/// "Nearest" refers to the existing shortest-journey baseline selection;
|
||||
/// "Closest" refers to the existing shortest-journey baseline selection;
|
||||
/// it does not claim a straight-line comparison.
|
||||
static func comparisonLabel(status: FuelSavingsStatus) -> String {
|
||||
status == .baseline ? "your baseline" : "vs nearest station"
|
||||
status == .baseline ? "your baseline" : "vs closest station"
|
||||
}
|
||||
|
||||
/// VoiceOver form of `extraTravelLabel`. The abbreviation and the unit suffix
|
||||
@@ -222,13 +222,11 @@ extension FuelSavingsResult {
|
||||
headline().replacingOccurrences(of: "Approx. ", with: "Approximately ")
|
||||
}
|
||||
|
||||
/// Row capsule copy: the headline, plus what the baseline row IS. Without the
|
||||
/// suffix the baseline capsule just repeated the status word above it
|
||||
/// ("Closest station" twice) and said nothing about the saving being measured
|
||||
/// against it.
|
||||
/// Row capsule copy. The baseline relationship is shown as secondary text
|
||||
/// beside the capsule in the station listing and detail summary, so the
|
||||
/// capsule itself contains only the verdict.
|
||||
func capsuleHeadline() -> String {
|
||||
let headline = headline(compact: true)
|
||||
return status == .baseline ? "\(headline) · your baseline" : headline
|
||||
headline(compact: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user