Alerts: move geofence monitoring status to Settings debug; plain-language footer

This commit is contained in:
FuelBoard Contributor
2026-08-14 10:34:45 +01:00
parent edf376d378
commit aa95d214e8
3 changed files with 38 additions and 30 deletions
+18
View File
@@ -37,6 +37,9 @@ struct SettingsView: View {
/// Last CoreLocation region-monitoring failure (monitor.lastRegionError).
/// Shown in Debug so a silently-failed geofence registration is visible.
var regionError: String?
/// Live geofence count (monitor.monitoredStationIDs.count) Debug-only
/// status; the user-facing Alerts tab no longer exposes fence plumbing.
var monitoredCount: Int = 0
@StateObject private var tipStore = TipStore()
@State private var showTipAlert = false
@@ -199,6 +202,21 @@ struct SettingsView: View {
} footer: {
Text("Connection shows whether prices come from the official Fuel Finder API or the CSV mirror. Data updated is the latest price change reported by the GOV.UK server itself.")
}
Section {
if monitoredCount == 0 {
Text("No stations monitored yet — open the Stations tab to load prices first.")
.font(.caption)
.foregroundStyle(.secondary)
} else {
LabeledContent("Geofenced stations", value: "\(monitoredCount)")
}
Text("Favourites for \(alertsFuel.displayName.lowercased()) get priority, then the closest stations selling that fuel fill the rest (18 max, iOS region limit). Each station alerts at most once per hour.")
.font(.caption)
.foregroundStyle(.secondary)
} header: {
Text("Geofence monitoring")
}
}
Section {