notifications: add sleep-aware Quiet Time - #2054
Open
TheCodedKid wants to merge 4 commits into
Open
TheCodedKid wants to merge 4 commits into
TheCodedKid wants to merge 4 commits into
Conversation
TheCodedKid
force-pushed
the
issue1804
branch
3 times, most recently
from
September 18, 2026 23:09
d0dcbd5 to
573c1a5
Compare
Emit an internal activity event whenever confirmed sleep state changes so services can react without polling or coupling to activity internals. Refs coredevices#1804 Co-Authored-By: GPT-5.6 Sol <noreply@openai.com> Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Treat confirmed light and restful sleep as an opt-in Quiet Time source. Persist and sync the setting, consume activity transitions, and keep a manual override in effect until the current sleep episode ends. Refs coredevices#1804 Co-Authored-By: GPT-5.6 Sol <noreply@openai.com> Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Expose Sleep Aware alongside the existing automatic Quiet Time modes. When Health Tracking is disabled, explain the requirement instead of storing a setting that cannot take effect. Refs coredevices#1804 Co-Authored-By: GPT-5.6 Sol <noreply@openai.com> Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
Add a persisted temporary Quiet Time source that starts immediately and ends only after confirmed sleep followed by wake. Expose it in settings, retain it through tracking interruptions, and preserve unrelated Quiet Time sources when waking clears it. Refs coredevices#1804 Co-Authored-By: GPT-5.6 Sol <noreply@openai.com> Signed-off-by: Samuel Raumin <samuel.raumin@gmail.com>
TheCodedKid
force-pushed
the
issue1804
branch
from
September 18, 2026 23:11
573c1a5 to
a8f261b
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Addresses request feature found here: #1804
Reopens the work from #1833, which was auto-closed by the stale bot on 2026-09-11. That PR cannot be reopened — GitHub rejects the reopen from both the UI and the API — so this is a fresh PR with the same branch and commits.
How
Sleep Aware is persisted and synchronized with notification preferences. Manually ending it during sleep overrides it only for the current sleep timeframe.
Until Wake stores whether sleep has been observed, survives restarts and temporary tracking interruptions, and does not clear unrelated Quiet Time sources when waking.
Testing
nix develop -c ./pbl test -M '.*services/activity/test_activity[.]c' --show_output --no_images(24 tests pass)nix develop -c ./pbl test -M '.*services/test_do_not_disturb[.]c' --show_output --no_images(17 tests pass)gitlintacross all four commitsNote: the test results above were recorded on #1833. The branch has not changed since, apart from one empty commit.
AI usage
Developed with assistance from GPT-5.6 Sol and manually reviewed.
🤖 Generated with Claude Code
https://claude.ai/code/session_018scYvnB5nx3NTS2F726gdu