alarms: add a new kind of alarm clock mode: Just once then delete to auto-delete one-time alarms - #1810
alarms: add a new kind of alarm clock mode: Just once then delete to auto-delete one-time alarms#1810caco3 wants to merge 1 commit into
Just once then delete to auto-delete one-time alarms#1810Conversation
463f40a to
f8c493f
Compare
7bb23b7 to
cc3f6ef
Compare
Just once then delete to auto-deleting one-time alarms
Just once then delete to auto-deleting one-time alarmsJust once then delete to auto-deleting one-time alarms
Just once then delete to auto-deleting one-time alarmsJust once then delete to auto-delete one-time alarms
10154c9 to
e8f5f3f
Compare
e8f5f3f to
96a90c9
Compare
|
The MR is ready now. I had to shorten the strings so they do not get truncated. |
| //! Dismisses the most recently triggered alarm. | ||
| void alarm_dismiss_alarm(void); | ||
| //! @return True if the alarm was auto-deleted (ALARM_KIND_JUST_ONCE_DELETE), False otherwise. | ||
| bool alarm_dismiss_alarm(void); |
There was a problem hiding this comment.
that definition doesnt really make sense, why is auto-deleted "true"? I'd consider true/false to be equal to succeeded/failed
There was a problem hiding this comment.
true means the alarm was deleted. Based on this, the dialog message will be different ("alarm deleted" instead of "alarm dismissed".
The alternative would be to provide a new public API function which tells us the kind of the alarm or its ID. I think the approach with the boolean value is less intrusive.
N.B. I originally wanted to show "alarm dismissed and deleted", but that is too long and gets truncated on the 2-line dialog text field.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb11172b31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…re deleting Add ALARM_KIND_JUST_ONCE_DELETE for one-time alarms that delete themselves when dismissed. Before deleting, re-read the current alarm kind from storage so that an alarm edited while a snooze is pending is not deleted with a stale cached kind. Signed-off-by: George Ruinelli <george@ruinelli.ch> Co-Authored-By: Cascade AI
eb11172 to
13c94ac
Compare
This PR adds a new kind of alarm clock:
Just once then delete:This implements #1537
I often use my watch to set an alarm when cooking or when to leave to catch the train. Those alarms are often onte time shots and must be deleted again manually afterwards.
With this PR, the alarms will get deleted automatically after they got dismissed.
Implementation concept
However the dismiss action happens in one process (the popup), and the alarm list lives in another (the alarms app). They're separate. The popup can delete the alarm from storage, but it has no way to reach into the alarms app's UI state. So it sends the newly created system event; the alarms app listens for that event and refreshes its list when it arrives.