Repository navigation
Integrate power panel, charger, and battery state fixes - #21226
chessing234 wants to merge 14 commits into
Conversation
Send a transient toast when line power arrives after the machine has been on battery. A flip shorter than two seconds is ignored, so a USB-C renegotiation or a UPower reading that settles at startup does not announce a charger that was not just plugged in.
A USB-C blip during the confirm wait was clearing the on-battery clock, so plugging back in within two seconds never qualified. A confirmation already earned stays pending across that blip and is dropped only if the machine stays on battery through the window.
A rejected hardware write leaves the one-time top-up marker in place. Refresh the state when the process exits without rechecking the same charge reading. A new battery event can still restore the limit.
Wait for Quickshell to handle the failed write before watching for a retry, and wait for the successful write to clear the marker. Bound both waits so slow startup or D-Bus calls do not fail a working implementation.
…he bars' motion within the motion rules
An unknown display state always picked AC, so a missed AC uevent could save the battery preference under the AC key. Match the power panel's fallback and cover both directions in the command test.
Keep immediate reads for panel opens, power source changes and charge-limit updates. Poll the remaining battery telemetry every 30 seconds while the panel is open.
|
@omarchybot @dhh combined the overlapping power-panel and battery-state prs so the OnBattery reading only gets reviewed once. |
Confidence Score: 5/5
[Medium impact] The latest refresh fix appears safe to merge; the earlier visual-check request remains open. Findings
SummaryThis PR brings charger notices, charger readings, battery-state profile choices, and charge-limit retry fixes together.
Reviews (4) · Last reviewed commit: "Refresh charger readings when external p..." · Reviewed by Greptile |
This comment has been minimized.
This comment has been minimized.
The panel's state map left Unknown undefined, so a battery reporting state 0 never fell back to OnBattery and was read as on AC.
|
unknown battery state now falls back to onbattery. the panel state map includes upowerdevicestate.unknown, which was missing so state 0 was read as ac. |
| Column { | ||
| id: chargerSection | ||
| readonly property var flow: root.chargerFlow | ||
| readonly property bool maxed: flow !== null && flow.maxed | ||
| visible: flow !== null |
There was a problem hiding this comment.
Charger UI remains visually unchecked
The added charger section has not been checked in a running Omarchy session. The repository requires visual changes to be verified in the running UI, with screenshots and a recording when motion changes. The PR reports that no captures were made.
Check the charger section and toast in Omarchy, including the bar animations, and attach the required captures before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
ready for a look @dhh @ryanrhughes |
|
Thanks for the time you put into this. Some of the fixes you added on top catch real bugs in the original PRs. I'm closing it anyway, along with the other Integrate PRs. Each bundle puts several people's work in one branch. We can't review it one change at a time or revert a single piece. Merging it would also leave every original PR open. That's why our PR template asks for one problem per PR. None of the bundles ran on an Omarchy install either. Please post each fix on the PR it belongs to, so its author can pick it up. If two PRs conflict, a comment on the later one helps us most. A small fix of your own, tested on a real install, is always welcome. Smaller and proven gets merged. Thanks! |
Summary
These five open PRs all read the same battery.
UPower.OnBatterystays false while a weak charger lets the battery drain, and it can stay stale after an unplug. Reviewing the charger panel and the profile autodetect separately is how those two readings drift apart.OnBatteryonly when that state is unknown. The panel'sdischargingflag now uses that helper, so the charger section and the bolt agree.The charger-announce helpers were merged next to the existing usage-history helpers in
BatteryModel.js. Both stay exported.Test plan
test/shell.d/battery-test.sh(the Quickshell charge-limit fixture skipped: noqsordbus-run-sessionhere)test/shell.d/power-test.sh(charger split, weak-charger drain, and the stale-OnBatteryprofile cases)test/shell.d/powerprofiles-set-test.shandtest/shell.d/battery-status-test.sh(both call scripts whose shebang is/bin/bash; this Mac's/bin/bashis 3.2 and has nomapfile)Screenshots
No capture from this host. The charger section and the charger toast need a running Omarchy session.
Made with Cursor