Snooze glucose alerts from anywhere: over other apps, on the lock screen, and with volume buttons - #4623
Snooze glucose alerts from anywhere: over other apps, on the lock screen, and with volume buttons#4623petervanrijt wants to merge 18 commits into
Conversation
|
Thanks It will take a while to make the strings perfect. I suggest removing all the strings from this PR. |
New floating snooze screen shown when a glucose alert fires while another app is in the foreground; after snoozing, the previous app is restored automatically.
New full-screen snooze screen that turns the display on and appears above the lock screen (without unlocking) when a glucose alert fires; closing it returns to the lock screen.
Volume buttons snooze an active alert with a double press of the same button within 1.5 seconds and no longer change the phone volume during an alarm. Pop-up snooze screens close automatically when the alert is snoozed elsewhere or ends, their navigation menu is disabled, and orphaned alert leftovers are cleaned up.
When a glucose alert fires, the snooze screen is brought up over the app in use or - with Wake Screen or override-silent - above the lock screen. The ongoing notification refreshes immediately after snoozing, and the event log explains when a snooze screen cannot be shown.
An active alert whose alert type is missing (such as a test alert) is no longer deleted during lookups, so it can still be snoozed; adds a helper to read the snoozed state.
While a glucose alert is snoozed, the ongoing notification shows 'Alert <name> snoozed until HH:mm'; the line disappears when glucose recovers or the snooze ends.
The test alert now fires after five seconds, so the lock-screen and over-other-apps behaviour can be tested; removing an alert also stops and clears its active alarm.
For users of the wake-screen or override-silent features, the glucose alert notification channel is recreated with high importance, which Android requires for full-screen alerts; all other users keep their existing channel and its settings.
The home screen uses the shared double-press volume snooze and, when the snooze-over-other-apps option is enabled without the required Android permission, asks at startup to grant it.
Enabling 'Snooze screen over other apps' without the system permission opens the Android settings screen where it can be granted.
With the new option enabled, the extra status line shows 'Alert <name> snoozed until HH:mm' while an alert is snoozed, identical to the notification text.
The floating theme keeps the app behind the snooze screen visible and running, so it is restored unchanged after snoozing.
…larms New switch for the snooze screen over other apps (default on), placed directly above 'Buttons silence alarms', which can only be enabled together with it.
New option that shows the snoozed-alert status in the extra status line.
New user-facing texts for the snooze screens, the volume-button snooze, the snoozed-alert status and the permission prompts.
Design decisions, safety review and per-change test plans for the snooze changes (CHG1-CHG14), linked from the pull request description.
f95e00f to
0adbd9e
Compare
|
Ok. Will do tonight or tomorrow. Just synced with xDrip-master. I will
review it before sending it to dev team for the final review. When curious
you can already build it yourself :)
Op ma 13 jul 2026, 20:10 schreef Navid ***@***.***>:
… *Navid200* left a comment (NightscoutFoundation/xDrip#4623)
<#4623 (comment)>
Thanks
It will take a while to make the strings perfect. I suggest removing all
the strings from this PR.
—
Reply to this email directly, view it on GitHub
<#4623?email_source=notifications&email_token=ADH3DDEUJDEEV7WHZZ6IGX35EUQZZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJWGEYTCNJTGE42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4961115319>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADH3DDGTUXTEOCEVJFGYM235EUQZZAVCNFSNUABEKJSXA33TNF2G64TZHM3DSMBSG43DKMJ3JFZXG5LFHM2DQNRZGE3TKMBYGKQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ADH3DDHXJN53IALGEN4W7DL5EUQZZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJWGEYTCNJTGE42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/ADH3DDH76PWYNAXUMV2XZZL5EUQZZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJWGEYTCNJTGE42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
If you prefer to keep the strings, we can work on them. It is just that it will only delay the PR in going through. |
|
I don't really like the look of what looks like changes to the alerting logic. To snooze an alert you should just be able to call From what I understand this PR should be UI changes only to support the lock screen snoozing. |
|
I would like us to work on this and make it do what it needs without doing anything else. I could be wrong about all your intentions. My hope is for the user to be able to snooze an alert without having to look at the screen. The existing mechanism in xDrip requires xDrip to be in foreground. This is why the existing mechanism is not adequate. I always think of someone who gets an alert in an inconvenient situation for example while driving. The intent is to be able to silence the alert without having to take your eyes off the road. I understood from your original PR that you had found a way to force Android to bring up an xDrip page on screen when you pressed the volume button. Now that xDrip is in foreground, pressing the button a second time should snooze it because we already have the mechanism. I am more than happy to work on this to assist you if you are OK with that. |
|
The documentation looks like it probably should be attached to the PR rather than added to the source tree as it seems to relate to the changes only. |
Per review feedback: all new string resources are removed and strings.xml is back to master, so existing translations are untouched. The new user-facing texts remain as plain English literals; a follow-up PR will move them into translatable resources. Also updates the change documentation.
The design, review and test documents (CHG1-CHG15) are attached to the pull request conversation instead, so the diff contains application changes only.
|
Thank you! Processed
HelpIn response of comment 5008280148 @Navid200: Ofcourse your help is more than welcome, please do. With a (third) newborn my time is somewhat limited 😅. To answer the other questionsSnoozing itself uses the existing path: the snooze screen and the volume keys both end up in AlertPlayer.Snooze() — the same call OpportunisticSnooze() wraps. I deliberately didn't call OpportunisticSnooze() itself, because its internal 3-second rate limit would swallow the second press of the double-press confirmation, and it shows its own toast. Why UI alone doesn't get there: volume keys need a foreground activity to receive key events, and the lock-screen UI needs the notification's full-screen intent — which Android silently drops on upgraded installs whose alert channel importance is below HIGH. That is the only reason for the small channel migration; it enables the screen, nothing else. A MediaSession-based approach could intercept volume keys without any UI, but it competes with other media apps for the keys and behaviour varies per OEM — for a glucose alarm I preferred the predictable failure mode (if no screen shows, the alarm simply keeps sounding). Beyond the UI there are, deliberately, a few small non-UI changes:
Over the coming week I'll retest everything against the documentation. If all tests pass, I'll mark this PR as Ready for review. |
What this PR does
What this PR does
Snoozing a glucose alert no longer requires opening xDrip first:
The alert sound itself is never reduced or suppressed by any of this: every failure direction is "more conspicuous" or "convenience unavailable", never "quieter or missed".
What existing users need to change
After updating, xDrip asks once per start to grant Display over other apps; without it everything keeps working except the pop-up over other apps. Note two behaviour changes: snoozing with a volume button now takes a double press (was a single press), and alerts with Override silent mode now wake up into the snooze screen instead of the main screen. Users of xDrip notification channels who use Wake Screen or override-silent alerts get a fresh high-importance alert channel; re-apply any custom channel settings there if desired.
Documentation (included in this PR)
Design, decisions, safety review and per-change test plans:
Notes for reviewers
ActiveBgAlertstate, snoozable test alerts), not standalone refactoring.Full disclosure
This pull request is accelerated using Claude Code (model Opus 5 with effort setting on high or maximum).