Make Closest a station label and retire Top
Top and Cheapest were two words for one state: both meant "the lowest price among the stations on screen", differing only in the candidate set (radius vs Favourites). Which word a surface used had drifted by device — the phone's rows said Cheapest while the watch said Top for the identical state. Top is gone from the enum, the Key legend, the badge and the watch's hand-rolled label; Cheapest survives because it names the measure and is already the word the favourites copy uses. Closest is now a real station label rather than a verdict. StationRecommendationBadge gains .closest with a total precedence — Best value, then Cheapest, then Closest — because a row has room for one label and proximity is the weakest claim: a short drive says nothing about the price, and unlike the other two it reports no saving at all. The badge sits above the price, where the other two sit. The closest row's verdict capsule is suppressed: its only word for that state was "Closest", so printing it below as well would state the same fact twice, three lines apart. Other rows keep their Saves / Break even / Costs capsules unchanged. "Closest station" becomes "Closest", read from the single FuelSavingsResult.baselineHeadline constant so the badge, the verdict and the Key cannot word it differently. The Key legend renders all three station labels with the shared StationLabelBadge; the old KeyStationLabelIndicator, which special-cased the closest station to a wider verdict pill so it read as a different class of thing from the two above it, is deleted. One closest icon everywhere. The listing and detail verdict symbols used location.circle and location.circle.fill for the state the Key taught as location.north.fill; both now read StationLabelKind.closest.symbol, so the three surfaces resolve one glyph from one place. The detail sheet gains the Closest capsule below the map, ordered to match the Key. Favourites gains the nearest favourite as its Closest, measured on the same one-way distance its rows print and restricted to favourites with a price for the active fuel — matching the radius tab, where the closest station is by definition the savings baseline. closestStationID flows from the one scaffold baseline the savings lookup already compares against, so a row's badge and the reference station cannot disagree. No savings calculation, threshold, ranking, eligibility or station-selection logic changed. The Key sheet's detent is now bound rather than fixed, so dragging it up to read the Station labels section sticks instead of snapping back; a QA launch argument opens it at full height, since the 0.6 detent puts that section below the fold on every device. That argument is read unconditionally, unlike the other harness hooks which are #if DEBUG-gated. Tests: 278 pass, 9 new — the label precedence ladder across every combination, capsule order in the sheet, Closest alone, and the retired label pinned absent.
This commit is contained in:
@@ -64,17 +64,10 @@ extension CapsuleTone {
|
||||
/// Neutral grey: proximity. Same family as `breakEven` — both mean "no
|
||||
/// judgement" — but kept as its own pair so proximity and a break-even
|
||||
/// verdict stay independently tunable.
|
||||
static let closestStation = CapsuleTone(
|
||||
static let closest = CapsuleTone(
|
||||
lightForeground: Color(hex: 0x525967), lightBackground: Color(hex: 0xE8EAF0),
|
||||
darkForeground: Color(hex: 0xC0C3CC), darkBackground: Color(hex: 0x424349)
|
||||
)
|
||||
|
||||
/// Blue, like `cheapest`: the top favourite IS the cheapest favourite, so it
|
||||
/// must not read as a different class of thing.
|
||||
static let top = CapsuleTone(
|
||||
lightForeground: Color(hex: 0x225F9B), lightBackground: Color(hex: 0xE0EFFB),
|
||||
darkForeground: Color(hex: 0x8BC5FA), darkBackground: Color(hex: 0x293F53)
|
||||
)
|
||||
}
|
||||
|
||||
/// The one shape rule every capsule in the app follows.
|
||||
@@ -83,9 +76,10 @@ extension CapsuleTone {
|
||||
/// wraps. A pill's semicircular ends crowd the text corners at two lines or
|
||||
/// more, while a 10pt radius does not. The shape follows what the content
|
||||
/// actually DREW, not how many lines it declared, because a label can wrap in a
|
||||
/// narrow column without the data changing — "Closest station" is the case that
|
||||
/// forced this: one declared line that wraps to two in the listing's price
|
||||
/// column.
|
||||
/// narrow column without the data changing — the baseline label was the case that
|
||||
/// forced this: "Closest station" was one declared line that wrapped to two in the
|
||||
/// listing's price column, which is also why that label is now the single word
|
||||
/// "Closest".
|
||||
///
|
||||
/// Measuring happens on the content BEFORE padding, so the drawn line count is
|
||||
/// never inflated by the capsule's own insets.
|
||||
|
||||
Reference in New Issue
Block a user