Repository navigation
Conversation
jawzf
force-pushed
the
feat/021-smart-stack
branch
from
October 23, 2026 12:30
6402f9c to
d71a50c
Compare
A stack with Smart rotation on brings forward the widget that matters now and holds it, pausing the timer: the app playing music, a calendar app when an event starts within 30 minutes, or a battery widget while a charger is plugged in. It picks when the screen turns on or a signal changes, never while the stack is in view, and a manual switch leaves the stack alone until the screen turns off. Also drops the beta badge from Widget stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jawzf
force-pushed
the
feat/021-smart-stack
branch
from
October 25, 2026 09:36
d71a50c to
ee51105
Compare
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.
Description
Adds Smart rotation to widget stacks. In a stack's settings, Show what matters now (off by default, so existing stacks behave as before) brings forward the widget that matters right now and holds it there, pausing the timer:
When it switches:
How it works:
StackSmartPick.pickis a small pure function (unit tested) that takes the hosted widgets' provider components and the current signals, and returns the first match in priority order. Calendar apps are the ones declaringCATEGORY_APP_CALENDAR; battery widgets are matched by "batter" in the provider class (Battery…,Batteries…), which covers Essentials' own Battery Status widget.StackHostreusesMediaSessionSourcefor playback,CalendarEventUtil.queryNextUpcomingEvent(run off the main thread on screen on) for events and the sticky battery intent'sEXTRA_PLUGGEDfor charging. All event driven; no polling, alarms, new permissions or manifest entries.Notes:
ACTION_USER_PRESENT) isn't used: it's sent by System UI, so it never reaches the stack'sRECEIVER_NOT_EXPORTEDreceiver. Screen on is used instead.BatteryManager.isChargingstayed true after unplugging in testing, so "charging" means a charger is plugged in.Type of change
UI changes
The new Smart rotation section in the stack's settings.
Music playing: the stack holds the player's widget.
Charger plugged in: the stack holds the battery widget.
Checklist
develop(notmain)../gradlew assembleDebug(andassembleRelease)../gradlew testDebugUnitTest(new:StackSmartPickTest).WidgetStackRepository, like its interval and controls.RoundedCardContainerand the stack sheet's existing row and Grant button style.strings.xml(English only).🤖 Generated with Claude Code