AlgorithmSettingsStepView.swift 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // AlgorithmSettingsStepView.swift
  3. // Trio
  4. //
  5. // Created by Cengiz Deniz on 14.04.25
  6. //
  7. import SwiftUI
  8. struct AlgorithmSettingsStepView: View {
  9. @Bindable var state: Onboarding.StateModel
  10. @State private var shouldDisplayPicker: Bool = false
  11. @State private var decimalPlaceholder: Decimal = 0.0
  12. @State private var booleanPlaceholder: Bool = false
  13. private let settingsProvider = PickerSettingsProvider.shared
  14. var body: some View {
  15. VStack(alignment: .leading, spacing: 20) {
  16. Text("Configure the algorithm…")
  17. .padding(.horizontal)
  18. .font(.title3)
  19. .bold()
  20. VStack(alignment: .leading, spacing: 10) {
  21. Text(
  22. "Trio can automatically adapt insulin delivery based on inputs and glucose forecasts. Your algorithm settings play a major part in accurate and effective dosing."
  23. ).multilineTextAlignment(.leading)
  24. Text("In the next few steps, you’ll configure your algorithm settings for")
  25. BulletPoint(String(localized: "Autosens"))
  26. BulletPoint(String(localized: "Super Micro Bolus (SMB)"))
  27. BulletPoint(String(localized: "Target Behavior"))
  28. Text("Our strong recommendation is to ")
  29. + Text("leave everything on default").bold()
  30. + Text(" as a beginner.")
  31. Text("Only adjust these settings if you’re an advanced or returning user who knows what they’re doing.")
  32. .multilineTextAlignment(.leading)
  33. }
  34. .padding(.horizontal)
  35. VStack(alignment: .leading, spacing: 10) {
  36. Text("A few important notes:")
  37. .font(.headline)
  38. .padding(.bottom, 4)
  39. BulletPoint(String(localized: "Dynamic ISF requires at least 7 days of usage data and is not yet configurable."))
  40. BulletPoint(String(localized: "Even if you’re an updating user, you’ll be guided through this step-by-step."))
  41. BulletPoint(String(localized: "All additional \"advanced settings\" have been reset."))
  42. BulletPoint(
  43. String(localized: "The duration of insulin action (DIA) is now locked to Trio’s new default of 10 hours.")
  44. )
  45. BulletPoint(
  46. String(localized: "We strongly recommend not changing DIA — it’s essential to stable and safe operation.")
  47. )
  48. }
  49. .padding(.horizontal)
  50. }
  51. }
  52. }