Add Best Value small widget and standardise Closest wording

This commit is contained in:
FuelBoard Contributor
2026-10-15 17:14:02 +01:00
parent a5688cbac2
commit 3819b8a6ab
13 changed files with 125 additions and 46 deletions
+12 -6
View File
@@ -104,7 +104,6 @@ struct FuelSavingsSummaryView: View {
.font(.caption2)
.foregroundStyle(.secondary)
.lineLimit(1)
.minimumScaleFactor(0.75)
.layoutPriority(1)
.accessibilityLabel("Comparison: \(comparisonLabel(for: result))")
}
@@ -131,8 +130,16 @@ struct FuelSavingsSummaryView: View {
// room for. The old shape led with a status word + headline that
// matched neither the listing nor each other.
VStack(alignment: .leading, spacing: 10) {
capsule(for: result, compact: false)
.accessibilityLabel(accessibilityHeadline(for: result))
HStack(alignment: .firstTextBaseline, spacing: 6) {
capsule(for: result, compact: false)
.accessibilityLabel(accessibilityHeadline(for: result))
Text(comparisonLabel(for: result))
.font(.subheadline)
.foregroundStyle(.secondary)
.lineLimit(1)
.layoutPriority(1)
.accessibilityLabel("Comparison: \(comparisonLabel(for: result))")
}
LabeledContent("Your fill-up", value: amountText)
LabeledContent("Fuel you'll receive", value: String(format: "%.2f litres", result.fillLitres))
.monospacedDigit()
@@ -147,11 +154,11 @@ struct FuelSavingsSummaryView: View {
.accessibilityLabel(spokenExtraTravel(for: result, fallback: extraTravel))
}
if result.status == .baseline {
Text("Your closest station with a price for this fuel — every other saving is measured against it.")
Text("Your closest eligible station by journey distance is the baseline — every other saving is measured against it.")
.font(.caption)
.foregroundStyle(.secondary)
} else {
Text("Compared with \(baselineStationName ?? "your nearest station").")
Text("Compared with \(baselineStationName ?? "your closest station").")
.font(.caption)
.foregroundStyle(.secondary)
LabeledContent(
@@ -247,7 +254,6 @@ struct FuelSavingsSummaryView: View {
.accessibilityHidden(true)
Text(result.capsuleHeadline())
.lineLimit(1)
.minimumScaleFactor(0.8)
}
.font(compact ? .caption.weight(.semibold) : .headline)
.foregroundStyle(capsuleColor(for: result.status))