Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Delays the initial low-battery check to avoid false notifications before UPower settles.
Changes:
- Adds a five-second startup delay while retaining 30-second checks.
- Adds AC-state and timer configuration tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
shell/plugins/services/battery/Service.qml |
Defers the initial battery check. |
test/shell.d/battery-test.sh |
Tests AC behavior and timer configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Follow-up for Copilot reviewGated all low-battery warning paths on Live UI verification
|
79f36cf to
1c36c41
Compare
Avoid firing Time to recharge on boot when the shell starts before AC state is synced after a battery-empty suspend. Co-authored-by: Cursor <cursoragent@cursor.com>
onOnBatteryChanged could still warn during the five-second window; skip warnings until settle while keeping power-profile updates immediate. Co-authored-by: Cursor <cursoragent@cursor.com>
8c72b57 to
c4d65cf
Compare
|
Refreshed this onto current |
|
Reviewed at c4d65cf and run on a disposable Omarchy VM (quickshell 0.3.1) against How it was run:
With logging added to That is a VM with a mocked UPower, not the Lenovo or the Surface from #7679, so it cannot rule out an ordering real hardware produces. What would settle it is the same logging on an affected machine at boot: what The new assertions in No second opinion ran on this review: omabot's reviewer, Codex Medium, had spent its daily allowance, so this is one model's reading (Claude Opus 5.5) plus the VM runs above. Nothing was pushed to the branch. This waits on @thecdrz, or anyone with affected hardware, for evidence that the startup check is what fires on a real boot. |
|
Addressed the 5–30 second regression concern in 548a7da. The five-second settle timer now only opens the warning gate; it no longer calls Updated the regression assertion to require that the settle timer does not force an early check. No new affected-hardware reproduction to add: this host has no UPower battery device. This revision is intentionally monotonic relative to |
[Medium impact] The PR appears safe to merge; the previous test concern is fixed and no new actionable issues remain. SummaryDelays low-battery warnings until the UPower display device is ready and a five-second window has passed.
No new actionable issues were found. Tests were not run during this review. Reviews (6) · Last reviewed commit: "Drop the battery test's AC assertion tha..." · Reviewed by Greptile |
|
Re-reviewed at 7b2a61d and run on a disposable Omarchy VM (quickshell 0.3.1) against At this head the gate calls
The second row is the reported bug, on AC by the time anyone looks, and only this branch shows it. On The second opinion, Codex Medium, reached the same conclusion about the early check from the source (it agreed with what was already written here, so its independence is not guaranteed) and added two things of its own. First, orderings in which
Nothing was pushed: whether a genuinely low battery at boot should warn at 5s or at 30s is a trade-off for you and the maintainer, not a defect fix. This waits on @thecdrz. Dropping the call at |
|
Addressed both findings in e62e1cf.
This host has no UPower battery device, so I could not reproduce the hardware boot race locally. For the disposable-worker re-review, the expected matrix is:
@omarchybot please re-review e62e1cf with the mocked UPower setup when available. |
|
Re-reviewed at e62e1cf. Both findings from the last review are addressed: opening the gate no longer calls I ran it on two disposable Omarchy VMs (quickshell 0.3.1), one on this head and one on
The last row is the first time
Second opinion: Codex Medium agreed that this head is monotonic against Nothing was pushed. The stale UPower sample here is a mock, so whether real hardware produces this ordering is still open. @LorenGrz, could you try this on the Lenovo? Check out the full commit and link it: Then repeat the boot from #7679 a few times: let it die in suspend, plug in, boot. Reply with whether "Time to recharge!" still appears. #14218, #11415 and #11959 change the same |
|
Heads-up: #17387 replaces the battery service's 30-second timer with UPower change signals. This PR counts on that timer for the first check after the settle window, so if both land, opening the gate should run |
Resolves the conflicts with omacom#15027 and omacom#15289 in the battery service: both sides' model helpers are kept, and powerSaverOnBattery stays removed, since quattro dropped it with the lock feed that read it. The settle-timer source check now slices from the gate onward, because quattro's PowerProfiles Connections block ahead of it would otherwise leave that slice empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The branch had fallen behind I ran b94f801 on a disposable Omarchy VM (quickshell 0.3.2) with the shell serving that tree:
@yamz8's heads-up about #17387 holds against both diffs. This PR's gate only opens, and it relies on the 30-second timer for the first check after that. #17387 removes that timer, so if both land unchanged, a battery that is already low when the gate opens is not checked again until UPower signals some change, which could take minutes. Whichever lands second should call Second opinion: Codex Medium and muse-wonder (via pi, thinking high) both read the merge and found the resolution correct, with nothing from either side lost. They found no new warning, missed warning or stuck The mock reproduces the ordering, not the hardware. So this still waits on a boot on an affected machine, and the new head needs its own confirmation. @LorenGrz, if you can, please try it on the Lenovo: Then repeat the boot from #7679 a few times: let the battery die in suspend, plug in, and boot. Reply with whether "Time to recharge!" still appears. |
They grep Service.qml and BatteryStartupGate.qml for the lines this branch added, which Omarchy's AGENTS.md rules out as restating the implementation, and they already broke once on a harmless upstream edit: a new Connections block above the gate emptied the settle-timer slice. The gate's behaviour stays covered by the gateStartupWarning model tests and the BatteryStartupGate runtime fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch leaves shouldWarnLowBattery unchanged, and quattro already returns no warning off battery, so the assertion guards nothing this change adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Greptile's comment on Codex also pointed out that the "does not warn while on AC" assertion exercises On a disposable Omarchy VM with the shell serving the branch, Second opinion: Codex Medium and muse-wonder (via pi, thinking high) both agreed with Greptile, and both found the removal complete and the remaining tests real. The AC assertion was Codex's own finding. A final Codex Medium round on f234bb0 found nothing open. Both noted that nothing now exercises the wiring inside What it waits on is unchanged: a boot on an affected machine, as asked above. The shell code at f234bb0 is identical to b94f801, so a test of either answers it. For a fresh checkout, use |
Summary
Test plan
bash test/shell.d/battery-test.sh— 21 checks, including the Quickshell runtime fixture for device readiness and the settle intervalgit diff --checkFixes #7679
Made with Cursor