fix: hide FAB on Reader tab, fix tab bar collapse during auto-scroll, position glass bar bottom-right
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 5s
Security Checks / dockerfile-lint (push) Successful in 4s

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) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-04 07:22:14 -05:00
parent 1b23525493
commit 7815f56b4f
3 changed files with 25 additions and 21 deletions

View File

@@ -53,29 +53,29 @@ struct MainTabView: View {
.tint(Color.accentWarm) .tint(Color.accentWarm)
.modifier(TabBarMinimizeModifier()) .modifier(TabBarMinimizeModifier())
// Floating buttons // Floating buttons (hidden on Reader tab)
VStack { if selectedTab != 2 {
Spacer() VStack {
HStack(alignment: .bottom) {
// Feedback button (subtle, bottom-left)
FeedbackButton()
.padding(.leading, 20)
Spacer() Spacer()
HStack(alignment: .bottom) {
FeedbackButton()
.padding(.leading, 20)
// Add food button (prominent, bottom-right) Spacer()
Button { showAssistant = true } label: {
Image(systemName: "plus") Button { showAssistant = true } label: {
.font(.title2.weight(.semibold)) Image(systemName: "plus")
.foregroundStyle(.white) .font(.title2.weight(.semibold))
.frame(width: 56, height: 56) .foregroundStyle(.white)
.background(Color.accentWarm) .frame(width: 56, height: 56)
.clipShape(Circle()) .background(Color.accentWarm)
.shadow(color: .black.opacity(0.2), radius: 8, y: 4) .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( .confettiCannon(

View File

@@ -11,7 +11,7 @@ struct ReaderTabView: View {
var body: some View { var body: some View {
NavigationStack { NavigationStack {
ZStack(alignment: .bottom) { ZStack(alignment: .bottomTrailing) {
VStack(spacing: 0) { VStack(spacing: 0) {
// Sub-tab selector // Sub-tab selector
HStack(spacing: 0) { HStack(spacing: 0) {
@@ -93,7 +93,8 @@ struct ReaderTabView: View {
// MARK: - Liquid Glass Control Bar // MARK: - Liquid Glass Control Bar
glassControlBar glassControlBar
.padding(.bottom, 2) .padding(.trailing, 16)
.padding(.bottom, 4)
} }
.navigationBarHidden(true) .navigationBarHidden(true)
.sheet(isPresented: $showFeedSheet) { .sheet(isPresented: $showFeedSheet) {

View File

@@ -110,6 +110,9 @@ struct ScrollViewDriver: UIViewRepresentable {
sv.contentOffset.y = newY sv.contentOffset.y = newY
// Notify delegate so tab bar minimize behavior triggers
originalDelegate?.scrollViewDidScroll?(sv)
// Stop at bottom // Stop at bottom
if newY >= maxOffset - 1 { if newY >= maxOffset - 1 {
stopAndNotify() stopAndNotify()