Best Value: rename the remaining user-facing copy, hide the sheet section when off

Following the sort-segment rename, the rest of the user-facing "Worth the Drive"
copy moves to "Best Value".

- Settings: the toggle is now just "Best Value" (was "Enable Worth the Drive"),
  and the narrative footer opens "Best Value estimates fuel cost only, …".
- More info sheet: the section header is "Best Value" (was "Worth the drive?"),
  and the section itself is now conditional. `fuelSavings` is nil whenever the
  feature is off — `savingsLookup` returns nil when it is not configured — so
  the heading is never left dangling over an empty section while the feature is
  disabled.
- The unavailable text reads "Best Value unavailable: …".
- Comments and doc comments that named the sort were updated so they match the
  UI instead of contradicting it.

Deliberately unchanged: the enum's raw value stays `worthTheDrive`, so stored
sort preferences and widget configs keep decoding, and FuelSavingsStatus keeps
its verdict wording ("Worth the drive" / "Not worth the drive") — that describes
a station's verdict rather than the feature, and is not shown in the UI.

Verified on the simulator: with the feature OFF the more info sheet shows
Address / Distance / Directions and no heading at all; with it ON the sheet
shows the "Best Value" section; Settings reads "Fuel Savings" / "Best Value"
with no "Enable" anywhere. 172 tests, 0 failures.
This commit is contained in:
FuelBoard Contributor
2026-10-11 20:11:57 +01:00
parent 801f969644
commit d348157a45
7 changed files with 31 additions and 23 deletions
+1 -1
View File
@@ -398,7 +398,7 @@ enum FuelSavingsEstimator {
}
}
/// Ranks a whole pool for the Worth the Drive sort.
/// Ranks a whole pool for the Best Value sort.
///
/// EVERY priced station in the pool gets an estimate, not just the handful
/// whose road routes happen to have been measured: journeys that have no
+4 -4
View File
@@ -53,10 +53,10 @@ enum SortMode: String, Codable, CaseIterable, Identifiable {
switch self {
case .cheapest: return "Cheapest"
case .closest: return "Closest"
// "Best Value" is the user-facing name of this sort. The raw value stays
// `worthTheDrive` so stored preferences keep decoding, and it is the SORT
// that is called Best Value — the Fuel Savings feature itself is still
// "Worth the Drive" (its Settings toggle, section and sheet header).
// "Best Value" is the user-facing name of this sort — the segmented
// control, the Stations caption, the Settings toggle and narrative, and
// the sheet's section header all read it. The raw value stays
// `worthTheDrive` so stored preferences and widget configs keep decoding.
case .worthTheDrive: return "Best Value"
}
}