Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOOP-1486: add suspend threshold information screen + editor #14

Merged
merged 48 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
28c0916
Add delegate
Jul 1, 2020
2c67693
Add correction range editor
Jul 1, 2020
6515313
Add educational screen
Jul 1, 2020
5c3ccc4
Add correction range override editor
Jul 1, 2020
8d823e4
Call step completion delegate when done
Jul 2, 2020
e37d939
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 2, 2020
d512942
Add correction range override info screen
Jul 2, 2020
9ba3927
Save workout range as well
Jul 2, 2020
fa1d0bf
Move flow button into setup service, and add setting delegate
Jul 2, 2020
0198d99
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 2, 2020
e7726cf
Fix button jumping bug
Jul 2, 2020
94c198f
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 2, 2020
82933e3
Clear screen stack if resetting
Jul 3, 2020
e719dff
Merge branch 'novalegra/LOOP-1484' into LOOP-1485-temp-cr
Jul 3, 2020
5520b85
Add suspend threshold info screen
Jul 3, 2020
4bf68e4
Add suspend threshold editor
Jul 3, 2020
a27fd30
Use prescription instead of view model to vend settings
Jul 3, 2020
41b36a1
Use TherapySettings instead of LoopSettings
Jul 6, 2020
5508179
Merge remote-tracking branch 'origin/novalegra/LOOP-1484' into LOOP-1…
Jul 6, 2020
fe28d53
PR feedback
Jul 7, 2020
8349362
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 7, 2020
f0adf19
Update based on PR
Jul 7, 2020
24e0c21
Change color name
Jul 7, 2020
a8052f0
Merge branch 'LOOP-1485-temp-cr' into LOOP-1486-suspend
Jul 7, 2020
8bfaceb
PR feedback
Jul 7, 2020
89ab963
More PR feedback
Jul 7, 2020
eff80e9
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 7, 2020
107f81e
PR changes
Jul 7, 2020
3d2c379
Use secondary color if in dark mode, else blue gray
Jul 7, 2020
1f0413a
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 7, 2020
cb9b2d6
Make titles appear at correct time
Jul 8, 2020
e85a9a4
Change coloring to .secondary
Jul 8, 2020
01a76f9
Hack to prevent jumping
Jul 8, 2020
aa0405e
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 8, 2020
45e3393
Add jumping hack
Jul 8, 2020
4970ba8
Change name & clean up
Jul 8, 2020
fda9362
Merge branch 'LOOP-1484-CR' into LOOP-1485-temp-cr
Jul 8, 2020
673efbf
Remove userHasEdited
Jul 8, 2020
6304a95
Merge remote-tracking branch 'origin/dev' into LOOP-1485-temp-cr
Jul 8, 2020
74b2c51
Change name
Jul 8, 2020
9bd8522
Ensure title isn't cut off
Jul 8, 2020
7d7a254
Merge remote-tracking branch 'origin/dev' into LOOP-1486-suspend
Jul 9, 2020
cc569af
Make variable name more descriptive
Jul 9, 2020
7e69d3e
Merge branch 'LOOP-1485-temp-cr' into LOOP-1486-suspend
Jul 9, 2020
3306532
Update based on downstream changes
Jul 9, 2020
d7345f5
Use accent color as step color
Jul 9, 2020
8c7eddc
Merge branch 'dev' into LOOP-1486-suspend
Jul 10, 2020
ccbd735
Make TherapySettings a subcomponent of a prescription
Jul 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TidepoolService.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@
A9DAAD6F22E7EA9700E76C9F /* NibLoadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DAAD6E22E7EA9700E76C9F /* NibLoadable.swift */; };
E916F56D24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = E916F56C24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift */; };
E93BA05E24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93BA05D24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift */; };
E916F56D24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = E916F56C24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift */; };
E93BA06024A15FA800C5D7E6 /* PrescriptionDeviceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93BA05F24A15FA800C5D7E6 /* PrescriptionDeviceView.swift */; };
E93BA06224A29C9C00C5D7E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E93BA06124A29C9C00C5D7E6 /* Assets.xcassets */; };
E9692172249BC73600D9BE3B /* MockPrescriptionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9692171249BC73600D9BE3B /* MockPrescriptionManager.swift */; };
E9692174249BF2A100D9BE3B /* MockPrescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9692173249BF2A100D9BE3B /* MockPrescription.swift */; };
E9692176249C1AE700D9BE3B /* PrescriptionReviewUICoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9692175249C1AE700D9BE3B /* PrescriptionReviewUICoordinator.swift */; };
E96AEB98249C2FF1003797B4 /* PrescriptionCodeEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E96AEB97249C2FF1003797B4 /* PrescriptionCodeEntryView.swift */; };
E96DCB5C24AF7723007117BC /* SuspendThresholdReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = E96DCB5B24AF7723007117BC /* SuspendThresholdReview.swift */; };
E991F1B724A548580059281B /* AdaptiveKeyboardPadding.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */; };
E991F1BB24A654CC0059281B /* TimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1BA24A654CC0059281B /* TimeInterval.swift */; };
E991F1C524AAB25C0059281B /* CorrectionRangeReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */; };
Expand Down Expand Up @@ -181,12 +183,14 @@
A9DAAD6E22E7EA9700E76C9F /* NibLoadable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NibLoadable.swift; sourceTree = "<group>"; };
E916F56C24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CorrectionRangeOverrideReview.swift; sourceTree = "<group>"; };
E93BA05D24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionReviewViewModel.swift; sourceTree = "<group>"; };
E916F56C24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CorrectionRangeOverrideReview.swift; sourceTree = "<group>"; };
E93BA05F24A15FA800C5D7E6 /* PrescriptionDeviceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionDeviceView.swift; sourceTree = "<group>"; };
E93BA06124A29C9C00C5D7E6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
E9692171249BC73600D9BE3B /* MockPrescriptionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPrescriptionManager.swift; sourceTree = "<group>"; };
E9692173249BF2A100D9BE3B /* MockPrescription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPrescription.swift; sourceTree = "<group>"; };
E9692175249C1AE700D9BE3B /* PrescriptionReviewUICoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionReviewUICoordinator.swift; sourceTree = "<group>"; };
E96AEB97249C2FF1003797B4 /* PrescriptionCodeEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrescriptionCodeEntryView.swift; sourceTree = "<group>"; };
E96DCB5B24AF7723007117BC /* SuspendThresholdReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuspendThresholdReview.swift; sourceTree = "<group>"; };
E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveKeyboardPadding.swift; sourceTree = "<group>"; };
E991F1BA24A654CC0059281B /* TimeInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeInterval.swift; sourceTree = "<group>"; };
E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CorrectionRangeReviewView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -420,6 +424,7 @@
E991F1B624A548580059281B /* AdaptiveKeyboardPadding.swift */,
E991F1C424AAB25C0059281B /* CorrectionRangeReviewView.swift */,
E916F56C24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift */,
E96DCB5B24AF7723007117BC /* SuspendThresholdReview.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -796,6 +801,7 @@
E93BA05E24A14CBA00C5D7E6 /* PrescriptionReviewViewModel.swift in Sources */,
E991F1C524AAB25C0059281B /* CorrectionRangeReviewView.swift in Sources */,
A92E770122E9181500591027 /* TidepoolServiceSetupViewController.swift in Sources */,
E96DCB5C24AF7723007117BC /* SuspendThresholdReview.swift in Sources */,
A9DAAD3B22E7DEF100E76C9F /* TidepoolServiceSettingsViewController.swift in Sources */,
E916F56D24AD3DA600BE3547 /* CorrectionRangeOverrideReview.swift in Sources */,
);
Expand Down
53 changes: 4 additions & 49 deletions TidepoolServiceKit/Mocks/MockPrescription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,65 +45,20 @@ public struct MockPrescription: Codable {
public let cgm: CGMType // CGM type (manufacturer & model)
public let pump: PumpType // Pump type (manufacturer & model)
public let bloodGlucoseUnit: BGUnit
public let basalRateSchedule: BasalRateSchedule
Copy link
Contributor Author

@novalegra novalegra Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are to make TherapySettings be a subcomponent of a prescription

public let glucoseTargetRangeSchedule: GlucoseRangeSchedule
public let carbRatioSchedule: CarbRatioSchedule
public let insulinSensitivitySchedule: InsulinSensitivitySchedule
public let maximumBasalRatePerHour: Double
public let maximumBolus: Double
public let suspendThreshold: GlucoseThreshold
public let insulinModel: InsulinModel
public let preMealTargetRange: DoubleRange
public let workoutTargetRange: DoubleRange
public let therapySettings: TherapySettings

public init(datePrescribed: Date,
providerName: String,
cgmType: CGMType,
pumpType: PumpType,
bloodGlucoseUnit: BGUnit,
basalRateSchedule: BasalRateSchedule,
glucoseTargetRangeSchedule: GlucoseRangeSchedule,
carbRatioSchedule: CarbRatioSchedule,
insulinSensitivitySchedule: InsulinSensitivitySchedule,
maximumBasalRatePerHour: Double,
maximumBolus: Double,
suspendThreshold: GlucoseThreshold,
insulinModel: InsulinModel,
preMealTargetRange: DoubleRange,
workoutTargetRange: DoubleRange) {
therapySettings: TherapySettings
) {
self.datePrescribed = datePrescribed
self.providerName = providerName
self.cgm = cgmType
self.pump = pumpType
self.bloodGlucoseUnit = bloodGlucoseUnit
self.basalRateSchedule = basalRateSchedule
self.glucoseTargetRangeSchedule = glucoseTargetRangeSchedule
self.carbRatioSchedule = carbRatioSchedule
self.insulinSensitivitySchedule = insulinSensitivitySchedule
self.maximumBasalRatePerHour = maximumBasalRatePerHour
self.maximumBolus = maximumBolus
self.suspendThreshold = suspendThreshold
self.insulinModel = insulinModel
self.preMealTargetRange = preMealTargetRange
self.workoutTargetRange = workoutTargetRange
}

public struct InsulinModel: Codable, Equatable {
public enum ModelType: String, Codable {
case fiasp
case rapidAdult
case rapidChild
case walsh
}

public let modelType: ModelType
public let actionDuration: TimeInterval
public let peakActivity: TimeInterval?

public init(modelType: ModelType, actionDuration: TimeInterval, peakActivity: TimeInterval? = nil) {
self.modelType = modelType
self.actionDuration = actionDuration
self.peakActivity = peakActivity
}
self.therapySettings = therapySettings
}
}
27 changes: 16 additions & 11 deletions TidepoolServiceKit/Mocks/MockPrescriptionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,29 @@ public class MockPrescriptionManager {
RepeatingScheduleValue(startTime: .hours(16), value: 12.0),
RepeatingScheduleValue(startTime: .hours(18), value: 8.0),
RepeatingScheduleValue(startTime: .hours(21), value: 10.0)],
timeZone: timeZone)!
timeZone: timeZone)!

