Parcourir la source

Add new step 'Startup Guide', linking to docs

Deniz Cengiz il y a 1 an
Parent
commit
0acaf3e4c8

+ 4 - 0
Trio.xcodeproj/project.pbxproj

@@ -644,6 +644,7 @@
 		DDF691032DA2CA1E008BF16C /* AppDiagnosticsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF691022DA2CA14008BF16C /* AppDiagnosticsProvider.swift */; };
 		DDF691052DA2CA23008BF16C /* AppDiagnosticsStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF691042DA2CA20008BF16C /* AppDiagnosticsStateModel.swift */; };
 		DDF691072DA2CA2D008BF16C /* AppDiagnosticsRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF691062DA2CA28008BF16C /* AppDiagnosticsRootView.swift */; };
+		DDF691372DA30332008BF16C /* StartupGuideStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF691362DA30332008BF16C /* StartupGuideStepView.swift */; };
 		DDF847DD2C5C28720049BB3B /* LiveActivitySettingsDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF847DC2C5C28720049BB3B /* LiveActivitySettingsDataFlow.swift */; };
 		DDF847DF2C5C28780049BB3B /* LiveActivitySettingsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF847DE2C5C28780049BB3B /* LiveActivitySettingsProvider.swift */; };
 		DDF847E12C5C287F0049BB3B /* LiveActivitySettingsStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF847E02C5C287F0049BB3B /* LiveActivitySettingsStateModel.swift */; };
@@ -1433,6 +1434,7 @@
 		DDF691022DA2CA14008BF16C /* AppDiagnosticsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDiagnosticsProvider.swift; sourceTree = "<group>"; };
 		DDF691042DA2CA20008BF16C /* AppDiagnosticsStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDiagnosticsStateModel.swift; sourceTree = "<group>"; };
 		DDF691062DA2CA28008BF16C /* AppDiagnosticsRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDiagnosticsRootView.swift; sourceTree = "<group>"; };
+		DDF691362DA30332008BF16C /* StartupGuideStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartupGuideStepView.swift; sourceTree = "<group>"; };
 		DDF847DC2C5C28720049BB3B /* LiveActivitySettingsDataFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveActivitySettingsDataFlow.swift; sourceTree = "<group>"; };
 		DDF847DE2C5C28780049BB3B /* LiveActivitySettingsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveActivitySettingsProvider.swift; sourceTree = "<group>"; };
 		DDF847E02C5C287F0049BB3B /* LiveActivitySettingsStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveActivitySettingsStateModel.swift; sourceTree = "<group>"; };
@@ -2760,6 +2762,7 @@
 		BD47FDD52D8B64AE0043966B /* OnboardingSteps */ = {
 			isa = PBXGroup;
 			children = (
+				DDF691362DA30332008BF16C /* StartupGuideStepView.swift */,
 				DDF6905B2DA0AFC5008BF16C /* WelcomeStepView.swift */,
 				DDF6902B2DA028D3008BF16C /* DiagnosticsStepView.swift */,
 				DD3F1F8E2D9E151200DCE7B3 /* Nightscout */,
@@ -4216,6 +4219,7 @@
 				DD1745502C55CA5500211FAC /* UnitsLimitsSettingsProvider.swift in Sources */,
 				581AC4392BE22ED10038760C /* JSONConverter.swift in Sources */,
 				BD4064D12C4ED26900582F43 /* CoreDataObserver.swift in Sources */,
+				DDF691372DA30332008BF16C /* StartupGuideStepView.swift in Sources */,
 				58645B9B2CA2D24F008AFCE7 /* CarbSetup.swift in Sources */,
 				38E44536274E411700EC9A94 /* Disk.swift in Sources */,
 				19A910362A24D6D700C8951B /* DateFilter.swift in Sources */,

+ 39 - 0
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -2696,6 +2696,9 @@
         }
       }
     },
+    " the app before finishing onboarding, " : {
+
+    },
     " U" : {
       "comment" : "Insulin unit\nUnit in number of units delivered (keep the space character!)",
       "localizations" : {
@@ -8827,6 +8830,9 @@
         }
       }
     },
+    "•" : {
+
+    },
     "•  App diagnostic insights help us enhance app stability, ensure safety for all users, and enable us to quickly identify and resolve critical issues." : {
 
     },
@@ -43709,6 +43715,9 @@
         }
       }
     },
+    "Before you begin…" : {
+
+    },
     "Before you can begin with configuring your therapy settigns, Trio needs to know which units you use for your glucose and insulin measurements (based on your pump model)." : {
 
     },
@@ -88894,6 +88903,9 @@
         }
       }
     },
+    "Everything you enter here can be adjusted later in the app." : {
+
+    },
     "Example Calculation" : {
 
     },
@@ -95690,6 +95702,9 @@
         }
       }
     },
+    "force quit" : {
+
+    },
     "Forecast Display Type" : {
       "localizations" : {
         "bg" : {
@@ -107241,6 +107256,9 @@
         }
       }
     },
+    "https://triodocs.org/startup-guide" : {
+
+    },
     "If \"Display IOB and COB\" is also enabled, \"IOB\" and \"COB\" will be replaced with the following emojis:" : {
       "localizations" : {
         "bg" : {
@@ -178682,6 +178700,9 @@
         }
       }
     },
+    "Startup Guide" : {
+
+    },
     "State was restored" : {
       "comment" : "State was restored",
       "extractionState" : "manual",
@@ -183239,6 +183260,9 @@
         }
       }
     },
