banner: top-floating; fix offline-trigger cache; onboarding prompt timing
- Banner floats at the very top (over the nav/title area), never pushing the content below and staying clear of the list/pill. - Offline banner now fires on refresh in airplane mode / no data: the mirror live chain bypassed the HTTP cache (+10s timeout) so an offline fetch really fails instead of silently re-serving a cached pointer+dump as a 'success' (which kept dataStatus .live and hid the banner). - Onboarding permissions fire at the Continue/Allow tap BEFORE advancing, so the system prompt appears after the page is read and never covers the next page's animation (grant auto-advances).
This commit is contained in:
@@ -486,12 +486,12 @@ struct ContentView: View {
|
||||
ZStack(alignment: .top) {
|
||||
rootTabView
|
||||
if let banner = activeBanner {
|
||||
// Floating just below the nav bar: overlays content (never
|
||||
// pushes it) and stays clear of the iOS 26 nav/toolbar
|
||||
// Liquid Glass chrome so a tap on the banner can't also
|
||||
// trigger the control behind it.
|
||||
// Floating near the top of the screen, over the nav area —
|
||||
// overlays content (never pushes it) and sits above the
|
||||
// main content so it doesn't cover or block the list/pill
|
||||
// beneath it.
|
||||
floatingBanner(banner)
|
||||
.padding(.top, geo.safeAreaInsets.top + 52)
|
||||
.padding(.top, geo.safeAreaInsets.top + 10)
|
||||
.transition(.asymmetric(
|
||||
insertion: .move(edge: .top).combined(with: .opacity),
|
||||
// Slide up + fade on dismiss/timeout (one style for all).
|
||||
|
||||
@@ -245,19 +245,27 @@ struct OnboardingView: View {
|
||||
) {
|
||||
if prompter.locationDenied {
|
||||
openSettings()
|
||||
} else if prompter.locationGranted {
|
||||
page = 2 // already decided — just move on
|
||||
} else {
|
||||
// The prompt fires on LEAVING this page (onChange(of:
|
||||
// page), forward advance only) — the description is on
|
||||
// screen until the user moves on.
|
||||
page = 2
|
||||
// Fire the system prompt NOW, while this page is still on
|
||||
// screen (after it's been read) and BEFORE advancing — so
|
||||
// the prompt never covers the next page's animation. Auto-
|
||||
// advance on grant moves us on once the user responds;
|
||||
// denying leaves the page's "Open Settings" path.
|
||||
prompter.requestLocation()
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
primaryButton(
|
||||
prompter.notificationsDenied ? "Continue without alerts" : (prompter.notificationsGranted ? "Continue" : "Allow Notifications")
|
||||
) {
|
||||
// Prompt fires on leaving this page (same rule as Location).
|
||||
page = 3
|
||||
if prompter.notificationsDenied || prompter.notificationsGranted {
|
||||
page = 3 // decided either way — move on
|
||||
} else {
|
||||
// Same rule as Location: prompt now, before advancing.
|
||||
prompter.requestNotifications()
|
||||
}
|
||||
}
|
||||
case 3:
|
||||
// No permission on this page — prices need none. Straight on.
|
||||
|
||||
Reference in New Issue
Block a user