Refine the station listing: muted verdict capsules, three-line names
The listing's verdict capsule now carries white text on muted semantic fills instead of the neutral secondary tint: Saves #45825E, Costs #A9635B, Break even #707070, Closest #58789D. Fixed tones, not translucent tints, because white text on a 15% tint over a white row measures ~1.8:1. Each tone sits at a relative luminance of ~0.18 — the band where white clears 4.5:1 AND the pill still separates ~3:1 from both a white row and the dark card fill — so one value each works in light and dark without a dynamic colour. The saturated palette colours cannot carry white text at all: systemGreen measures 2.2:1, systemRed 3.6:1. "Save" becomes "Saves", matching the detail sheet and reading as a statement of the outcome; amounts, symbols, padding, radius and the shape-follows-line-count rule are unchanged. Saves and Costs share an 84pt minimum width so their trailing edges line up down the list. The price and its capsule are now one vertically grouped element (5pt), with the badge keeping the column's full 12pt above, so the row no longer reads as three equal lines. Station names cap at three lines with a tail ellipsis: unbounded wrap let one very long forecourt name set the height of the whole row. 59 of the 8,073 names in the dump exceed three lines and now ellipsise; the full name is always in Station Details. Addresses still wrap freely. The baseline pill moves onto ListingFuelSavingsCapsule so the listing shows the same soft blue and white text as its siblings, leaving FuelSavingsCapsule to the detail sheet, which it now alone uses. Badges keep their tinted styling: they annotate a price rather than report an outcome. Verified: 261/261 swift test; Debug simulator and Release device builds; all four fills and their white text measured from simulator pixels in both appearances, and the detail sheet's .blue absent from the listing entirely.
This commit is contained in:
+46
-37
@@ -1941,14 +1941,18 @@ struct StationRow: View {
|
||||
|
||||
// Name, full address, distance
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
// The name WRAPS instead of truncating: the row is tall
|
||||
// enough now, and a name cut to "Z A Service Stat…" cannot
|
||||
// be told apart from the station next door. Baseline
|
||||
// alignment keeps the notice symbols on the name's FIRST
|
||||
// line instead of floating beside a two-line name.
|
||||
// The name wraps, capped at THREE lines. The row is tall
|
||||
// enough for a two-line name, but an unbounded wrap let one
|
||||
// very long forecourt name set the height of the whole row —
|
||||
// the excessive row heights this refinement removes. Past
|
||||
// three lines the name ellipsises; the full name is always
|
||||
// in Station Details. Baseline alignment keeps the notice
|
||||
// symbols on the name's FIRST line instead of floating
|
||||
// beside a two-line name.
|
||||
HStack(alignment: .firstTextBaseline, spacing: 6) {
|
||||
Text(station.name)
|
||||
.font(.headline)
|
||||
.lineLimit(3)
|
||||
.multilineTextAlignment(.leading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
ForEach(StationNotice.notices(for: station)) { notice in
|
||||
@@ -2019,27 +2023,33 @@ struct StationRow: View {
|
||||
if let badge = recommendationBadge {
|
||||
badgeCapsule(badge)
|
||||
}
|
||||
// Price line: the status dot and the price, leading-aligned on
|
||||
// the column's one axis. The star no longer ends this line — it
|
||||
// sits under the station logo — so this whole column width now
|
||||
// belongs to the price, which is what lets the wide pounds &
|
||||
// pence form (£1.58⁷/L) render at full size rather than being
|
||||
// scaled down or truncated.
|
||||
if let price = station.prices[fuel] {
|
||||
HStack(spacing: 5) {
|
||||
PriceRatingDot(color: ragColor)
|
||||
FuelStore.priceTextAttributed(price, style: priceDisplayStyle,
|
||||
size: priceSize, weight: .bold)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.8)
|
||||
// The price and its verdict capsule are ONE vertically grouped
|
||||
// element: 5pt binds them as "this price, this outcome", while
|
||||
// the badge keeps the column's full 12pt above so the three
|
||||
// lines do not read as equals.
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
// Price line: the status dot and the price, leading-aligned
|
||||
// on the column's one axis. The star no longer ends this
|
||||
// line — it sits under the station logo — so this whole
|
||||
// column width now belongs to the price, which is what lets
|
||||
// the wide pounds & pence form (£1.58⁷/L) render at full
|
||||
// size rather than being scaled down or truncated.
|
||||
if let price = station.prices[fuel] {
|
||||
HStack(spacing: 5) {
|
||||
PriceRatingDot(color: ragColor)
|
||||
FuelStore.priceTextAttributed(price, style: priceDisplayStyle,
|
||||
size: priceSize, weight: .bold)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.8)
|
||||
}
|
||||
// The visible "+1.8p vs cheapest" line is gone with the
|
||||
// redesign, so the comparison rides on the price's label.
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel(priceSpokenLabel(price))
|
||||
}
|
||||
if let result = fuelSavings?.result {
|
||||
savingsCapsule(result)
|
||||
}
|
||||
// The visible "+1.8p vs cheapest" line is gone with the
|
||||
// redesign, so the comparison rides on the price's label.
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel(priceSpokenLabel(price))
|
||||
}
|
||||
if let result = fuelSavings?.result {
|
||||
savingsCapsule(result)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
@@ -2065,21 +2075,20 @@ struct StationRow: View {
|
||||
.buttonStyle(.borderless)
|
||||
}
|
||||
|
||||
/// Listing-only verdict. It deliberately omits money and the repeated
|
||||
/// comparison caption; the full monetary result remains in More info.
|
||||
@ViewBuilder
|
||||
/// The listing's verdict capsule — ONE component for every status, so the
|
||||
/// baseline's "Closest station" pill carries the same soft blue fill, white
|
||||
/// text and shape rules as Saves, Costs and Break even. The detail sheet
|
||||
/// keeps `FuelSavingsCapsule` to itself, unchanged.
|
||||
private func savingsCapsule(_ result: FuelSavingsResult) -> some View {
|
||||
if result.status == .baseline {
|
||||
FuelSavingsCapsule(result: result)
|
||||
} else {
|
||||
ListingFuelSavingsCapsule(result: result)
|
||||
}
|
||||
ListingFuelSavingsCapsule(result: result)
|
||||
}
|
||||
|
||||
/// One recommendation badge, above the price it annotates. Tinted rather
|
||||
/// than the mockup's solid fill, like every other badge and capsule in the
|
||||
/// app: coloured text keeps its contrast in both appearances, at every
|
||||
/// Dynamic Type size, without introducing a colour outside the palette.
|
||||
/// One recommendation badge, above the price it annotates. Badges stay
|
||||
/// TINTED with coloured text — unlike the verdict capsules, which are filled
|
||||
/// with white text: a badge annotates the price rather than reporting an
|
||||
/// outcome, so it should stay quieter than the pill beneath it. Tinted text
|
||||
/// also keeps its contrast in both appearances at every Dynamic Type size
|
||||
/// without introducing a colour outside the palette.
|
||||
private func badgeCapsule(_ badge: StationRecommendationBadge) -> some View {
|
||||
StationLabelBadge(label: badge.title, color: badge.tint)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user