Add first-launch onboarding with location + notification permission prompts
- OnboardingView: 4-page flow (welcome + features, location, notifications, done) - Triggers system prompts in-context via OnboardingPermissionPrompter - Shown at initial launch only (FuelStore.onboardingCompleted flag, app-group defaults) - Test hook: 'Show onboarding (testing)' button at bottom of Alerts tab
This commit is contained in:
@@ -7,6 +7,7 @@ struct AlertsView: View {
|
||||
@Binding var radius: Double
|
||||
let monitoredCount: Int
|
||||
let lastAlert: String?
|
||||
var onShowOnboarding: () -> Void = {}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
@@ -54,6 +55,19 @@ struct AlertsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Testing hook — in production onboarding shows once at first
|
||||
// launch; this button re-opens it to verify the flow.
|
||||
Section {
|
||||
Button {
|
||||
onShowOnboarding()
|
||||
} label: {
|
||||
Label("Show onboarding (testing)", systemImage: "flag.fill")
|
||||
.font(.footnote)
|
||||
}
|
||||
} footer: {
|
||||
Text("Testing only — onboarding normally appears once on first launch.")
|
||||
}
|
||||
}
|
||||
.navigationTitle("Alerts")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user