From 1fc7ef37af9f8d7aff45eb30ba512ed7e322d5ea Mon Sep 17 00:00:00 2001 From: Wesley Keetch <156481176+weskcode@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:21:14 -0500 Subject: [PATCH 1/4] fix: tune motion timing, fade the card countdown, and play the completion bounce - The completion sheet's bounce was keyed to outcome.id, which never changes while the sheet is open, so it never played. It now fires on appearance, and the icon, text and button arrive 60 ms apart. - The card countdown fades in with its scale instead of popping in. - The Watch ring drains linearly over each 1 s tick instead of easing in and out every second. - The splash button fades in with an ease-out. - Press-in on preset rows is faster than the release. - Toasts leave faster than they arrive. - Onboarding widget steps arrive 150 ms apart instead of 400 ms, and leaving the page cancels steps still waiting. - The preset radio fill grows from half size, and only fades under Reduce Motion. - Removed an invisible 0.995 scale from the flip tiles. --- Sources/RHOIDS/DesignSystem/AppToast.swift | 13 ++++++++----- .../DesignSystem/PressableButtonStyle.swift | 7 ++++++- Sources/RHOIDS/Features/Home/PresetRow.swift | 2 +- .../Onboarding/OnboardingWidgetPageView.swift | 14 ++++++++------ .../RHOIDS/Features/Onboarding/SplashView.swift | 2 +- .../RHOIDS/Features/Timer/CardTimerView.swift | 2 +- .../RHOIDS/Features/Timer/FlipTimerView.swift | 1 - .../Features/Timer/TimerCompleteView.swift | 17 +++++++++++------ Sources/RHOIDS/Utilities/AppMotion.swift | 10 ++++++++++ .../Features/Timer/WatchTimerView.swift | 2 +- 10 files changed, 47 insertions(+), 23 deletions(-) diff --git a/Sources/RHOIDS/DesignSystem/AppToast.swift b/Sources/RHOIDS/DesignSystem/AppToast.swift index c16785b..7f95023 100644 --- a/Sources/RHOIDS/DesignSystem/AppToast.swift +++ b/Sources/RHOIDS/DesignSystem/AppToast.swift @@ -34,11 +34,10 @@ private struct ToastModifier: ViewModifier { ToastView(toast: toast) .padding(.horizontal, AppSpacing.xxl) .padding(edge == .top ? .top : .bottom, AppSpacing.sm) - .transition( - reduceMotion - ? .opacity - : .move(edge: edge == .top ? .top : .bottom).combined(with: .opacity) - ) + .transition(.asymmetric( + insertion: transition, + removal: transition.animation(AppMotion.dismissal(reduceMotion: reduceMotion)) + )) // Never intercept touches on the underlying UI. .allowsHitTesting(false) .task(id: toast.id) { @@ -50,6 +49,10 @@ private struct ToastModifier: ViewModifier { } .animation(AppMotion.reveal(reduceMotion: reduceMotion), value: toast) } + + private var transition: AnyTransition { + reduceMotion ? .opacity : .move(edge: edge == .top ? .top : .bottom).combined(with: .opacity) + } } private struct ToastView: View { diff --git a/Sources/RHOIDS/DesignSystem/PressableButtonStyle.swift b/Sources/RHOIDS/DesignSystem/PressableButtonStyle.swift index 8359d42..6e41ac8 100644 --- a/Sources/RHOIDS/DesignSystem/PressableButtonStyle.swift +++ b/Sources/RHOIDS/DesignSystem/PressableButtonStyle.swift @@ -22,7 +22,12 @@ struct PressableButtonStyle: ButtonStyle { var body: some View { configuration.label .scaleEffect(reduceMotion || !configuration.isPressed ? 1 : pressedScale) - .animation(AppMotion.feedback(reduceMotion: reduceMotion), value: configuration.isPressed) + .animation( + configuration.isPressed + ? AppMotion.pressDown(reduceMotion: reduceMotion) + : AppMotion.feedback(reduceMotion: reduceMotion), + value: configuration.isPressed + ) .contentShape(Rectangle()) } } diff --git a/Sources/RHOIDS/Features/Home/PresetRow.swift b/Sources/RHOIDS/Features/Home/PresetRow.swift index 59b5f66..75e66a5 100644 --- a/Sources/RHOIDS/Features/Home/PresetRow.swift +++ b/Sources/RHOIDS/Features/Home/PresetRow.swift @@ -57,7 +57,7 @@ struct PresetRow: View { Circle() .fill(Color.accentColor) - .scaleEffect(isSelected ? 1 : 0.2) + .scaleEffect(isSelected || reduceMotion ? 1 : 0.5) .opacity(isSelected ? 1 : 0) Image(systemName: "checkmark") diff --git a/Sources/RHOIDS/Features/Onboarding/OnboardingWidgetPageView.swift b/Sources/RHOIDS/Features/Onboarding/OnboardingWidgetPageView.swift index 6ee3ddf..cf83745 100644 --- a/Sources/RHOIDS/Features/Onboarding/OnboardingWidgetPageView.swift +++ b/Sources/RHOIDS/Features/Onboarding/OnboardingWidgetPageView.swift @@ -19,7 +19,7 @@ struct OnboardingWidgetPageView: View { } .scrollIndicators(.hidden) .scrollBounceBehavior(.basedOnSize) - .onAppear { animateSteps() } + .task { await animateSteps() } .onDisappear { visibleCount = 0 } } @@ -65,15 +65,17 @@ struct OnboardingWidgetPageView: View { } } - private func animateSteps() { - let stepDelay: Duration = reduceMotion ? .zero : .milliseconds(400) + /// Reveals the steps one after another. Runs in `.task`, so leaving the + /// page cancels any steps still waiting. + private func animateSteps() async { + let stepDelay: Duration = reduceMotion ? .zero : .milliseconds(150) let animation = AppMotion.contextChange(reduceMotion: reduceMotion) for index in 0 ..< page.features.count { - Task { - try? await Task.sleep(for: stepDelay * index) - withAnimation(animation) { visibleCount = index + 1 } + if index > 0 { + do { try await Task.sleep(for: stepDelay) } catch { return } } + withAnimation(animation) { visibleCount = index + 1 } } } } diff --git a/Sources/RHOIDS/Features/Onboarding/SplashView.swift b/Sources/RHOIDS/Features/Onboarding/SplashView.swift index cf6339b..43f5549 100644 --- a/Sources/RHOIDS/Features/Onboarding/SplashView.swift +++ b/Sources/RHOIDS/Features/Onboarding/SplashView.swift @@ -63,7 +63,7 @@ struct SplashView: View { Task { try? await Task.sleep(for: .milliseconds(600)) if showGetStarted { - withAnimation(.easeIn(duration: 0.4)) { buttonOpacity = 1 } + withAnimation(AppMotion.reveal(reduceMotion: reduceMotion)) { buttonOpacity = 1 } } else { fadeOut() } diff --git a/Sources/RHOIDS/Features/Timer/CardTimerView.swift b/Sources/RHOIDS/Features/Timer/CardTimerView.swift index 3892cbf..a28e692 100644 --- a/Sources/RHOIDS/Features/Timer/CardTimerView.swift +++ b/Sources/RHOIDS/Features/Timer/CardTimerView.swift @@ -64,7 +64,7 @@ struct CardTimerView: View { if showsCountdown { TimerCountdownText(endDate: endDate, size: countdownSize, frozenRemaining: frozenRemaining) - .transition(.scale(scale: 0.98)) + .transition(reduceMotion ? .opacity : .opacity.combined(with: .scale(scale: 0.98))) } } .padding(.horizontal, showsCountdown ? 28 : 0) diff --git a/Sources/RHOIDS/Features/Timer/FlipTimerView.swift b/Sources/RHOIDS/Features/Timer/FlipTimerView.swift index c8b4146..ce3feab 100644 --- a/Sources/RHOIDS/Features/Timer/FlipTimerView.swift +++ b/Sources/RHOIDS/Features/Timer/FlipTimerView.swift @@ -161,7 +161,6 @@ private struct FlipDigitTile: View { anchor: .center, perspective: 0.7 ) - .scaleEffect(isFlipping && !reduceMotion ? 0.995 : 1) .animation(AppMotion.digitFlip(reduceMotion: reduceMotion), value: isFlipping) .onChange(of: digit) { _, newDigit in updateDigit(newDigit) diff --git a/Sources/RHOIDS/Features/Timer/TimerCompleteView.swift b/Sources/RHOIDS/Features/Timer/TimerCompleteView.swift index fee88e2..c7473b1 100644 --- a/Sources/RHOIDS/Features/Timer/TimerCompleteView.swift +++ b/Sources/RHOIDS/Features/Timer/TimerCompleteView.swift @@ -14,6 +14,7 @@ struct TimerCompleteView: View { completionIcon .opacity(contentAppeared ? 1 : 0) .scaleEffect(reduceMotion ? 1 : (contentAppeared ? 1 : 0.92)) + .animation(entrance(step: 0), value: contentAppeared) VStack(spacing: 12) { Text(outcome.title) @@ -31,6 +32,7 @@ struct TimerCompleteView: View { } .opacity(contentAppeared ? 1 : 0) .offset(y: reduceMotion ? 0 : (contentAppeared ? 0 : 10)) + .animation(entrance(step: 1), value: contentAppeared) Spacer(minLength: 0) @@ -45,6 +47,7 @@ struct TimerCompleteView: View { .accessibilityHint("Closes the timer.") .opacity(contentAppeared ? 1 : 0) .offset(y: reduceMotion ? 0 : (contentAppeared ? 0 : 12)) + .animation(entrance(step: 2), value: contentAppeared) } .scenePadding(.horizontal) .padding(.vertical, 32) @@ -52,11 +55,13 @@ struct TimerCompleteView: View { .presentationDetents(dynamicTypeSize.isAccessibilitySize ? [.large] : [.medium]) .presentationDragIndicator(.hidden) .interactiveDismissDisabled() - .task { - withAnimation(AppMotion.timerCompletion(reduceMotion: reduceMotion)) { - contentAppeared = true - } - } + .task { contentAppeared = true } + } + + /// Icon, then text, then button, 60 ms apart. Reduce Motion fades them in together. + private func entrance(step: Int) -> Animation { + let animation = AppMotion.timerCompletion(reduceMotion: reduceMotion) + return reduceMotion ? animation : animation.delay(0.06 * Double(step)) } @ViewBuilder @@ -85,7 +90,7 @@ struct TimerCompleteView: View { if reduceMotion { icon } else { - icon.symbolEffect(.bounce, value: outcome.id) + icon.symbolEffect(.bounce, value: contentAppeared) } } } diff --git a/Sources/RHOIDS/Utilities/AppMotion.swift b/Sources/RHOIDS/Utilities/AppMotion.swift index aaa8046..078bdbf 100644 --- a/Sources/RHOIDS/Utilities/AppMotion.swift +++ b/Sources/RHOIDS/Utilities/AppMotion.swift @@ -21,6 +21,16 @@ enum AppMotion { reduceMotion ? .easeOut(duration: 0.12) : .snappy(duration: 0.22) } + /// Press-in for custom buttons. Shorter than `feedback`, which handles the release. + static func pressDown(reduceMotion: Bool) -> Animation { + reduceMotion ? .easeOut(duration: 0.08) : .snappy(duration: 0.12) + } + + /// Exits run faster than `reveal`, which brings the same views in. + static func dismissal(reduceMotion: Bool) -> Animation { + reduceMotion ? .easeOut(duration: 0.12) : .easeOut(duration: 0.18) + } + static func optionSelection(reduceMotion: Bool) -> Animation { reduceMotion ? .easeOut(duration: 0.12) : .smooth(duration: 0.24) } diff --git a/Sources/RHOIDSWatch/Features/Timer/WatchTimerView.swift b/Sources/RHOIDSWatch/Features/Timer/WatchTimerView.swift index 82712bf..acb2075 100644 --- a/Sources/RHOIDSWatch/Features/Timer/WatchTimerView.swift +++ b/Sources/RHOIDSWatch/Features/Timer/WatchTimerView.swift @@ -162,7 +162,7 @@ struct WatchRingView: View { ) .rotationEffect(.degrees(-90)) .animation( - reduceMotion ? nil : .easeInOut(duration: 0.4), + reduceMotion ? nil : .linear(duration: 1), value: progress ) From 41f6a575a7ab3cc4e29097606cc99e2402f2ca10 Mon Sep 17 00:00:00 2001 From: Wesley Keetch <156481176+weskcode@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:21:14 -0500 Subject: [PATCH 2/4] fix: keep the countdown format when a timer stops The frozen countdown shown on stop and completion padded minutes ("02:39") while the live timer text does not ("2:39"), so the digits jumped the moment you tapped Stop Early. --- RHOIDS.xcodeproj/project.pbxproj | 34 +++++++++++-------- .../Features/Timer/TimerCountdownText.swift | 6 ++-- .../Features/TimerCountdownTextTests.swift | 20 +++++++++++ 3 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 Tests/RHOIDSTests/Features/TimerCountdownTextTests.swift diff --git a/RHOIDS.xcodeproj/project.pbxproj b/RHOIDS.xcodeproj/project.pbxproj index f2c3b6d..550e752 100644 --- a/RHOIDS.xcodeproj/project.pbxproj +++ b/RHOIDS.xcodeproj/project.pbxproj @@ -190,6 +190,7 @@ B42FC6F1A51D945032110348 /* TimerOutcomeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EAED3C257E6B636D76F4FD7 /* TimerOutcomeTests.swift */; }; B4804CCEEE75AFA6742655BA /* LiveActivityServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D3A22B0DF50EA61FAAA07BA /* LiveActivityServiceTests.swift */; }; B55678998AA1226C3ADC7519 /* ScreenTimeServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 292895CA715257238FC02040 /* ScreenTimeServiceTests.swift */; }; + B670D4525FD24069B36F0B8A /* TimerCountdownTextTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA5C8CDA20CE29C27EEDD82 /* TimerCountdownTextTests.swift */; }; B6D48B80CF9F22888D81E97E /* TimerServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA81BAA8D996BF952FE4F89C /* TimerServiceTests.swift */; }; B6DB0A4BBFF1B0AFCFC3F8DD /* WatchAppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 840BA11C65FAD13F6B48DA91 /* WatchAppIcon.icon */; }; B9A4EB9A458B648D90280326 /* WidgetSetupChecklist.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFF6C2A79DCA27192A942C0 /* WidgetSetupChecklist.swift */; }; @@ -323,33 +324,31 @@ 0AC87C1644702D79ED22A174 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles; + dstPath = RepoFiles/Sources; dstSubfolderSpec = 7; files = ( - 70A12CFA767FE5D68E011501 /* RHOIDS.storekit in CopyFiles */, - F3A1ABDA5B618F26D449FA4A /* project.yml in CopyFiles */, + 46D85033591F9A14635D8A26 /* Localizable.xcstrings in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 5063E541EE2740EEDC69E9E5 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles/Sources/RHOIDS; + dstPath = RepoFiles/RHOIDS.xcodeproj; dstSubfolderSpec = 7; files = ( - 0C6D4EB180E6245F1DE2109E /* Info.plist in CopyFiles */, - 4372D96D259B63EFDAA04DC5 /* RHOIDS.entitlements in CopyFiles */, + 948934A6233438F06BCA77CF /* project.pbxproj in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 82F60B18E8CBB62377FFBE00 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles/Sources/RHOIDSWidget; + dstPath = RepoFiles; dstSubfolderSpec = 7; files = ( - 2183A18A15C5FA2D86D97148 /* Info.plist in CopyFiles */, - 6211CF0251FDB4B23EC73F8A /* RHOIDSWidget.entitlements in CopyFiles */, + 70A12CFA767FE5D68E011501 /* RHOIDS.storekit in CopyFiles */, + F3A1ABDA5B618F26D449FA4A /* project.yml in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -370,30 +369,32 @@ 9EB7C689D8B8FF553B949737 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles/RHOIDS.xcodeproj; + dstPath = RepoFiles/Sources/RHOIDSWidget/LiveActivity; dstSubfolderSpec = 7; files = ( - 948934A6233438F06BCA77CF /* project.pbxproj in CopyFiles */, + 0B621261EC359726E2A8206C /* RHOIDSLiveActivityWidget.swift in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; A7C9A9796908F641C96E4AE0 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles/Sources; + dstPath = RepoFiles/Sources/RHOIDS; dstSubfolderSpec = 7; files = ( - 46D85033591F9A14635D8A26 /* Localizable.xcstrings in CopyFiles */, + 0C6D4EB180E6245F1DE2109E /* Info.plist in CopyFiles */, + 4372D96D259B63EFDAA04DC5 /* RHOIDS.entitlements in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; B6DB2D127531AE30E4FB664D /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = RepoFiles/Sources/RHOIDSWidget/LiveActivity; + dstPath = RepoFiles/Sources/RHOIDSWidget; dstSubfolderSpec = 7; files = ( - 0B621261EC359726E2A8206C /* RHOIDSLiveActivityWidget.swift in CopyFiles */, + 2183A18A15C5FA2D86D97148 /* Info.plist in CopyFiles */, + 6211CF0251FDB4B23EC73F8A /* RHOIDSWidget.entitlements in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -443,6 +444,7 @@ 1D1CC8FA4FB6CA0B515FAB72 /* singing_bowl.caf */ = {isa = PBXFileReference; path = singing_bowl.caf; sourceTree = ""; }; 1D7945DF1F298AA0E760EAD4 /* NotificationCategoryAlignmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationCategoryAlignmentTests.swift; sourceTree = ""; }; 1DFAE2D85F9C3E1FF623D056 /* TimerViewModelShieldingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerViewModelShieldingTests.swift; sourceTree = ""; }; + 1EA5C8CDA20CE29C27EEDD82 /* TimerCountdownTextTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerCountdownTextTests.swift; sourceTree = ""; }; 2141890E742EADC4AC6E44D4 /* RHOIDSWidgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RHOIDSWidgetBundle.swift; sourceTree = ""; }; 229107AFF08F7780B2BC2F11 /* TimerService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerService.swift; sourceTree = ""; }; 22E8B9087BBD5C393FE5995A /* AppOpenTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppOpenTrackerTests.swift; sourceTree = ""; }; @@ -927,6 +929,7 @@ 87C0A8705B41A171D5EE00AA /* HomeViewModelTests.swift */, 745DCFA21FC6D02943604B75 /* OnboardingPageTests.swift */, 7A8D4847E317F0A70695617D /* OnboardingPermissionTests.swift */, + 1EA5C8CDA20CE29C27EEDD82 /* TimerCountdownTextTests.swift */, 3F9204D351B554F726914FED /* TimerViewModelCompletionTests.swift */, 6382D4FAC8B002EA8DE2E276 /* TimerViewModelProgressTests.swift */, 190E945FA7A3252F82E231E8 /* TimerViewModelSessionLoggingTests.swift */, @@ -1762,6 +1765,7 @@ 5153539D59DAC0A0924838ED /* SoundPreferencesRoundTripTests.swift in Sources */, BAA2360109C485175B2BF8CF /* SoundPreferencesTests.swift in Sources */, BA1ED6606213B2E27D710B8D /* SyncedPreferencesResilienceTests.swift in Sources */, + B670D4525FD24069B36F0B8A /* TimerCountdownTextTests.swift in Sources */, 2B0C542595A1E13201A9FEBB /* TimerEventTests.swift in Sources */, B42FC6F1A51D945032110348 /* TimerOutcomeTests.swift in Sources */, AFC8DEF1A76B099E0D633CCF /* TimerQuipTests.swift in Sources */, diff --git a/Sources/RHOIDS/Features/Timer/TimerCountdownText.swift b/Sources/RHOIDS/Features/Timer/TimerCountdownText.swift index 59bbfbd..779433c 100644 --- a/Sources/RHOIDS/Features/Timer/TimerCountdownText.swift +++ b/Sources/RHOIDS/Features/Timer/TimerCountdownText.swift @@ -31,7 +31,9 @@ struct TimerCountdownText: View { .accessibilityValue(Self.formatted(accessibilityRemaining)) } - private static func formatted(_ duration: TimeInterval) -> String { + /// Matches the live `Text(timerInterval:)` shape (`2:39`, `1:02:03`), so the + /// digits don't jump when the countdown freezes on stop or completion. + static func formatted(_ duration: TimeInterval) -> String { let totalSeconds = max(Int(ceil(duration)), 0) let hours = totalSeconds / 3600 let minutes = (totalSeconds % 3600) / 60 @@ -40,6 +42,6 @@ struct TimerCountdownText: View { if hours > 0 { return String(format: "%d:%02d:%02d", hours, minutes, seconds) } - return String(format: "%02d:%02d", minutes, seconds) + return String(format: "%d:%02d", minutes, seconds) } } diff --git a/Tests/RHOIDSTests/Features/TimerCountdownTextTests.swift b/Tests/RHOIDSTests/Features/TimerCountdownTextTests.swift new file mode 100644 index 0000000..a893d16 --- /dev/null +++ b/Tests/RHOIDSTests/Features/TimerCountdownTextTests.swift @@ -0,0 +1,20 @@ +import Testing +import Foundation +@testable import RHOIDS + +struct TimerCountdownTextTests { + @Test("Frozen countdown matches the live timer's shape", arguments: [ + (0.0, "0:00"), + (9.0, "0:09"), + (159.0, "2:39"), + (158.2, "2:39"), + (180.0, "3:00"), + (599.0, "9:59"), + (600.0, "10:00"), + (3723.0, "1:02:03"), + (-5.0, "0:00"), + ]) + func formatted(seconds: TimeInterval, expected: String) { + #expect(TimerCountdownText.formatted(seconds) == expected) + } +} From 12f458c635622d65036c6b7792c37e0e0e2a1e0d Mon Sep 17 00:00:00 2001 From: Wesley Keetch <156481176+weskcode@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:21:14 -0500 Subject: [PATCH 3/4] fix: translate the snooze and dismiss notification buttons and beep times The "+1 min" and "Dismiss" notification buttons were plain English strings, and the 30-second beep titles built English units ("2m 30s"). The buttons now use the string catalog, with "+1 min" translated into all 12 languages, and the beep titles reuse the app's localized duration format. The old test re-implemented the formatting instead of checking the scheduled notifications; it now checks the real titles. --- Sources/Localizable.xcstrings | 78 ++++++++++++++++++- Sources/RHOIDS/App/AppDelegate.swift | 4 +- .../RHOIDS/Services/NotificationService.swift | 6 +- .../NotificationSchedulingTests.swift | 39 ++++++---- 4 files changed, 105 insertions(+), 22 deletions(-) diff --git a/Sources/Localizable.xcstrings b/Sources/Localizable.xcstrings index 58ad760..d965504 100644 --- a/Sources/Localizable.xcstrings +++ b/Sources/Localizable.xcstrings @@ -1,6 +1,83 @@ { "sourceLanguage" : "en", "strings" : { + "+1 min" : { + "comment" : "Notification button that adds one minute to a finished timer", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 دقيقة" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 Min." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 min" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 min" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 मिनट" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 min" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1分" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1분" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 min" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 мин" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 dk" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "+1 分钟" + } + } + } + }, "%@" : {}, "%@ · %@" : { "localizations" : { @@ -5722,7 +5799,6 @@ } }, "Dismiss" : { - "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { diff --git a/Sources/RHOIDS/App/AppDelegate.swift b/Sources/RHOIDS/App/AppDelegate.swift index b094876..dfe2cd6 100644 --- a/Sources/RHOIDS/App/AppDelegate.swift +++ b/Sources/RHOIDS/App/AppDelegate.swift @@ -17,12 +17,12 @@ class AppDelegate: NSObject, UIApplicationDelegate { // Optional: action buttons on the alarm. let snooze = UNNotificationAction( identifier: "TIMER_SNOOZE", - title: "+1 min", + title: String(localized: "+1 min", comment: "Notification button that adds one minute to a finished timer"), options: [] ) let dismiss = UNNotificationAction( identifier: "TIMER_DISMISS", - title: "Dismiss", + title: String(localized: "Dismiss"), options: [.destructive] ) let alarmCategory = UNNotificationCategory( diff --git a/Sources/RHOIDS/Services/NotificationService.swift b/Sources/RHOIDS/Services/NotificationService.swift index 7c40763..d02a3d1 100644 --- a/Sources/RHOIDS/Services/NotificationService.swift +++ b/Sources/RHOIDS/Services/NotificationService.swift @@ -215,11 +215,7 @@ actor NotificationService { continue } - let minutes = Int(remaining) / 60 - let seconds = Int(remaining) % 60 - let timeString = minutes > 0 - ? (seconds > 0 ? "\(minutes)m \(seconds)s" : "\(minutes) min") - : "\(seconds)s" + let timeString = DurationFormatter.formatted(remaining) let content = UNMutableNotificationContent() content.title = String(localized: "⏱ \(timeString) remaining") diff --git a/Tests/RHOIDSTests/Services/NotificationSchedulingTests.swift b/Tests/RHOIDSTests/Services/NotificationSchedulingTests.swift index 02bb14e..5faa9ee 100644 --- a/Tests/RHOIDSTests/Services/NotificationSchedulingTests.swift +++ b/Tests/RHOIDSTests/Services/NotificationSchedulingTests.swift @@ -609,20 +609,31 @@ struct NotificationSchedulingTests { } } - @Test(arguments: [ - (remaining: 150, expected: "2m 30s"), - (remaining: 120, expected: "2 min"), - (remaining: 90, expected: "1m 30s"), - (remaining: 60, expected: "1 min"), - ]) - func `Beep title formats remaining time correctly`(remaining: Int, expected: String) { - let minutes = remaining / 60 - let seconds = remaining % 60 - let timeString = minutes > 0 - ? (seconds > 0 ? "\(minutes)m \(seconds)s" : "\(minutes) min") - : "\(seconds)s" - #expect(timeString == expected, - "Remaining \(remaining)s should format as '\(expected)'") + @Test func `Beep titles show the remaining time in the app's duration format`() async { + let expectedTitles = [ + 150: "⏱ 2:30 remaining", + 120: "⏱ 2 min remaining", + 90: "⏱ 1:30 remaining", + 60: "⏱ 1 min remaining", + ] + + await withCleanNotificationCenter { sut, center in + await sut.scheduleBeepNotifications( + duration: 180, + endDate: Date().addingTimeInterval(180), + sound: .systemDefault + ) + + let beeps = await pending(in: center).filter { + $0.identifier.hasPrefix(NotificationService.beepIDPrefix) + } + #expect(beeps.count == expectedTitles.count) + for beep in beeps { + let remaining = Int(beep.identifier.dropFirst(NotificationService.beepIDPrefix.count)) + #expect(beep.content.title == remaining.flatMap { expectedTitles[$0] }, + "Unexpected title for \(beep.identifier)") + } + } } @Test func `Re-scheduling beeps clears previous beeps`() async { From 7bc9a9f16512ea8da665df73cfbdf4f0b002999f Mon Sep 17 00:00:00 2001 From: Wesley Keetch <156481176+weskcode@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:36:10 -0500 Subject: [PATCH 4/4] chore: use weskcode@duck.com for privacy and support contact The privacy policy, security policy and in-app feedback form now point to weskcode@duck.com. The policy date moves to November 2, 2026. --- PRIVACY.md | 4 ++-- SECURITY.md | 2 +- Sources/RHOIDS/Utilities/AppStoreInfo.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PRIVACY.md b/PRIVACY.md index 5ec93b9..464b731 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -1,6 +1,6 @@ # RHOIDS Privacy Policy -Last updated: August 26, 2026 +Last updated: November 2, 2026 RHOIDS is designed to work without an account, advertising, analytics, or cross-app tracking. @@ -36,4 +36,4 @@ This policy may be updated when app behavior or platform requirements change. Th ## Contact -Privacy questions can be sent to [wesleyk@duck.com](mailto:wesleyk@duck.com). +Privacy questions can be sent to [weskcode@duck.com](mailto:weskcode@duck.com). diff --git a/SECURITY.md b/SECURITY.md index c4f9e24..8961766 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Reporting a Vulnerability -Please report suspected security or privacy issues privately to [wesleyk@duck.com](mailto:wesleyk@duck.com). Include the affected version, reproduction steps, impact, and any supporting logs or screenshots that do not expose unrelated personal data. +Please report suspected security or privacy issues privately to [weskcode@duck.com](mailto:weskcode@duck.com). Include the affected version, reproduction steps, impact, and any supporting logs or screenshots that do not expose unrelated personal data. Do not open a public issue for an unpatched vulnerability. Please allow reasonable time to investigate and prepare a fix before public disclosure. diff --git a/Sources/RHOIDS/Utilities/AppStoreInfo.swift b/Sources/RHOIDS/Utilities/AppStoreInfo.swift index db61301..221bf58 100644 --- a/Sources/RHOIDS/Utilities/AppStoreInfo.swift +++ b/Sources/RHOIDS/Utilities/AppStoreInfo.swift @@ -6,7 +6,7 @@ enum AppStoreInfo { static let appID = "6772689484" /// Destination for the in-app feedback form. - static let supportEmail = "wesleyk@duck.com" + static let supportEmail = "weskcode@duck.com" static var writeReviewURL: URL? { guard !appID.isEmpty else { return nil }