Skip to content

Feature/notifications#12

Merged
Markel15 merged 19 commits into
masterfrom
feature/notifications
May 8, 2026
Merged

Feature/notifications#12
Markel15 merged 19 commits into
masterfrom
feature/notifications

Conversation

@Markel15
Copy link
Copy Markdown
Owner

@Markel15 Markel15 commented May 7, 2026

Task reminders:

  • Reminders are triggered at the exact time selected
  • Independent from the task due-date
  • Tests were adapted and some asserts added
  • When you complete a task the reminder of the task as well as the subtask's reminders are considered consumed (set to null). If you mark as pending a completed task, no reminder will be recovered. This is an intended behavior (the most logical for me, but could be different for others).
  • You can only add reminders in a future time, I thought that could be confusing to add a reminder and be triggered automatically or something when creating a task with a reminder with past time.
  • If you restart the phone the notification should work properly (I tested it).
  • If you have the phone off while the notification should be triggered, the notification should appear when you turn it on again.

Notification permission is required and the permission to program exact alarms (if you program a reminder and you don't have it given a warning will appear).
If you don't allow this permission the app can still be used, you just won't be able to create reminders.

Markel15 added 19 commits April 24, 2026 13:59
In the tasks tables a new field is added to track a reminder time for every task. The reminders are independent of the task's due dates.

A new db migration was added
First version of the task notifications. I tested it and works, manages correctly the permissions asking for them and correctly reschedules the reminders when permissions change.

Added reminders for the subtasks too.

Still a lot of improvements could be done, the reminder selector could be changed if pm/am is used to make it easier for those users.

In the task list items, and indicator of a reminder should be added.

Add some interactions within the notification itself to make some quick actions as marking it as completed or rescheduling the reminders.

Tests
The solution is simple, the header offset now needs to be increased by 1 ( 1->2), since the item list has now one item more, the permission banner. I am going to take that is included in the "header" so I add one value more to the offset. I think another way to solve this is by adding the permission banner inside the tasks_header item. But I think separating it is better to read the code-base in the future.
Added an indicator to show that a task has a reminder
Fixed some problems with the spacing of the topbar when editing a task. Also deleted the format button that didn't do anything (maybe in the future)
When the notifications are triggered for every reminder, automatically disappears and is no longer shown in the UI.
Now the notifications are not triggered if a task is completed and the time comes. The reminder time is set to null for the task and all the subtasks (whose parent was this task).
Now those tasks are filtered and their notifications shouldn't be reprogrammed when rebooting the phone.
Last fix only worked for the DB, this fix cancels the pending intent so the notification doesn't appear even if it was programmed.
Apply the same fix as the last one, but, this time for the tasks completed from the calendar module.
24 hour mode supported and am/pm mode too.
A new mode was added to support picking a reminder time via keyboard.
Now you can complete the task from the notification / reminder itself. The default behavior when completing a task is cancelling all the reminders for the subtasks. If this is not the most preferred behavior a configuration option could be added to offer other behaviors.
Added a missing part of the code to solve this issue. I forgot to add the code to cancel the notifications when completing a task from the editor.
In the first step (date picker) you can't pick a date from the past. In the second step if you select a time in the past, a toast will appear explaining the problem.
Solved missing dependencies and added some assertions to test the reminder functionality.
The app now should fire a notification if at the time to trigger the reminder the device was off. I think this is the most logical behavior, before this the notifications weren't triggered and I think the reminder time wasn't even cleaned in the DB, since the rescheduling of the boot receiver filtered the alarm times only checking the future ones to reschedule them.
Added some tests and adapted others to have better coverage for the reminders.
@Markel15 Markel15 marked this pull request as ready for review May 8, 2026 15:03
@Markel15 Markel15 merged commit 3c019f6 into master May 8, 2026
1 check passed
@Markel15 Markel15 deleted the feature/notifications branch May 8, 2026 16:27
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.

1 participant