From 3da5de6da2136a493ed231233313553c706ca069 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Tue, 11 Aug 2026 15:24:52 +0100 Subject: [PATCH] Station name fills row width (logo left, price pinned right, wraps); fix Favourites alert wording --- FuelBoard/ContentView.swift | 54 +++++++++++++++++++--------------- FuelBoard/FavouritesView.swift | 2 +- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/FuelBoard/ContentView.swift b/FuelBoard/ContentView.swift index 97c57a2..05335af 100644 --- a/FuelBoard/ContentView.swift +++ b/FuelBoard/ContentView.swift @@ -210,11 +210,14 @@ struct StationRow: View { .overlay(Circle().stroke(Color.primary.opacity(0.08), lineWidth: 1)) .shadow(color: .black.opacity(0.08), radius: 2, y: 1) - VStack(alignment: .leading, spacing: 2) { - HStack(spacing: 6) { + // Name line fills the whole row width (only the logo is to its + // left); long names wrap instead of being cut off. + VStack(alignment: .leading, spacing: 3) { + HStack(alignment: .firstTextBaseline, spacing: 6) { Text(station.name) .font(.headline) - .lineLimit(1) + .lineLimit(2) + .layoutPriority(1) if isTopResult { Text("TOP") .font(.caption2.bold()) @@ -223,34 +226,39 @@ struct StationRow: View { .background(Capsule().fill(.blue.opacity(0.15))) .foregroundStyle(.blue) } - } - Text("\(station.address), \(station.postcode)") - .font(.caption) - .foregroundStyle(.secondary) - .lineLimit(1) - if let location { - Text(String(format: "%.1f km away", station.distanceKM(to: location.lat, lng2: location.lng))) - .font(.caption2) - .foregroundStyle(.secondary) - } - } - Spacer() - if let price = station.prices[fuel] { - VStack(alignment: .trailing, spacing: 2) { - HStack(spacing: 5) { - Circle() - .fill(ragColor) - .frame(width: 10, height: 10) - Text(String(format: "%.1fp", price)) - .font(.title3.bold()) + Spacer(minLength: 6) + if let price = station.prices[fuel] { + HStack(spacing: 5) { + Circle() + .fill(ragColor) + .frame(width: 10, height: 10) + Text(String(format: "%.1fp", price)) + .font(.title3.bold()) + .monospacedDigit() + } } + } + + HStack(spacing: 5) { if let deltaText { Text(deltaText) .font(.caption2.bold()) .foregroundStyle(ragColor) } + Text("\(station.address), \(station.postcode)") + .font(.caption) + .foregroundStyle(.secondary) + .lineLimit(1) + Spacer(minLength: 8) + if let location { + Text(String(format: "%.1f km", station.distanceKM(to: location.lat, lng2: location.lng))) + .font(.caption2) + .foregroundStyle(.secondary) + .monospacedDigit() + } } } + Button { onToggleFavourite() } label: { diff --git a/FuelBoard/FavouritesView.swift b/FuelBoard/FavouritesView.swift index 4ec1ca7..503f564 100644 --- a/FuelBoard/FavouritesView.swift +++ b/FuelBoard/FavouritesView.swift @@ -72,7 +72,7 @@ struct FavouritesView: View { if let cheapest = cheapest { Section { - Text("\(cheapest.name) is your cheapest favourite for \(selectedFuel.displayName). Add the same stations to the Alerts tab to get pinged when you drive past a cheaper one.") + Text("\(cheapest.name) is your cheapest favourite for \(selectedFuel.displayName). Favourites are monitored automatically — switch to the Alerts tab and enable alerts to get pinged when you approach one that's the cheapest within the radius.") .font(.caption) .foregroundStyle(.secondary) }