@@ -33,6 +33,7 @@ struct MealView: View {
3333 @State private var statusMessage : String ? = nil
3434 @State private var selectedTime : Date ? = nil
3535 @State private var isScheduling : Bool = false
36+ @State private var showFatProteinOrderBanner = false
3637
3738 enum AlertType {
3839 case confirmMeal
@@ -46,6 +47,24 @@ struct MealView: View {
4647 VStack {
4748 Form {
4849 Section ( header: Text ( " Meal Data " ) ) {
50+ // TODO: This banner can be deleted in March 2027. Check the commit for other places to cleanup.
51+ if showFatProteinOrderBanner {
52+ HStack {
53+ Image ( systemName: " arrow.left.arrow.right " )
54+ Text ( " The order of Fat and Protein inputs has changed. " ) . font ( . callout)
55+ Spacer ( )
56+ Button {
57+ Storage . shared. hasSeenFatProteinOrderChange. value = true
58+ withAnimation { showFatProteinOrderBanner = false }
59+ } label: {
60+ Image ( systemName: " xmark.circle.fill " )
61+ }
62+ . buttonStyle ( . plain)
63+ }
64+ . listRowBackground ( Color . orange. opacity ( 0.75 ) )
65+ . transition ( . opacity)
66+ }
67+
4968 HKQuantityInputView (
5069 label: " Carbs " ,
5170 quantity: $carbs,
@@ -61,26 +80,26 @@ struct MealView: View {
6180
6281 if mealWithFatProtein. value {
6382 HKQuantityInputView (
64- label: " Protein " ,
65- quantity: $protein ,
83+ label: " Fat " ,
84+ quantity: $fat ,
6685 unit: . gram( ) ,
6786 maxLength: 4 ,
6887 minValue: HKQuantity ( unit: . gram( ) , doubleValue: 0 ) ,
69- maxValue: maxProtein . value,
70- isFocused: $proteinFieldIsFocused ,
88+ maxValue: maxFat . value,
89+ isFocused: $fatFieldIsFocused ,
7190 onValidationError: { message in
7291 handleValidationError ( message)
7392 }
7493 )
7594
7695 HKQuantityInputView (
77- label: " Fat " ,
78- quantity: $fat ,
96+ label: " Protein " ,
97+ quantity: $protein ,
7998 unit: . gram( ) ,
8099 maxLength: 4 ,
81100 minValue: HKQuantity ( unit: . gram( ) , doubleValue: 0 ) ,
82- maxValue: maxFat . value,
83- isFocused: $fatFieldIsFocused ,
101+ maxValue: maxProtein . value,
102+ isFocused: $proteinFieldIsFocused ,
84103 onValidationError: { message in
85104 handleValidationError ( message)
86105 }
@@ -153,6 +172,10 @@ struct MealView: View {
153172 . onAppear {
154173 selectedTime = nil
155174 isScheduling = false
175+
176+ if !Storage. shared. hasSeenFatProteinOrderChange. value && Storage . shared. mealWithFatProtein. value {
177+ showFatProteinOrderBanner = true
178+ }
156179 }
157180 . alert ( isPresented: $showAlert) {
158181 switch alertType {
0 commit comments