From 7815f56b4f363286686354a044aec9b09b0ac4b2 Mon Sep 17 00:00:00 2001 From: Yusuf Suleman Date: Sat, 4 Apr 2026 07:22:14 -0500 Subject: [PATCH] fix: hide FAB on Reader tab, fix tab bar collapse during auto-scroll, position glass bar bottom-right MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. FAB hidden when selectedTab == 2 (Reader) — no plus button on Reader since it's for food logging 2. Auto-scroll now notifies original UIScrollViewDelegate via scrollViewDidScroll after each contentOffset change — this triggers tabBarMinimizeBehavior so the tab bar collapses during auto-scroll just like manual scrolling 3. Glass control bar positioned bottom-right (like Photos search icon) instead of bottom-center Co-Authored-By: Claude Opus 4.6 (1M context) --- ios/Platform/Platform/ContentView.swift | 38 +++++++++---------- .../Features/Reader/Views/ReaderTabView.swift | 5 ++- .../Reader/Views/ScrollViewDriver.swift | 3 ++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ios/Platform/Platform/ContentView.swift b/ios/Platform/Platform/ContentView.swift index 35db154..c4178a7 100644 --- a/ios/Platform/Platform/ContentView.swift +++ b/ios/Platform/Platform/ContentView.swift @@ -53,29 +53,29 @@ struct MainTabView: View { .tint(Color.accentWarm) .modifier(TabBarMinimizeModifier()) - // Floating buttons - VStack { - Spacer() - HStack(alignment: .bottom) { - // Feedback button (subtle, bottom-left) - FeedbackButton() - .padding(.leading, 20) - + // Floating buttons (hidden on Reader tab) + if selectedTab != 2 { + VStack { Spacer() + HStack(alignment: .bottom) { + FeedbackButton() + .padding(.leading, 20) - // Add food button (prominent, bottom-right) - Button { showAssistant = true } label: { - Image(systemName: "plus") - .font(.title2.weight(.semibold)) - .foregroundStyle(.white) - .frame(width: 56, height: 56) - .background(Color.accentWarm) - .clipShape(Circle()) - .shadow(color: .black.opacity(0.2), radius: 8, y: 4) + Spacer() + + Button { showAssistant = true } label: { + Image(systemName: "plus") + .font(.title2.weight(.semibold)) + .foregroundStyle(.white) + .frame(width: 56, height: 56) + .background(Color.accentWarm) + .clipShape(Circle()) + .shadow(color: .black.opacity(0.2), radius: 8, y: 4) + } + .padding(.trailing, 20) } - .padding(.trailing, 20) + .padding(.bottom, 70) } - .padding(.bottom, 70) } } .confettiCannon( diff --git a/ios/Platform/Platform/Features/Reader/Views/ReaderTabView.swift b/ios/Platform/Platform/Features/Reader/Views/ReaderTabView.swift index 9cb7ec1..753d46d 100644 --- a/ios/Platform/Platform/Features/Reader/Views/ReaderTabView.swift +++ b/ios/Platform/Platform/Features/Reader/Views/ReaderTabView.swift @@ -11,7 +11,7 @@ struct ReaderTabView: View { var body: some View { NavigationStack { - ZStack(alignment: .bottom) { + ZStack(alignment: .bottomTrailing) { VStack(spacing: 0) { // Sub-tab selector HStack(spacing: 0) { @@ -93,7 +93,8 @@ struct ReaderTabView: View { // MARK: - Liquid Glass Control Bar glassControlBar - .padding(.bottom, 2) + .padding(.trailing, 16) + .padding(.bottom, 4) } .navigationBarHidden(true) .sheet(isPresented: $showFeedSheet) { diff --git a/ios/Platform/Platform/Features/Reader/Views/ScrollViewDriver.swift b/ios/Platform/Platform/Features/Reader/Views/ScrollViewDriver.swift index 96eec31..8c154cf 100644 --- a/ios/Platform/Platform/Features/Reader/Views/ScrollViewDriver.swift +++ b/ios/Platform/Platform/Features/Reader/Views/ScrollViewDriver.swift @@ -110,6 +110,9 @@ struct ScrollViewDriver: UIViewRepresentable { sv.contentOffset.y = newY + // Notify delegate so tab bar minimize behavior triggers + originalDelegate?.scrollViewDidScroll?(sv) + // Stop at bottom if newY >= maxOffset - 1 { stopAndNotify()