Jelajahi Sumber

Improve add button and add interaction hints to therapy settings

Deniz Cengiz 1 tahun lalu
induk
melakukan
58851673a6

+ 21 - 1
FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift

@@ -24,6 +24,7 @@ extension BasalProfileEditor {
         private var rateFormatter: NumberFormatter {
             let formatter = NumberFormatter()
             formatter.numberStyle = .decimal
+
             return formatter
         }
 
@@ -140,6 +141,20 @@ extension BasalProfileEditor {
                             .foregroundColor(.secondary)
                     }
                 }.listRowBackground(Color.chart)
+
+                Section {} header: {
+                    VStack(alignment: .leading, spacing: 10) {
+                        HStack {
+                            Image(systemName: "note.text.badge.plus").foregroundStyle(.primary)
+                            Text("Add an entry by tapping 'Add Rate +' in the top right-hand corner of the screen.")
+                        }
+                        HStack {
+                            Image(systemName: "hand.draw.fill").foregroundStyle(.primary)
+                            Text("Swipe to delete a single entry. Tap on it, to edit its time or rate.")
+                        }
+                    }
+                    .textCase(nil)
+                }
             }
             .safeAreaInset(edge: .bottom, spacing: 30) { saveButton }
             .alert(isPresented: $state.showAlert) {
@@ -163,7 +178,12 @@ extension BasalProfileEditor {
                     }
                 }
                 ToolbarItem(placement: .topBarTrailing) {
-                    Button(action: { state.add() }) { Image(systemName: "plus") }.disabled(!state.canAdd)
+                    Button(action: { state.add() }) {
+                        HStack {
+                            Text("Add Rate")
+                            Image(systemName: "plus")
+                        }
+                    }.disabled(!state.canAdd)
                 }
             })
             .environment(\.editMode, $editMode)

+ 20 - 1
FreeAPS/Sources/Modules/CarbRatioEditor/View/CarbRatioEditorRootView.swift

@@ -83,6 +83,20 @@ extension CarbRatioEditor {
                 Section(header: Text("Schedule")) {
                     list
                 }.listRowBackground(Color.chart)
+
+                Section {} header: {
+                    VStack(alignment: .leading, spacing: 10) {
+                        HStack {
+                            Image(systemName: "note.text.badge.plus").foregroundStyle(.primary)
+                            Text("Add an entry by tapping 'Add Ratio +' in the top right-hand corner of the screen.")
+                        }
+                        HStack {
+                            Image(systemName: "hand.draw.fill").foregroundStyle(.primary)
+                            Text("Swipe to delete a single entry. Tap on it, to edit its time or rate.")
+                        }
+                    }
+                    .textCase(nil)
+                }
             }
             .safeAreaInset(edge: .bottom, spacing: 30) { saveButton }
             .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
@@ -96,7 +110,12 @@ extension CarbRatioEditor {
                     }
                 }
                 ToolbarItem(placement: .topBarTrailing) {
-                    Button(action: { state.add() }) { Image(systemName: "plus") }.disabled(!state.canAdd)
+                    Button(action: { state.add() }) {
+                        HStack {
+                            Text("Add Ratio")
+                            Image(systemName: "plus")
+                        }
+                    }.disabled(!state.canAdd)
                 }
             })
             .environment(\.editMode, $editMode)

+ 20 - 1
FreeAPS/Sources/Modules/ISFEditor/View/ISFEditorRootView.swift

@@ -81,6 +81,20 @@ extension ISFEditor {
                 Section(header: Text("Schedule")) {
                     list
                 }.listRowBackground(Color.chart)
+
+                Section {} header: {
+                    VStack(alignment: .leading, spacing: 10) {
+                        HStack {
+                            Image(systemName: "note.text.badge.plus").foregroundStyle(.primary)
+                            Text("Add an entry by tapping 'Add Sensitivity +' in the top right-hand corner of the screen.")
+                        }
+                        HStack {
+                            Image(systemName: "hand.draw.fill").foregroundStyle(.primary)
+                            Text("Swipe left to delete a single entry. Tap on it, to edit its time or rate.")
+                        }
+                    }
+                    .textCase(nil)
+                }
             }
             .safeAreaInset(edge: .bottom, spacing: 30) { saveButton }
             .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
@@ -94,7 +108,12 @@ extension ISFEditor {
                     }
                 }
                 ToolbarItem(placement: .topBarTrailing) {
-                    Button(action: { state.add() }) { Image(systemName: "plus") }.disabled(!state.canAdd)
+                    Button(action: { state.add() }) {
+                        HStack {
+                            Text("Add Sensitivity")
+                            Image(systemName: "plus")
+                        }
+                    }.disabled(!state.canAdd)
                 }
             })
             .environment(\.editMode, $editMode)

+ 20 - 1
FreeAPS/Sources/Modules/TargetsEditor/View/TargetsEditorRootView.swift

@@ -65,6 +65,20 @@ extension TargetsEditor {
                 Section(header: Text("Schedule")) {
                     list
                 }.listRowBackground(Color.chart)
+
+                Section {} header: {
+                    VStack(alignment: .leading, spacing: 10) {
+                        HStack {
+                            Image(systemName: "note.text.badge.plus").foregroundStyle(.primary)
+                            Text("Add an entry by tapping 'Add Target +' in the top right-hand corner of the screen.")
+                        }
+                        HStack {
+                            Image(systemName: "hand.draw.fill").foregroundStyle(.primary)
+                            Text("Swipe to delete a single entry. Tap on it, to edit its time or rate.")
+                        }
+                    }
+                    .textCase(nil)
+                }
             }
             .safeAreaInset(edge: .bottom, spacing: 30) { saveButton }
             .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
@@ -78,7 +92,12 @@ extension TargetsEditor {
                     }
                 }
                 ToolbarItem(placement: .topBarTrailing) {
-                    Button(action: { state.add() }) { Image(systemName: "plus") }.disabled(!state.canAdd)
+                    Button(action: { state.add() }) {
+                        HStack {
+                            Text("Add Target")
+                            Image(systemName: "plus")
+                        }
+                    }.disabled(!state.canAdd)
                 }
             })
             .environment(\.editMode, $editMode)