fix: Add button moved to sticky bottom bar — always tappable on first tap
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s

- Button outside ScrollView using safeAreaInset(edge: .bottom)
- No more scroll gesture eating the first tap
- scrollDismissesKeyboard(.immediately) for keyboard handling
- Swipe to delete on meal entries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 11:15:53 -05:00
parent d95c629845
commit b78e230eda

View File

@@ -165,8 +165,12 @@ struct AddFoodSheet: View {
.font(.caption)
.foregroundStyle(.red)
}
// Add button
}
.padding()
}
.scrollDismissesKeyboard(.immediately)
.background(Color.canvas)
.safeAreaInset(edge: .bottom) {
Button {
addEntry()
} label: {
@@ -184,10 +188,10 @@ struct AddFoodSheet: View {
.foregroundStyle(.white)
.clipShape(RoundedRectangle(cornerRadius: 12))
.disabled(isAdding)
}
.padding()
}
.padding(.horizontal)
.padding(.bottom, 8)
.background(Color.canvas)
}
.navigationTitle("Add Food")
.navigationBarTitleDisplayMode(.inline)
.toolbar {