Station name fills row width (logo left, price pinned right, wraps); fix Favourites alert wording

This commit is contained in:
FuelBoard Contributor
2026-08-11 15:24:52 +01:00
parent 60d25164d6
commit 3da5de6da2
2 changed files with 32 additions and 24 deletions
+31 -23
View File
@@ -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: {
+1 -1
View File
@@ -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)
}