TempTargetHelpView.swift 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import SwiftUI
  2. struct TempTargetHelpView: View {
  3. var state: Adjustments.StateModel
  4. var helpSheetDetent: Binding<PresentationDetent>
  5. var body: some View {
  6. NavigationStack {
  7. List {
  8. Section {
  9. VStack(alignment: .leading, spacing: 10) {
  10. Text(
  11. "A Temporary Target replaces the current Target Glucose specified in Therapy settings."
  12. )
  13. Text(
  14. "Depending on your Target Behavior settings (see Settings > the Algorithm > Target Behavior), these temporary glucose targets can also raise Insulin Sensitivity for high targets or lower sensitivity for low targets."
  15. )
  16. Text(
  17. "Furthermore, you could adjust that sensitivity change independently from the Half Basal Exercise Target specified in Algorithm > Target Behavior settings by deliberately setting a customized Insulin Percentage for a Temp Target."
  18. )
  19. Text(
  20. "A pre-condition to have Temp Targets adjust Sensitivity is that the respective Target Behavior settings High Temp Target Raises Sensitivity or Low Temp Target Lowers Sensitivity are set to enabled."
  21. )
  22. }
  23. } header: {
  24. Text("Overview")
  25. }
  26. .listRowBackground(Color.gray.opacity(0.1))
  27. Section {
  28. VStack(alignment: .leading, spacing: 10) {
  29. Text(
  30. "Sensitivity adjustments from Temp Targets have a hard-coded minimum of 15%. This means even very high Temp Targets cannot reduce insulin delivery below 15% of normal."
  31. )
  32. Text(
  33. "This 15% floor is a safety limit inherited from oref (OpenAPS reference design) and AndroidAPS. It prevents Temp Targets from reducing insulin to dangerously low levels."
  34. )
  35. Text(
  36. "Note: Autosens Min and Autosens Max settings do not apply symmetrically to Temp Target sensitivity adjustments. Autosens Max limits how much sensitivity can be decreased (more insulin), but Autosens Min does not override the 15% floor for increased sensitivity (less insulin)."
  37. )
  38. Text(
  39. "This asymmetry exists because reducing insulin delivery during exercise, normally realized by using high Temp Targets, typically requires a higher insulin reduction than what autosens would identify in a regular dayly routine."
  40. )
  41. }
  42. } header: {
  43. Text("Sensitivity Limits")
  44. }
  45. .listRowBackground(Color.gray.opacity(0.1))
  46. }
  47. .navigationBarTitle("Help", displayMode: .inline)
  48. Button { state.isHelpSheetPresented.toggle() }
  49. label: { Text("Got it!").bold().frame(maxWidth: .infinity, minHeight: 30, alignment: .center) }
  50. .buttonStyle(.bordered)
  51. .padding(.top)
  52. }
  53. .padding()
  54. .scrollContentBackground(.hidden)
  55. .presentationDetents(
  56. [.fraction(0.9), .large],
  57. selection: helpSheetDetent
  58. )
  59. }
  60. }