Repository navigation
omamobile-shell: show the battery’s reported state - #421
Conversation
Show charging and time estimates only when the battery reports the corresponding state. Present pending and unknown states explicitly so external power does not imply charging.
|
Thanks, @Gr-linkk. This is a tidy fix: one rule in all three places, a time only when it means something, and a test that evaluates the real bindings rather than a copy of them. I checked what it changes on my Pixel 7 Pro. Its gauge works out the status from the current, so it never reports "unknown" or "pending", and the only visible change there is the quick-settings glyph at Full. On phones with a charge limit or a gauge that reports "Not charging", the bolt now goes away, which is what you're after. Before I merge, could you install this branch on your Pixel 6 and check the bar, the home widget and quick settings in three states: charging, unplugged, and at Full (or "Not charging")? A screenshot or a sentence per state is plenty. One thing for me rather than you: the lock screen's battery (Omarchy patch 0026) counts the charger being online as charging, because some gauges say "discharging" under load while plugged in. After this change the lock and the bar can disagree, for example a bolt on the lock and none in the bar at a charge limit. I'll settle on one rule for both in a follow-up. I'll write the squash title as |
The bar icon helper still selected the charging-full glyph for Full even when its charging binding was false. A Pixel 6 reporting Full at 91% reproduced the remaining bolt. Use the ordinary full battery glyph and cover this case in the battery-state test.
|
Thanks, @Gr-linkk, this is exactly what I hoped for. You ran the exact branch on your Pixel 6 in all three states on all three surfaces, and in doing so you found a real bug: the bar still showed a charging-full glyph at Full. You fixed it and added a test that fails without the fix. I checked that it does: put the old glyph back and One thing before it lands, and I can do it myself at merge: main has since shipped For the record, your second commit adds one more visible change on my Pixel 7 Pro: the bar's battery at Full now loses its bolt, as quick settings does. That's what we want, and I'll mention it in the merge message. The lock screen's battery (patch 0026) is still on my list, so the lock and the bar follow one rule; after the 4.5 work in #471 that patch has two copies, and I'll change both. Thanks again! |
main already carries 0.2.101 (derekross#464), and derekross#482 and derekross#420 hold 0.2.102 and 0.2.103.
…#421) The bar, the home widget and quick settings follow UPower's own battery.state instead of "charger online": charging and time estimates show only when the battery reports that state, and pending and unknown states are shown as such, so external power no longer implies charging. The bar's Full glyph loses its bolt too (on the 7 Pro as well as in quick settings): the icon helper chose the charging-full glyph for Full even when charging was false, and a Pixel 6 reporting Full at 91% showed the bolt. The battery-state test covers it. Tested on a Pixel 6 in all three states on all three surfaces. 0.2.104: main already carries 0.2.101 (derekross#464), and derekross#482 and derekross#420 hold 0.2.102 and 0.2.103.
UPower can report external power while the display device is Full, pending, or unknown. The bar, home widget and quick settings previously treated external power as charging.
Use explicit charging and discharging states, show pending/empty/unknown states in the home widget, and display time estimates only while charging or discharging. Use the plain full-battery glyph at Full: the bar helper still selected a charging-full glyph even after its charging binding became false. Bump the shell package version.
Validation:
packages/omamobile-shell/test/allsuite passes.8237b680eea9493fb64f16129342e1f647844254) on the Pixel 6 using a signed package and normal dependency checks. Omarchy 4.0.6 and all 22 phone patches verify; the shell was restarted to load the candidate.After testing, restored the original five desktop packages and removed the two test-only prerequisites. The exact pre-test package inventory is restored, all 17 original phone patches verify, retained device safeguards are unchanged, and the original shell runs with no failed services. No kernel flash or reboot was used for this UI test.