Alerts tab: picker-style config matching Live Activity; move Live Activity there
- Alerts section restyled to mirror the Live Activity section: one section with toggle + Fuel picker + Radius picker (was segmented fuel + slider) - Alert radius options expanded to 1/2/3/5/8/10/15/20 (display unit, snapped to nearest option; stored km unchanged; validation widened to 33 km) - Live Activity section moved from Settings into the Alerts tab so both 'notify while driving' surfaces sit together - SettingsView loses the Live Activity bindings/section
This commit is contained in:
@@ -482,8 +482,13 @@ struct FuelStore {
|
||||
saveString(enabled ? "1" : "0", service: alertsEnabledKey)
|
||||
}
|
||||
|
||||
/// Alert trigger-radius options (in the user's display unit, mapped to km
|
||||
/// on selection). Expanded beyond the Live Activity's 5/10/15 so approach
|
||||
/// alerts can trigger close (1–3) or wide (up to 20).
|
||||
static let alertRadiusOptions = [1, 2, 3, 5, 8, 10, 15, 20]
|
||||
|
||||
static func loadAlertsRadius() -> Double {
|
||||
if let raw = loadString(service: alertsRadiusKey), let value = Double(raw), value >= 1, value <= 10 {
|
||||
if let raw = loadString(service: alertsRadiusKey), let value = Double(raw), value >= 1, value <= 33 {
|
||||
return value
|
||||
}
|
||||
return 3.0
|
||||
|
||||
Reference in New Issue
Block a user