Show sleep countdown and add shake grace settings (#77) #84

Merged
alexander merged 40 commits from mcp/issue-77-sleep-timer-grace-clean into main 2026-09-24 05:35:50 +02:00
Owner

Replaces PR #78 after its long-lived branch became unrebaseable against the merged CI workflow history. The feature content is rebuilt cleanly on current main; temporary CI-probe commits are intentionally excluded.

Implements #77.

What changes

  • projects the authoritative sleep countdown into MediaSession metadata so compact/background Android media controls show readable timer text, while preserving the existing timer action;
  • restores the original author/series byline exactly when the timer becomes idle;
  • adds a bounded post-expiry shake grace window (10 seconds by default, Off/5s/10s in Settings);
  • a grace-period shake resumes playback and starts a fresh timer session with the same mode;
  • adds Low / Normal / High shake sensitivity, with Normal preserving the previous threshold;
  • immediately re-registers active sensing when sensitivity changes and tears sensing down outside the active timer/grace window;
  • persists both settings safely in DataStore;
  • updates PLAY-008, the product decision ledger, risk register, and device acceptance procedure.

Verification added

  • metadata projection/restoration tests;
  • shake grace in-window / expired / Off tests;
  • live sensitivity re-registration test;
  • deterministic threshold test;
  • real DataStore round-trip/clamping tests.

Review lenses

Playback & Lifecycle Agent is implementation owner. Android System & Auto and Test & Acceptance are required review lenses.

Do not merge automatically; owner will review and merge manually.

Replaces PR #78 after its long-lived branch became unrebaseable against the merged CI workflow history. The feature content is rebuilt cleanly on current main; temporary CI-probe commits are intentionally excluded. Implements #77. ## What changes - projects the authoritative sleep countdown into MediaSession metadata so compact/background Android media controls show readable timer text, while preserving the existing timer action; - restores the original author/series byline exactly when the timer becomes idle; - adds a bounded post-expiry shake grace window (10 seconds by default, Off/5s/10s in Settings); - a grace-period shake resumes playback and starts a fresh timer session with the same mode; - adds Low / Normal / High shake sensitivity, with Normal preserving the previous threshold; - immediately re-registers active sensing when sensitivity changes and tears sensing down outside the active timer/grace window; - persists both settings safely in DataStore; - updates PLAY-008, the product decision ledger, risk register, and device acceptance procedure. ## Verification added - metadata projection/restoration tests; - shake grace in-window / expired / Off tests; - live sensitivity re-registration test; - deterministic threshold test; - real DataStore round-trip/clamping tests. ## Review lenses Playback & Lifecycle Agent is implementation owner. Android System & Auto and Test & Acceptance are required review lenses. Do not merge automatically; owner will review and merge manually.
Author
Owner

Deep CI failure investigation for run #247 (HEAD 957cb709):

  • Preflight passed and validated the exact PR #84 head.
  • verifyDebug was the only failing gate.
  • 2,571 unit tests ran with 0 failures.
  • Detekt reported 0 findings.
  • Android Lint reported 0 errors and 0 warnings (1 hint only).
  • Room schema verification passed.
  • Dependency resolution passed.
  • Debug APK assembly passed.
  • The sole failed Gradle task was :playback:ktlintTestSourceSetCheck.
  • The KtLint report identified one source violation: SleepTimerMediaMetadataTest.kt:43:51, standard:function-signature — the first line of the expression body fit on the function-signature line.

The consolidated report displayed “3 finding(s)” because scripts/ci/pr-diagnostics.py counts every nonblank line in the KtLint text report; the report also contains the summary/footer lines. Its own rule summary was standard:function-signature: 1, so there were not two hidden source defects.

Fixed at HEAD 47e84c9 by moving MediaItem.Builder() onto the expression-body signature line and aligning the call chain. PR remains current with main (0 behind) and mergeable.

No CI run was started after this fix; owner will start it manually.

Deep CI failure investigation for run #247 (HEAD 957cb709): - Preflight passed and validated the exact PR #84 head. - verifyDebug was the only failing gate. - 2,571 unit tests ran with 0 failures. - Detekt reported 0 findings. - Android Lint reported 0 errors and 0 warnings (1 hint only). - Room schema verification passed. - Dependency resolution passed. - Debug APK assembly passed. - The sole failed Gradle task was :playback:ktlintTestSourceSetCheck. - The KtLint report identified one source violation: SleepTimerMediaMetadataTest.kt:43:51, standard:function-signature — the first line of the expression body fit on the function-signature line. The consolidated report displayed “3 finding(s)” because scripts/ci/pr-diagnostics.py counts every nonblank line in the KtLint text report; the report also contains the summary/footer lines. Its own rule summary was standard:function-signature: 1, so there were not two hidden source defects. Fixed at HEAD 47e84c9 by moving MediaItem.Builder() onto the expression-body signature line and aligning the call chain. PR remains current with main (0 behind) and mergeable. No CI run was started after this fix; owner will start it manually.
Remove APK from PR diagnostics
All checks were successful
BookWave / PR verification BookWave PR verification passed
3ebdea6061
Author
Owner

CI-only follow-up at HEAD 3ebdea60: PR verification no longer produces or requires APKs. The workflow now excludes only :app:assembleDebug and :benchmark:assembleDebug from verifyDebug, removes the debug-APK existence gate, and removes APK state from consolidated diagnostics/final verification. All other existing checks remain unchanged. No Actions run was started.

CI-only follow-up at HEAD 3ebdea60: PR verification no longer produces or requires APKs. The workflow now excludes only :app:assembleDebug and :benchmark:assembleDebug from verifyDebug, removes the debug-APK existence gate, and removes APK state from consolidated diagnostics/final verification. All other existing checks remain unchanged. No Actions run was started.
Document expiry pause ownership for shake grace
Some checks failed
BookWave / PR verification BookWave verification failed
a4032a7703
alexander referenced this pull request from a commit 2026-09-23 22:00:24 +02:00
alexander referenced this pull request from a commit 2026-09-23 22:02:54 +02:00
alexander referenced this pull request from a commit 2026-09-23 22:05:22 +02:00
Restore PR #84 document content
Some checks failed
BookWave / PR verification BookWave verification failed
c85fc2b172
Fix sleep timer test closing indentation
Some checks failed
BookWave / PR verification BookWave verification failed
45fc6a483a
Clarify validation artifact coverage
Some checks failed
BookWave / PR verification BookWave verification failed
6e911b32fb
Scope fast PR gate to verifyDebug source sets
All checks were successful
BookWave / PR verification BookWave PR verification passed
585ab7a458
alexander deleted branch mcp/issue-77-sleep-timer-grace-clean 2026-09-24 05:35:50 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alexander/Audiobookshelf-Manager-Claude!84
No description provided.