Skip to content

fix(ios.NotificationsSettingsWidget): Prevent 0 minute window#1651

Merged
KaylaBrady merged 3 commits intomainfrom
kb-window-0
Apr 10, 2026
Merged

fix(ios.NotificationsSettingsWidget): Prevent 0 minute window#1651
KaylaBrady merged 3 commits intomainfrom
kb-window-0

Conversation

@KaylaBrady
Copy link
Copy Markdown
Collaborator

@KaylaBrady KaylaBrady commented Apr 8, 2026

Summary

Ticket: Notifications QA | iOS - Ensure windows are at least 1 minute long

What is this PR for?

Ensures that start time can't be changed to match end time, and end time can't be changed to match start time.

iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
- [ ] Add temporary machine translations, marked "Needs Review"

android
- [ ] All user-facing strings added to strings resource in alphabetical order
- [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible (ideally in shared code)

Testing

What testing have you done?

  • Added unit tests
  • Ran locally

@KaylaBrady KaylaBrady requested a review from a team as a code owner April 8, 2026 19:42
@KaylaBrady KaylaBrady requested a review from BrandonTR April 8, 2026 19:42
)
}

func setSafeEndTime(startTime: DateComponents) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't love this approach, but breaking out a separate fun seemed like the easiest way to add testing.

What I don't love is that it takes a startTime as a param, even though window has its own startTime.

Maybe there is something to be done with didSet instead of the .onChange(of: window.startTime) { startTime in call from NotificationSettingsWidget ... but we aren't really doing that elsewhere

Copy link
Copy Markdown
Contributor

@BrandonTR BrandonTR left a comment

Choose a reason for hiding this comment

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

Overall looks good! Couple of minor things

Comment thread iosApp/iosApp/Pages/SaveFavorite/NotificationSettingsWidget.swift Outdated
Comment thread iosApp/iosApp/Utils/MutableFavoriteSettings.swift Outdated
@KaylaBrady KaylaBrady added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 5ad02d8 Apr 10, 2026
11 checks passed
@KaylaBrady KaylaBrady deleted the kb-window-0 branch April 10, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants