From 95a88af4f5446556233a816c2884ad1a9a74484f Mon Sep 17 00:00:00 2001 From: Cameron Ingham Date: Sat, 15 Aug 2026 18:07:06 -0700 Subject: [PATCH] [LOOP-5952 & LOOP-5953] Liquid Glass Fixes Part 2 --- .../View Modifiers/ModalPresentation.swift | 1 + .../Views/OnboardingSectionPageView.swift | 39 ++++++++++++------- .../Views/OnboardingSectionWrapperView.swift | 10 +---- .../Views/Sections/WelcomeViews.swift | 39 ++++++++++++------- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/TidepoolOnboarding/View Modifiers/ModalPresentation.swift b/TidepoolOnboarding/View Modifiers/ModalPresentation.swift index ed3265e..3ba61af 100644 --- a/TidepoolOnboarding/View Modifiers/ModalPresentation.swift +++ b/TidepoolOnboarding/View Modifiers/ModalPresentation.swift @@ -11,6 +11,7 @@ import SwiftUI extension View { func presentation(isModal: Bool, onDismissalAttempt: (() -> Void)? = nil) -> some View { ModalPresentationView(view: self, isModal: isModal, onDismissalAttempt: onDismissalAttempt) + .ignoresSafeArea() } } diff --git a/TidepoolOnboarding/Views/OnboardingSectionPageView.swift b/TidepoolOnboarding/Views/OnboardingSectionPageView.swift index e98b61b..e356a87 100644 --- a/TidepoolOnboarding/Views/OnboardingSectionPageView.swift +++ b/TidepoolOnboarding/Views/OnboardingSectionPageView.swift @@ -14,6 +14,7 @@ struct OnboardingSectionPageView @State private var isDestinationActiveFromNextButton = false @State private var isCloseAlertPresented = false + @State private var scrollViewHeight: CGFloat = 0 private let section: OnboardingSection private let editMode: Bool @@ -90,24 +91,32 @@ struct OnboardingSectionPageView var body: some View { OnboardingSectionWrapperView(section: section) { - GeometryReader { geometry in - ScrollView { - VStack(spacing: 10) { - Segment { - content - } - Spacer() - if let footer = footer { - footer - } - if !nextButtonHidden { - nextButton - } + ScrollView { + VStack(spacing: 10) { + Segment { + content + } + Spacer() + if let footer = footer { + footer + } + if !nextButtonHidden { + nextButton } - .padding() - .frame(minHeight: geometry.size.height) } + .padding() + .frame(minHeight: scrollViewHeight) } + .background( + GeometryReader { geometry in + let visibleHeight = geometry.size.height - (geometry.frame(in: .global).maxY > UIScreen.main.bounds.height - geometry.safeAreaInsets.bottom + 0.5 ? geometry.safeAreaInsets.bottom : 0) + Color.clear + .onAppear { scrollViewHeight = visibleHeight } + .onChange(of: visibleHeight) { _, height in + scrollViewHeight = height + } + } + ) } .editMode(editMode) .backButtonHidden(backButtonHidden) diff --git a/TidepoolOnboarding/Views/OnboardingSectionWrapperView.swift b/TidepoolOnboarding/Views/OnboardingSectionWrapperView.swift index 2e45e91..813b9db 100644 --- a/TidepoolOnboarding/Views/OnboardingSectionWrapperView.swift +++ b/TidepoolOnboarding/Views/OnboardingSectionWrapperView.swift @@ -54,14 +54,8 @@ struct OnboardingSectionWrapperView: View { private var backButton: some View { Button(action: { presentationMode.wrappedValue.dismiss() }) { - HStack { - Image(systemName: "chevron.left") - .resizable() - .frame(width: 12, height: 20) - Text(backButtonTitle) - .fontWeight(.regular) - } - .offset(x: -6, y: 0) + Image(systemName: "chevron.left") + .fontWeight(.semibold) } .accessibilityElement() .accessibilityAddTraits(.isButton) diff --git a/TidepoolOnboarding/Views/Sections/WelcomeViews.swift b/TidepoolOnboarding/Views/Sections/WelcomeViews.swift index ffd0def..2cdb09c 100644 --- a/TidepoolOnboarding/Views/Sections/WelcomeViews.swift +++ b/TidepoolOnboarding/Views/Sections/WelcomeViews.swift @@ -12,30 +12,39 @@ struct WelcomeTabView: View { @EnvironmentObject var onboardingViewModel: OnboardingViewModel @State private var selectedIndex = 0 + @State private var pageHeight: CGFloat = 0 var body: some View { ZStack { Color(.systemBackground) .edgesIgnoringSafeArea(.all) - GeometryReader { geometry in - TabView(selection: $selectedIndex) { - ForEach(welcomeData.indices, id: \.self) { viewIndex in - ScrollView { - VStack { - welcome(for: viewIndex) - Spacer() - pager(for: viewIndex) - .padding(.vertical) - button(for: viewIndex) - } - .padding() - .frame(minHeight: geometry.size.height) + TabView(selection: $selectedIndex) { + ForEach(welcomeData.indices, id: \.self) { viewIndex in + ScrollView { + VStack { + welcome(for: viewIndex) + Spacer() + pager(for: viewIndex) + .padding(.vertical) + button(for: viewIndex) } - .tag(viewIndex) + .padding() + .frame(minHeight: pageHeight) } + .tag(viewIndex) } - .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) } + .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) + .background( + GeometryReader { geometry in + let visibleHeight = geometry.size.height - (geometry.frame(in: .global).maxY > UIScreen.main.bounds.height - geometry.safeAreaInsets.bottom + 0.5 ? geometry.safeAreaInsets.bottom : 0) + Color.clear + .onAppear { pageHeight = visibleHeight } + .onChange(of: visibleHeight) { _, height in + pageHeight = height + } + } + ) } .onAppear { onboardingViewModel.sectionProgression.startSection(.welcome) } }