feat: calorie tap → fitness, confetti on food add, reduce dashboard padding
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

- Calorie widget taps switches to Fitness tab
- After adding food: dismiss sheet, switch to Fitness, confetti animation
- Confetti: emoji particles falling + checkmark + haptic feedback
- Dashboard top padding reduced from 60pt to 16pt
- HomeView accepts selectedTab binding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 09:34:48 -05:00
parent 04fbdc9a9b
commit b01409628f
3 changed files with 146 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ import PhotosUI
struct AssistantChatView: View {
@State private var vm = AssistantViewModel()
var onFoodAdded: (() -> Void)?
var body: some View {
VStack(spacing: 0) {
@@ -113,6 +114,13 @@ struct AssistantChatView: View {
.onChange(of: vm.selectedPhoto) {
Task { await vm.handlePhotoSelection() }
}
.onChange(of: vm.applied) {
if vm.applied {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
onFoodAdded?()
}
}
}
}
// MARK: - Chat Bubble

View File

@@ -4,8 +4,8 @@ import PhotosUI
struct HomeView: View {
@Environment(AuthManager.self) private var auth
@State private var vm = HomeViewModel()
@State private var showAssistant = false
@State private var ringAnimated = false
@Binding var selectedTab: Int
var body: some View {
ZStack {
@@ -54,12 +54,15 @@ struct HomeView: View {
}
}
.padding(.horizontal)
.padding(.top, 60)
.padding(.top, 16)
// Widget grid half width
// Widget grid half width, tap to go to fitness
HStack(spacing: 12) {
calorieWidget
// Future widget placeholder invisible spacer
Button { selectedTab = 1 } label: {
calorieWidget
}
.buttonStyle(.plain)
Color.clear
}
.padding(.horizontal)