+    "Take a deep breath — you've got this." : {
+
+    },
     "Tap and hold a bar to reveal more details." : {
       "localizations" : {
         "bg" : {
@@ -190956,6 +190980,9 @@
         }
       }
     },
+    "There's no rush. Take all the time you need." : {
+
+    },
     "These two settings determine the range outside of which you will be notified via push notifications." : {
       "localizations" : {
         "bg" : {
@@ -203474,6 +203501,9 @@
         }
       }
     },
+    "Trio comes with a helpful Startup Guide designed to walk you through each step of your onboarding journey. We recommend opening it now and following along as you go — side by side." : {
+
+    },
     "Trio Configuration" : {
       "localizations" : {
         "bg" : {
@@ -213565,6 +213595,9 @@
         }
       }
     },
+    "Want a hand? You can open our full Startup Guide here:" : {
+
+    },
     "Warning" : {
       "comment" : "Warning title",
       "localizations" : {
@@ -219579,6 +219612,9 @@
         }
       }
     },
+    "You can pause at any time. Just be aware: if you " : {
+
+    },
     "You can personalize the conversion calculation by adjusting the following settings that will appear when this option is enabled:" : {
       "localizations" : {
         "bg" : {
@@ -220120,6 +220156,9 @@
         }
       }
     },
+    "your progress will not be saved." : {
+
+    },
     "ZT" : {
       "localizations" : {
         "bg" : {

+ 46 - 0
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/StartupGuideStepView.swift

@@ -0,0 +1,46 @@
+//
+//  StartupGuideStepView.swift
+//  Trio
+//
+//  Created by Cengiz Deniz on 06.04.25.
+//
+import SwiftUI
+
+struct StartupGuideStepView: View {
+    @Environment(\.openURL) var openURL
+
+    var body: some View {
+        VStack(spacing: 20) {
+            Text("Before you begin…")
+                .font(.title.bold())
+
+            VStack(alignment: .leading, spacing: 10) {
+                BulletPoint(String(localized: "Take a deep breath — you've got this."))
+                BulletPoint(String(localized: "There's no rush. Take all the time you need."))
+                BulletPoint(String(localized: "Everything you enter here can be adjusted later in the app."))
+                BulletPoint(String(localized: "Want a hand? You can open our full Startup Guide here:"))
+
+                Button {
+                    openURL(URL(string: "https://triodocs.org/startup-guide")!)
+                } label: {
+                    Text("https://triodocs.org/startup-guide")
+                        .padding(.horizontal, 12)
+                        .padding(.vertical, 8)
+                        .background(Color.blue.opacity(0.2))
+                        .cornerRadius(8)
+                }
+                .frame(maxWidth: .infinity, alignment: .center)
+                .padding([.top, .horizontal])
+            }.padding(.horizontal)
+
+            HStack {
+                Text("You can pause at any time. Just be aware: if you ")
+                    + Text("force quit").bold()
+                    + Text(" the app before finishing onboarding, ")
+                    + Text("your progress will not be saved.").bold()
+            }
+            .multilineTextAlignment(.leading)
+            .padding(.horizontal)
+        }
+    }
+}

+ 25 - 0
Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift

@@ -9,6 +9,7 @@ enum OnboardingNavigationDirection {
 /// Represents the different steps in the onboarding process.
 enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
     case welcome
+    case startupGuide
     case diagnostics
     case nightscout
     case unitSelection
@@ -35,6 +36,8 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
         switch self {
         case .welcome:
             return String(localized: "Welcome to Trio")
+        case .startupGuide:
+            return String(localized: "Startup Guide")
         case .diagnostics:
             return String(localized: "Diagnostics")
         case .nightscout:
@@ -63,6 +66,10 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
             return String(
                 localized: "Trio is a powerful app that helps you manage your diabetes. Let's get started by setting up a few important parameters that will help Trio work effectively for you."
             )
+        case .startupGuide:
+            return String(
+                localized: "Trio comes with a helpful Startup Guide designed to walk you through each step of your onboarding journey. We recommend opening it now and following along as you go — side by side."
+            )
         case .diagnostics:
             return String(
                 localized: "By default, Trio collects crash reports and other anonymized data related to errors, exceptions, and overall app performance."
@@ -107,6 +114,8 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
         switch self {
         case .welcome:
             return "hand.wave.fill"
+        case .startupGuide:
+            return "list.bullet.clipboard.fill"
         case .diagnostics:
             return "waveform.badge.magnifyingglass"
         case .nightscout:
@@ -151,6 +160,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
              .deliveryLimits,
              .diagnostics,
              .nightscout,
+             .startupGuide,
              .unitSelection,
              .welcome:
             return Color.blue
@@ -357,3 +367,18 @@ enum NightscoutSubstep: Int, CaseIterable, Identifiable {
 
     var id: Int { rawValue }
 }
+
+struct BulletPoint: View {
+    let text: String
+
+    init(_ text: String) {
+        self.text = text
+    }
+
+    var body: some View {
+        HStack(alignment: .top) {
+            Text("•")
+            Text(text)
+        }
+    }
+}

+ 2 - 0
Trio/Sources/Modules/Onboarding/View/OnboardingView.swift

@@ -131,6 +131,8 @@ extension Onboarding {
                                         switch currentStep {
                                         case .welcome:
                                             WelcomeStepView()
+                                        case .startupGuide:
+                                            StartupGuideStepView()
                                         case .diagnostics:
                                             DiagnosticsStepView(state: state)
                                         case .nightscout: