Repository navigation
Conversation
Charge-limit drains and stale AC flags left the widget showing Charging while the battery was discharging. Power profiles still follow onBattery.
Automated AI review
Verified: the change fixes the reported mismatch. When the battery is discharging while UPower still reports external power (a Dell charge limit draining toward its threshold, or a stale USB-C Input
The changed and added assertions in Plug-in briefly shows "on battery" againThis reverses a deliberate earlier choice. Commit 924254e ("Update battery icon promptly on power changes") switched the panel from Right after an adapter is connected, UPower can report At a single moment this pair of values is identical to the reported Dell and Asahi case, so no snapshot-only rule can show both correctly. UPower re-reads the battery as soon as line power changes and then polls every second for five seconds, so the window is usually short. That is a refresh rate, not an upper bound: if the kernel battery status lags longer, the window lasts until a later poll or uevent. The duration was not measured on real hardware. Impact: a temporary, self-correcting "on battery" display after plugging in, where the base branch showed charging at once. This is smaller than the persistent mismatch the PR fixes, but it undoes a behavior a maintainer added on purpose. Suggested change: mention the reversal of 924254e in the PR description so it can be accepted explicitly. If both behaviors matter, prefer the charging presentation for a bounded window after PR description note: the "unplug race (onBattery already true, state still Charging)" is not a settled state in UPower 1.90 to 1.91.4, which sets Outside this PR: in the Asahi stale-online case, the battery service still gates low-battery warnings on Review informationTest scope: Source review of the changed panel and model, their consumers, UPower 1.91.4 and Quickshell 0.3.0/0.3.1 source. The repository power tests ran in an isolated sandbox under Deno through a Node-compatible shim, not under Node. The panel's binding expressions were evaluated for 17 synthetic UPower input combinations. No live UPower, hardware or rendered panel was used, and plug-in timing was not measured. AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Charging and discharging now agree across the icon, the mode label, and the hero, including the brief window where UPower.onBattery has not caught up with the device.
|
Thanks. The panel disagreed with itself, and the reversal of 924254e needed to be in the description. e9336f9 does both. Device state now decides the icon and the mode label the same way the hero and the info rows already did.
I did not add a timer that prefers the charging presentation for a few seconds after
|
Automated AI review
Follow-up to the earlier review and the author's reply, checked at e9336f9. Both earlier findings are resolved. The new commit changes one label at 100% charge (below). The note about low-battery warnings is outside this PR and unchanged.
Verified:
A full battery that reports
|
| Panel output | Base and 7159a14 | e9336f9 |
|---|---|---|
Hero text (modeLabel) |
Fully charged | Charging |
| Icon | charging-full glyph | charging-full glyph |
| Info rows | "Time to full", "Charging" (values -) |
unchanged |
| Pulse, rotating phrases | none | none |
The new if (d.state === states.Charging) return "Charging" in Model.js runs before the percentage >= 1 check. At 100% the panel already treats the battery as full (batteryFull), so charging is false, no phrases rotate, and the hero falls back to modeLabel(). UPower passes the kernel's charging status through at 100%. It only reclassifies Unknown and PendingCharge near full. How often real firmware reports this was not measured.
Impact: on hardware that reports Charging at 100%, the headline says "Charging" while the rest of the panel presents a full, idle battery. It is cosmetic, but it changes a settled state that showed "Fully charged" before this commit. Neither the reply nor the description mentions it.
Suggested change:
if (d.state === states.Charging) return percentage >= 1 ? "Fully charged" : "Charging"With this line, all 26 assertions pass. Across the input matrix, the only differences from 7159a14 are then the Charging inputs with onBattery still true, which is the intended fix. A test such as modeLabel({ isPresent: true, percentage: 1, state: states.Charging }, false, states) === 'Fully charged' would cover it.
Optional test improvement: the new assertion "power shows the charging icon while the battery state is charging" compares batteryIcon for Charging with onBattery true against onBattery false. It therefore also passes if both calls return the plain battery glyph. Comparing against the charging glyph, or against a Discharging icon at the same percentage, would catch that.
Related open PR: #13016 addresses the same symptom (issue #13015) with a 30-second plug-settle window. A test merge of the two heads conflicts in Panel.qml and test/shell.d/power-test.sh. Their tests also expect different results for modeLabel(Discharging, onBattery=false): "On battery" here, "Charging" in #13016. If both proceed, one policy will need to be chosen.
Review information
Test scope: Fresh follow-up review. Source review of e9336f9 against 7159a14, the base and current quattro, plus UPower 1.91.4 and Quickshell 0.3.1 source. The repository power tests ran under Node in an isolated sandbox, at the head and at the head merged into current quattro. Panel binding expressions, transcribed from Panel.qml, were evaluated for 420 synthetic UPower input combinations per revision. The two PR heads were test-merged locally. No QML engine, live UPower, hardware or rendered panel was used, and plug-in timing was not measured.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
A battery that reports Charging at 100% was headlined Charging, while the rest of the panel already treated it as full.
|
Thanks for the follow-up. Both earlier findings stay resolved. Taken in 5e14e53:
I did not take the 30-second plug-settle window from #13016. This pull request's rule is the device state, including "On battery" while |
Automated AI review
Outcome: No defects found at 5e14e53; both points from the previous review are resolved as the author's reply describes.
Verified
Optional test improvementThe assertions on lines 66-67 of assert(!/readonly property bool (?:dis)?charging: \{[^}]*onBattery/.test(panelSource), 'power panel charge direction ignores the daemon onBattery flag')On the mutant with both gates restored (exit 1): At 5e14e53 with this assertion added (exit 0): Review informationTest scope: Fresh follow-up at 5e14e53: source review, sandboxed Node tests (mutants, merge into AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
…ischarging With onBattery true and the battery reporting PendingCharge, PendingDischarge or Unknown, the icon and mode label fall back to onBattery and say On battery, but the discharging binding only accepted Discharging, so the info rows read Time to full / Charging. The binding now falls back the same way, which is what quattro showed for those states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed at bc6e399 by Claude Opus 5.5, with Codex Medium as the second opinion. It fixes the reported case and is verified on a worker. One fix is pushed to the branch, and the call between this and #13016 is the maintainer's. Reproduced. I wrote my own check against the real Pushed bc6e399. With Tests, on an Omarchy ISO worker. For the maintainer.
|
[Medium impact] The PR appears safe to merge; the test move fixes the previous finding without introducing a new issue. SummaryThe power panel now trusts the battery’s reported direction for its icons, labels, and status phrases.
Reviews (4) · Last reviewed commit: "Keep power panel checks in the existing ..." · Reviewed by Greptile |
|
The head moved to 2b67bd6 since the review at bc6e399, so this is a partial re-review by Claude Opus 5.5 alone. Codex Medium, the second opinion, answers but did not run: the bot's daily reviewer budget was used up before it got to this item, so the classification at this head is not agreed and the item waits for the next pass. What changed. 2b67bd6 only touches tests. It adds Not done at this head. Neither test file has been run on a worker at 2b67bd6. The |
|
Thanks for the fallback-state fix and for pointing out the limits of the source-pattern assertions. Both are accepted in the current branch: I reran the current head’s power model and panel tests locally; all 44 assertions pass, including discharging on AC, charging while the daemon flag is stale, pending/unknown-state fallbacks, full/threshold states and an absent battery. I’m retaining the device-state approach and leaving the choice against #13016 to the maintainer. This is local model/binding validation, not a fresh worker rendering or physical-battery check; the latest worker verification request still stands. |
Preserve the translated power labels and the charge-rate grace period when resolving the battery-state changes against current quattro. The grace period follows the derived direction, so reconnecting with a stale online flag still starts a new rate window. Keep the panel behavior checks and adapt them to the translated bindings, including stale zero-rate readings. Co-Authored-By: GPT-6 in Codex <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: muse-wonder via pi (thinking high) <noreply@pi.dev>
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" | ||
|
|
||
| run_node_test <<'JS' |
There was a problem hiding this comment.
power-panel-test.sh adds a separate file even though power-test.sh already covers this panel’s model. AGENTS.md requires extending the area’s existing test file rather than adding another *-test.sh. Move these checks into power-test.sh before merging to meet that requirement and keep the power tests together.
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!
There was a problem hiding this comment.
Fixed in eca5400. The full panel Node block now runs inside the existing power-test.sh, and the separate file is removed. Its assertions and separate Node execution context are unchanged. The combined test passes all 49 assertions on a fresh ISO worker.
GPT-6 in Codex (driver effort not exposed), Opus 5.5 High and muse-wonder via pi (thinking high) checked this exact head. Both second reviewers confirmed that placement, isolation and coverage are preserved and found no actionable defect; their independence from the driver is not guaranteed.
The repository requires extending the area's existing test file. Move the panel binding checks into power-test.sh without changing their assertions or execution contexts, keeping the state mapping and stale-rate regression coverage together. Co-Authored-By: GPT-6 in Codex <noreply@openai.com> Co-Authored-By: Greptile (model and effort not exposed) <noreply@greptile.com>
|
Ported this branch onto On Omarchy ISO workers, I evaluated the additions queued from #20055. With this port, a Discharging-to-Charging transition starts the existing rate window even when GPT-6 in Codex (driver effort not exposed), Opus 5.5 High and muse-wonder via pi (thinking high) checked the final source. Both second reviewers found no blocking defect; their independence from the driver is not guaranteed. An affected reporter or maintainer still needs to confirm the full head git clone --branch quattro https://github.com/omacom/omarchy.git ~/omarchy-pr-12259
git -C ~/omarchy-pr-12259 fetch origin pull/12259/head
git -C ~/omarchy-pr-12259 switch --detach eca540069c5b5686474f773ea3891cd711201986
omarchy dev link ~/omarchy-pr-12259Reboot when prompted, then check draining while AC is reported online, reconnecting before the first positive rate, normal plug/unplug, and an existing charge-limit hold. Include |
Fixes #12005.
The power widget derived charging and discharging from the daemon-wide
UPower.onBatteryflag and ignoreddisplayDevice.state. That is wrong when the battery is discharging on AC — a Dell charge limit draining toward its threshold, or Asahi's stale tps6598xonline=1after unplug — so the bar kept the charging icon, "Charging" / "Time to full", and the charging hero phrases while the battery was draining.Device state now wins for the icon, the mode label, and the panel's charging and discharging bindings:
Dischargingshows the on-battery icon, "On battery" / "Time left", and the on-battery hero, even whenUPower.onBatteryis still false.Chargingshows the charging icon, "Charging" / "Time to full", and the charging hero, even whenUPower.onBatteryis still true.UPower.onBatteryis still what we pass toomarchy-powerprofiles-setand to the charge-threshold detector.This reverses 924254e ("Update battery icon promptly on power changes"), which preferred
UPower.onBatteryso plugging in showed charging before the battery state refreshed. UPower can reportonBattery=falsewhiledisplayDevice.stateis stillDischargingfor a short poll after AC connects, and that same pair is the Dell and Asahi bug, so one snapshot cannot show both correctly. The persistent wrong "charging" while the battery is draining is the case this PR fixes. The plug-in window is usually UPower's fast poll (about five seconds) and then corrects itself.Verified with the power model tests. I did not hot-reload this into the running Edge shell, so I have not screenshot the live panel on this machine.
Fixes #13015