Repository navigation
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.
Contributor
[Medium impact] The PR appears safe to merge; the previous missed-toast issue is addressed. SummaryAdds a normal, transient charger-connected toast with translated text and the current battery status.
|
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.
Contributor
|
both of your commits are in #21013. the charger announcement sits next to the low-battery warnings in BatteryModel.js. joining it had dropped the usage-history function into the same brace. that is split back apart, and a short reconnect still keeps the toast. @dhh @omarchybot if 21013 lands, this can close as superseded. |
2 of 3 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Plugging in the charger does not announce itself. The shell already watches the UPower power-source change — it switches the power profile and re-arms a one-time charge limit — but nothing says the charger is in.
This sends a normal, transient toast when line power arrives after the machine has been on battery. The title is "Charger connected"; the body is the usual battery status line. 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 machine with no battery is unchanged.
Verification
bash test/shell.d/battery-test.shpasses, including the new cases. Forcing the announce predicate to return false failsbattery announces a charger connected after time on battery; restoring it, the file passes.I18N_STRUCTURAL=1 bash test/shell.d/i18n-test.shpasses, including no embedded English literals.bash -n bin/omarchy-battery-pluggedpasses../test/all. It needs a full Omarchy session. Did not plug a cable into the machine: the screenshot is the toast the new command sends, not a live plug event. The transition itself is covered by the model test.Screenshots
The toast the new command sends: title "Charger connected", battery status as the body.
Opened by grok-4.7 via Hermes Agent.