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

edit notification fixes: picker handles 24h and deadlines can be set #619

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

krugerk
Copy link
Contributor

@krugerk krugerk commented Jan 21, 2025

Summary

Edit Notifications contained several logical errors around 12h / 24h mode conversions. In 24h mode, the picker could display the wrong values.
Furthermore, deadlines were being calculated incorrectly from the picker. The backend was rejected these, leaving the user with a mere 422 error message and unable to set the deadline to a range of deadlines in the app.
This Merge Request fixes these conversions and fixes the deadline calculation.

For UI changes including screenshots of before and after is great.

before

12h mode

deadline of 11:59pm, tapping it shows 12:00 AM in the picker
Simulator Screenshot - iPhone 16 Pro Max - 2025-01-21 at 14 32 23

24h mode

deadline of 23:59, tapping it shows 00:59 in the picker
Simulator Screenshot - iPhone 16 Pro Max - 2025-01-21 at 14 31 22

setting any 'before midnight' deadline fails

Simulator Screenshot - iPhone 16 Pro Max - 2025-01-21 at 14 38 38

after

12h mode

deadline of 11:59pm, tapping it shows 11:59 PM in the picker
Simulator Screenshot - iPhone 16 Pro Max - 2025-01-21 at 14 29 21

24h mode

deadline of 23:59, tapping it shows 23:59 in the picker
Simulator Screenshot - iPhone 16 Pro Max - 2025-01-21 at 14 30 21

setting also 'before midnight' deadline succeeds

Validation

Ran app in 12h and 24h modes in simulator.
Used the picker for before noon and after noon times and also times between 11pm and 12am.
Also, updated a goal's deadline both in 12h mode and in 24h.

Note

This MR does not address several other issues with these edit notification screens: data shown can quickly become out of sync with UI components on the same screen, can also become out of sync with the values the backend has; Elsewhere the app uses goal.slug but notification uses the goal.title; general lack of feedback about data being sent/saved

fixes #172
fixes #204

now handles 12h mode and 24h mode, setting
and interpreting the hours, minutes, and
period properly.

fixes beeminder#172
The same calculation was being used for computing
alertStart and deadline offsets. Deadline however
can be - or +, - for times between 07:00 and 23:59
and positive for times between 00:01 and 06:00.
This resulted in invalid values being sent from
app to the server for many of the deadline possibilities
and thus the backend replying with an error code.
@krugerk krugerk requested a review from a team as a code owner January 21, 2025 13:29
@krugerk krugerk requested review from theospears and removed request for a team January 21, 2025 13:29
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.

TimePicker off (by one?) in edit notifications App Crash in Edit Notifications
1 participant