From 54d1974233e85f7b82e88f9b87b33c9c109f15c3 Mon Sep 17 00:00:00 2001 From: codebymini Date: Fri, 18 Sep 2026 10:11:13 +0200 Subject: [PATCH 1/2] Clarify remote command sent confirmation message --- LoopFollow/Remote/LoopAPNS/LoopAPNSBolusView.swift | 4 ++-- LoopFollow/Remote/LoopAPNS/LoopAPNSCarbsView.swift | 6 ++---- LoopFollow/Remote/RemoteCommandMessage.swift | 6 ++++++ LoopFollow/Remote/TRC/BolusView.swift | 4 ++-- LoopFollow/Remote/TRC/MealView.swift | 4 ++-- LoopFollow/Remote/TRC/OverrideView.swift | 6 +++--- LoopFollow/Remote/TRC/TempTargetView.swift | 6 +++--- 7 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 LoopFollow/Remote/RemoteCommandMessage.swift diff --git a/LoopFollow/Remote/LoopAPNS/LoopAPNSBolusView.swift b/LoopFollow/Remote/LoopAPNS/LoopAPNSBolusView.swift index 2cc834fc3..09222270c 100644 --- a/LoopFollow/Remote/LoopAPNS/LoopAPNSBolusView.swift +++ b/LoopFollow/Remote/LoopAPNS/LoopAPNSBolusView.swift @@ -270,7 +270,7 @@ struct LoopAPNSBolusView: View { switch alertType { case .success: return Alert( - title: Text("Success"), + title: Text("Command Sent"), message: Text(alertMessage), dismissButton: .default(Text("OK")) { presentationMode.wrappedValue.dismiss() @@ -409,7 +409,7 @@ struct LoopAPNSBolusView: View { } // Mark TOTP code as used TOTPService.shared.markTOTPAsUsed(qrCodeURL: Storage.shared.loopAPNSQrCodeURL.value) - self.alertMessage = "Insulin sent successfully!" + self.alertMessage = RemoteCommandMessage.sent self.alertType = .success LogManager.shared.log( category: .apns, diff --git a/LoopFollow/Remote/LoopAPNS/LoopAPNSCarbsView.swift b/LoopFollow/Remote/LoopAPNS/LoopAPNSCarbsView.swift index 32db0f9c9..537fa29d2 100644 --- a/LoopFollow/Remote/LoopAPNS/LoopAPNSCarbsView.swift +++ b/LoopFollow/Remote/LoopAPNS/LoopAPNSCarbsView.swift @@ -455,7 +455,7 @@ struct LoopAPNSCarbsView: View { switch alertType { case .success: return Alert( - title: Text("Success"), + title: Text("Command Sent"), message: Text(alertMessage), dismissButton: .default(Text("OK")) { presentationMode.wrappedValue.dismiss() @@ -571,9 +571,7 @@ struct LoopAPNSCarbsView: View { } // Mark TOTP code as used TOTPService.shared.markTOTPAsUsed(qrCodeURL: Storage.shared.loopAPNSQrCodeURL.value) - let timeFormatter = DateFormatter() - timeFormatter.timeStyle = .short - self.alertMessage = "Carbs sent successfully for \(timeFormatter.string(from: adjustedConsumedDate))!" + self.alertMessage = RemoteCommandMessage.sent self.alertType = .success LogManager.shared.log( category: .apns, diff --git a/LoopFollow/Remote/RemoteCommandMessage.swift b/LoopFollow/Remote/RemoteCommandMessage.swift new file mode 100644 index 000000000..2b59added --- /dev/null +++ b/LoopFollow/Remote/RemoteCommandMessage.swift @@ -0,0 +1,6 @@ +// LoopFollow +// RemoteCommandMessage.swift + +enum RemoteCommandMessage { + static let sent = "Remote command sent. Wait for a notification confirming the result." +} \ No newline at end of file diff --git a/LoopFollow/Remote/TRC/BolusView.swift b/LoopFollow/Remote/TRC/BolusView.swift index 7a59c87de..e41ab89ce 100644 --- a/LoopFollow/Remote/TRC/BolusView.swift +++ b/LoopFollow/Remote/TRC/BolusView.swift @@ -180,7 +180,7 @@ struct BolusView: View { ) case .statusSuccess: return Alert( - title: Text("Status"), + title: Text("Command Sent"), message: Text(statusMessage ?? ""), dismissButton: .default(Text("OK"), action: { presentationMode.wrappedValue.dismiss() @@ -322,7 +322,7 @@ struct BolusView: View { if sentUnits > 0 { QuickPickBolusesManager.shared.recordBolus(units: sentUnits) } - statusMessage = "Bolus command sent successfully." + statusMessage = RemoteCommandMessage.sent LogManager.shared.log( category: .apns, message: "sendBolusPushNotification succeeded - Bolus: \(InsulinFormatter.shared.string(bolusAmount)) U" diff --git a/LoopFollow/Remote/TRC/MealView.swift b/LoopFollow/Remote/TRC/MealView.swift index 5938735d1..5db2ef14b 100644 --- a/LoopFollow/Remote/TRC/MealView.swift +++ b/LoopFollow/Remote/TRC/MealView.swift @@ -299,7 +299,7 @@ struct MealView: View { ) case .statusSuccess: return Alert( - title: Text("Status"), + title: Text("Command Sent"), message: Text(statusMessage ?? ""), dismissButton: .default(Text("OK"), action: { presentationMode.wrappedValue.dismiss() @@ -362,7 +362,7 @@ struct MealView: View { bolus: bolusAmount.doubleValue(for: .internationalUnit()) ) } - statusMessage = "Meal command sent successfully." + statusMessage = RemoteCommandMessage.sent LogManager.shared.log( category: .apns, message: "sendMealPushNotification succeeded - Carbs: \(carbs.doubleValue(for: .gram())) g, Protein: \(protein.doubleValue(for: .gram())) g, Fat: \(fat.doubleValue(for: .gram())) g, Bolus: \(bolusAmount.doubleValue(for: .internationalUnit())) U, Scheduled: \(scheduledDate != nil ? formatDate(scheduledDate!) : "now")" diff --git a/LoopFollow/Remote/TRC/OverrideView.swift b/LoopFollow/Remote/TRC/OverrideView.swift index 703201b07..3ef038e03 100644 --- a/LoopFollow/Remote/TRC/OverrideView.swift +++ b/LoopFollow/Remote/TRC/OverrideView.swift @@ -147,7 +147,7 @@ struct OverrideView: View { ) case .statusSuccess: return Alert( - title: Text("Success"), + title: Text("Command Sent"), message: Text(statusMessage ?? ""), dismissButton: .default(Text("OK"), action: { presentationMode.wrappedValue.dismiss() @@ -181,7 +181,7 @@ struct OverrideView: View { DispatchQueue.main.async { self.isLoading = false if success { - self.statusMessage = "Override command sent successfully." + self.statusMessage = RemoteCommandMessage.sent self.alertType = .statusSuccess LogManager.shared.log(category: .apns, message: "sendOverridePushNotification succeeded for override: \(override.name)") } else { @@ -201,7 +201,7 @@ struct OverrideView: View { DispatchQueue.main.async { self.isLoading = false if success { - self.statusMessage = "Cancel override command sent successfully." + self.statusMessage = RemoteCommandMessage.sent self.alertType = .statusSuccess LogManager.shared.log(category: .apns, message: "sendCancelOverridePushNotification succeeded") } else { diff --git a/LoopFollow/Remote/TRC/TempTargetView.swift b/LoopFollow/Remote/TRC/TempTargetView.swift index ac2fa7303..08d316f35 100644 --- a/LoopFollow/Remote/TRC/TempTargetView.swift +++ b/LoopFollow/Remote/TRC/TempTargetView.swift @@ -189,7 +189,7 @@ struct TempTargetView: View { ) case .statusSuccess: return Alert( - title: Text("Status"), + title: Text("Command Sent"), message: Text(statusMessage ?? ""), dismissButton: .default(Text("OK"), action: { presentationMode.wrappedValue.dismiss() @@ -261,7 +261,7 @@ struct TempTargetView: View { DispatchQueue.main.async { self.isLoading = false if success { - self.statusMessage = "Temp target command successfully sent." + self.statusMessage = RemoteCommandMessage.sent self.alertType = .statusSuccess LogManager.shared.log(category: .apns, message: "sendTempTargetPushNotification succeeded with target: \(newHKTarget), duration: \(duration)") } else { @@ -281,7 +281,7 @@ struct TempTargetView: View { DispatchQueue.main.async { self.isLoading = false if success { - self.statusMessage = "Cancel temp target command successfully sent." + self.statusMessage = RemoteCommandMessage.sent self.alertType = .statusSuccess LogManager.shared.log(category: .apns, message: "sendCancelTempTargetPushNotification succeeded") } else { From d6e609e286321adab325362880beb48149562729 Mon Sep 17 00:00:00 2001 From: codebymini Date: Fri, 18 Sep 2026 10:13:13 +0200 Subject: [PATCH 2/2] Fix formatting by adding a newline at the end of RemoteCommandMessage.swift --- LoopFollow/Remote/RemoteCommandMessage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LoopFollow/Remote/RemoteCommandMessage.swift b/LoopFollow/Remote/RemoteCommandMessage.swift index 2b59added..686734b88 100644 --- a/LoopFollow/Remote/RemoteCommandMessage.swift +++ b/LoopFollow/Remote/RemoteCommandMessage.swift @@ -3,4 +3,4 @@ enum RemoteCommandMessage { static let sent = "Remote command sent. Wait for a notification confirming the result." -} \ No newline at end of file +}