Skip to content

omamobile-shell: show the battery’s reported state - #421

Merged
derekross merged 4 commits into
derekross:mainfrom
Gr-linkk:catchup/battery-state-ui
Nov 8, 2026
Merged

derekross merged 4 commits into
derekross:mainfrom
Gr-linkk:catchup/battery-state-ui

Conversation

@Gr-linkk

@Gr-linkk Gr-linkk commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • The full packages/omamobile-shell/test/all suite passes.
  • The Full-at-91% icon regression fails before the icon-helper fix and passes afterward.
  • Installed the exact updated branch (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.
  • Observed real UPower Full at 91%: bar and quick settings show no bolt; the home widget says 91% Full with no bolt. This validates presentation, not gauge accuracy.
  • Charging at 90%: bar and quick settings show charging glyphs; home shows a bolt and Charging.
  • Unplugged/Discharging at 91%: bar and quick settings have no bolt; home says On battery without a bolt. Detached captures recorded the same UPower state before and after each observation.
  • All three requested states were visually checked on all three surfaces. Earlier integration-package observations are not used as exact-branch evidence.

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.

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.
@derekross

Copy link
Copy Markdown
Owner

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 shell 0.2.101: show the battery's reported state. Thanks!

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.
@derekross

Copy link
Copy Markdown
Owner

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 battery-state.js stops with your message. I also merged the branch onto today's main. None of the files you touched have changed there since you branched, so your phone test still covers what will land.

One thing before it lands, and I can do it myself at merge: main has since shipped omamobile-shell 0.2.101 (the Greek keyboard row in #464), and #482 and #420 hold 0.2.102 and 0.2.103. Your branch's 0.2.101 would merge without a conflict and publish your change under a version that's already out. Unless you'd rather do it yourself, I'll set the version to the next free number (0.2.104 as things stand) and use it in the title: omamobile-shell 0.2.104: show the battery's reported state.

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!

@derekross
derekross merged commit 0f14a00 into derekross:main Nov 8, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants