Repository navigation
Send the low battery warning as a normal toast that goes after 30 seconds - #16562
Conversation
Critical toasts never expire on the new notification engine and are restored on every shell start, so the warning stayed on screen after plugging in, after recovering, and across restarts. The battery service now closes it in process whenever a check finds the battery on AC or above the threshold, and again whenever a matching toast is shown while that holds: one restored at startup, released by a held deck, or delivered after the charger went in. It matches the sender and icon rather than the translated title, so it works in any language, and it spawns nothing. After a restart while still low, the restored warning gives way to the fresh one rather than stacking under it. The notifications service gains the two pieces that needs: dismissWhere(app, appIcon), which reaches rows held behind an open deck or still waiting to be inserted as well as those on screen, and a shown signal for every row on its way to the screen, including a replacement folded into an insert still queued. dismissWhere drops a matching row's queued replacement, since one landing after the close would bring the card back. History asked for with showHistory is neither announced nor dismissed. A user's clone of the notifications plugin from before this change has neither piece, and the battery service carries on without them. Fixes #8813 Fixes #14639 Co-Authored-By: Diogo Ferreira <diogo@underdev.org> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Muse Spark 1.3 High <noreply@meta.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I ran this on a disposable Omarchy VM built from the ISO, with a mock UPower on the system bus, against
Codex Medium and Muse Spark 1.3 High reviewed it in four rounds, and neither had anything left to act on in the last one. The config-reload handling rests on their reading of the code rather than on the VM: the same scenario also kept the warning on the commit before that handling went in, so the VM didn't reproduce the case it guards. The tests cover the notifications service's side against the real functions. The battery service's wiring is covered only by the VM runs above. |
Omarchy's AGENTS.md asks for full lines in docs/; the surrounding bullets predate that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge. SummaryLow-battery warnings now use normal urgency so their existing 30-second timeout can take effect.
No new actionable issues were found. Reviews (2) · Last reviewed commit: "Send the low battery warning as a normal..." · Reviewed by Greptile |
This reverts commit dc7552a.
…er low" This reverts commit 65fb295.
…onds As a critical toast it never expired on the new notification engine and came back on every shell start, so it stayed on screen after plugging in, after recovering, and across restarts on AC. It already asks for 30 seconds; only critical urgency overrode that. As an omarchy-action toast it still gets through Do Not Disturb. Fixes #8813 Fixes #14639 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This now takes the simpler route from #14639: the warning is a normal toast that expires, so the earlier comment about dismissing it from the battery service no longer applies. Run on a disposable Omarchy VM built from the ISO, against
Codex Medium and Muse Spark 1.3 High reviewed it and found no defect. Codex pointed out that the countdown pauses while the deck is open, as every non-critical card's does, and the docs say so. |
The low battery warning was sent as a critical toast, and on the new notification engine (#15932) critical toasts never expire and come back on every shell start. So once it was up it stayed: after plugging in, after the level recovered, and across restarts and reboots on AC.
It is now sent as a normal toast.
omarchy-battery-lowalready asked for 30 seconds with-t 30000, and only critical urgency overrode that, so the warning now expires after 30 seconds on its own. One restored after a restart leaves after the engine's short restore grace. As anomarchy-actiontoast it still gets through Do Not Disturb, and thebattery-lowhook still runs.The trade-off is deliberate: a warning sent while nobody is at the screen is gone after 30 seconds rather than waiting, and after plugging in it sits out the rest of its 30 seconds instead of going at once. The battery icon in the bar still shows the level. Like every non-critical card, its countdown pauses while the deck is open. A critical warning saved before this change is still critical, so it comes back once more after the update until it is dismissed.
This is the change #14639 by @elonmask proposed. It replaces the open attempts at the same bug, which dismissed the warning from the battery service and have been closed in favour of this: #15902 by @defer, #14218 by @emirbelkahia, #11415 by @gaburn, #11959 by @stappmus, #14825 by @kajhaccou and #15911 by @catlee.
Reviewed by Codex Medium and Muse Spark 1.3 High; neither found a defect.
Fixes #8813
Fixes #14639