let therapySettings = TherapySettings(
glucoseTargetRangeSchedule: glucoseTargetRangeSchedule,
preMealTargetRange: DoubleRange(minValue: 80.0, maxValue: 90.0),
workoutTargetRange: DoubleRange(minValue: 130.0, maxValue: 140.0),
maximumBasalRatePerHour: 3,
maximumBolus: 5,
suspendThreshold: GlucoseThreshold(unit: .milligramsPerDeciliter, value: 80),
insulinSensitivitySchedule: insulinSensitivitySchedule,
carbRatioSchedule: carbRatioSchedule,
basalRateSchedule: basalRateSchedule,
insulinModel: StoredSettings.InsulinModel(modelType: .rapidAdult, actionDuration: .hours(6), peakActivity: .hours(3))
)

self.prescription = MockPrescription(
datePrescribed: Date(),
providerName: "Sally Seastar",
cgmType: CGMType.g6,
pumpType: PumpType.dash,
bloodGlucoseUnit: .mgdl,
basalRateSchedule: basalRateSchedule,
glucoseTargetRangeSchedule: glucoseTargetRangeSchedule,
carbRatioSchedule: carbRatioSchedule,
insulinSensitivitySchedule: insulinSensitivitySchedule,
maximumBasalRatePerHour: 3.0,
maximumBolus: 5.0,
suspendThreshold: GlucoseThreshold(unit: .milligramsPerDeciliter, value: 70),
insulinModel: MockPrescription.InsulinModel(modelType: .rapidAdult, actionDuration: .hours(6), peakActivity: .hours(3)),
preMealTargetRange: DoubleRange(minValue: 80.0, maxValue: 90.0),
workoutTargetRange: DoubleRange(minValue: 130.0, maxValue: 140.0))
therapySettings: therapySettings
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ enum PrescriptionReviewScreen {
case correctionRangeEditor
case correctionRangeOverrideInfo
case correctionRangeOverrideEditor
case suspendThresholdInfo
case suspendThresholdEditor

func next() -> PrescriptionReviewScreen? {
switch self {
Expand All @@ -32,6 +34,10 @@ enum PrescriptionReviewScreen {
case .correctionRangeOverrideInfo:
return .correctionRangeOverrideEditor
case .correctionRangeOverrideEditor:
return .suspendThresholdInfo
case .suspendThresholdInfo:
return .suspendThresholdEditor
case .suspendThresholdEditor:
return nil
}
}
Expand Down Expand Up @@ -124,6 +130,25 @@ class PrescriptionReviewUICoordinator: UINavigationController, CompletionNotifyi
let hostedView = DismissibleHostingController(rootView: view)
hostedView.navigationItem.largeTitleDisplayMode = .never // TODO: hack to fix jumping, will be removed once editors have titles
return hostedView
case .suspendThresholdInfo:
let exiting: (() -> Void) = { [weak self] in
self?.stepFinished()
}
let view = SuspendThresholdInformationView(onExit: exiting)
let hostedView = DismissibleHostingController(rootView: view)
hostedView.navigationItem.largeTitleDisplayMode = .always // TODO: hack to fix jumping, will be removed once editors have titles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if this blocks the scrolls of the title up into the navigation bar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .never would do that if there was an actual title in the settings editor screens, but the settings editors' titles are actually empty strings, so they appear the same

hostedView.title = LocalizedString("Suspend Threshold", comment: "Title for suspend threshold informational screen")
return hostedView
case .suspendThresholdEditor:
guard let prescription = viewModel.prescription else {
// Go back to code entry step if we don't have prescription
let view = PrescriptionCodeEntryView(viewModel: viewModel)
return DismissibleHostingController(rootView: view)
}
Comment on lines +143 to +147
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is curious to me. Is this a possible entry point of the workflow or can the user just jump to this point? Just trying to understand how the user can get here without the needed information, which then bumps them to the start of the workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user shouldn't be able to get here without a prescription; this is primarily to unwrap it (since it's an optional in the view model) and to catch anything weird that could have happened with the Tidepool backend.

let view = SuspendThresholdReview(model: viewModel, prescription: prescription)
let hostedView = DismissibleHostingController(rootView: view)
hostedView.navigationItem.largeTitleDisplayMode = .never // TODO: hack to fix jumping, will be removed once editors have titles
return hostedView
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ class PrescriptionReviewViewModel: ObservableObject {
settings.preMealTargetRange = overrides.preMeal?.doubleRange(for: unit)
settings.workoutTargetRange = overrides.workout?.doubleRange(for: unit)
}

func saveSuspendThreshold(value: GlucoseThreshold) {
settings.suspendThreshold = value
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ struct CorrectionRangeOverrideReview: View {
var body: some View {
CorrectionRangeOverridesEditor(
value: CorrectionRangeOverrides(
preMeal: prescription.preMealTargetRange,
workout: prescription.workoutTargetRange,
preMeal: prescription.therapySettings.preMealTargetRange,
workout: prescription.therapySettings.workoutTargetRange,
unit: prescription.bloodGlucoseUnit.hkUnit
),
unit: prescription.bloodGlucoseUnit.hkUnit,
correctionRangeScheduleRange: prescription.glucoseTargetRangeSchedule.scheduleRange(),
minValue: prescription.suspendThreshold.quantity,
correctionRangeScheduleRange: (prescription.therapySettings.glucoseTargetRangeSchedule?.scheduleRange())!,
minValue: prescription.therapySettings.suspendThreshold?.quantity,
onSave: { overrides in
self.viewModel.saveCorrectionRangeOverrides(overrides: overrides, unit: self.prescription.bloodGlucoseUnit.hkUnit)
self.viewModel.didFinishStep()
Expand Down
4 changes: 2 additions & 2 deletions TidepoolServiceKitUI/Views/CorrectionRangeReviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ struct CorrectionRangeReviewView: View {

var body: some View {
CorrectionRangeScheduleEditor(
schedule: prescription.glucoseTargetRangeSchedule,
schedule: prescription.therapySettings.glucoseTargetRangeSchedule,
unit: prescription.bloodGlucoseUnit.hkUnit,
minValue: prescription.suspendThreshold.quantity,
minValue: prescription.therapySettings.suspendThreshold?.quantity,
onSave: { newSchedule in
self.viewModel.saveCorrectionRange(range: newSchedule)
self.viewModel.didFinishStep()
Expand Down
3 changes: 1 addition & 2 deletions TidepoolServiceKitUI/Views/PrescriptionCodeEntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ struct PrescriptionCodeEntryView: View, HorizontalSizeClassOverride {
InstructionList(instructions: [
LocalizedString("Prescription activation code", comment: "Label text for the first needed prescription activation item"),
LocalizedString("Configuration settings for glucose targets and insulin delivery from your healthcare provider", comment: "Label text for the second needed prescription activation item")
],
stepsColor: .secondary
]
)
.foregroundColor(.secondary)
}
Expand Down
41 changes: 41 additions & 0 deletions TidepoolServiceKitUI/Views/SuspendThresholdReview.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// SuspendThresholdReview.swift
// TidepoolServiceKitUI
//
// Created by Anna Quinlan on 7/3/20.
// Copyright © 2020 LoopKit Authors. All rights reserved.
//

import SwiftUI
import LoopKitUI
import LoopKit
import HealthKit
import TidepoolServiceKit


struct SuspendThresholdReview: View {
@ObservedObject var viewModel: PrescriptionReviewViewModel
let prescription: MockPrescription

init(
model: PrescriptionReviewViewModel,
prescription: MockPrescription
) {
self.viewModel = model
self.prescription = prescription
}

var body: some View {
SuspendThresholdEditor(
value: prescription.therapySettings.suspendThreshold?.quantity,
unit: prescription.bloodGlucoseUnit.hkUnit,
maxValue: prescription.therapySettings.glucoseTargetRangeSchedule?.minLowerBound(),
onSave: { newValue in
let unit = self.prescription.bloodGlucoseUnit.hkUnit
self.viewModel.saveSuspendThreshold(value: GlucoseThreshold(unit: unit, value: newValue.doubleValue(for: unit)))
self.viewModel.didFinishStep()
},
mode: .flow
)
}
}