feat(tray): show device batteries and low-power alerts - #1588
Open
flowsworld wants to merge 6 commits into
Open
flowsworld wants to merge 6 commits into
flowsworld wants to merge 6 commits into
Conversation
Adapt the Windows tray message queue approach from AprilNEA#964 for persistent battery alerts. Co-authored-by: yuzi-co <vadim@yuzi.co>
|
This branch has not been deployed
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.
Summary
Show device batteries directly in the existing macOS and Windows tray menus, with optional low-battery warnings. This is separate from the macOS system Batteries widget in #1544. Linux remains out of scope because it has no existing tray integration.
Related Windows work: #964. Its tray message queue approach is adapted here, with contributor credit in the commit.
Changes
?for an unavailable reading. Clicking opens that device's settings, including after a cold GUI launch.Native macOS captures from an isolated AppKit test app using the actual menu-row implementation:
Testing
Initial implementation checks passed on macOS arm64:
Initial workspace tests: 1,774 passed, 2 ignored. Coverage includes freshness/recovery, warning persistence, USB charging precedence, preference reloads, cold/warm device navigation, wire goldens, and locale parity. The battery policy guard also rejects the original inline threshold.
After the review fixes, all 606 affected-package tests passed:
Formatter, full-workspace Clippy, non-GUI rustdoc, ast-grep, typos, and the Windows agent cross-lint above passed again on the final tree. New regressions cover anonymous receiver replacements, sleeping pairings, physical identity recovered from another route, and battery controls for devices with or without battery evidence. Linux cfg changes were manually audited again.
Native macOS keyboard, mouse and accessibility activation passed in isolation. Normal/orange/red status-icon rendering was verified. Windows was cross-linted, not runtime-tested on hardware. Packaged macOS notification delivery and real-device end-to-end behavior remain untested. Linux cfg changes were manually audited; Linux compilation was not run locally.
Hardware check: open the menu with a battery-reporting device, toggle its two preferences independently, click its row with the GUI closed/open, and verify a low-battery alert does not repeat after reconnect/restart. Charge above 25% before testing a new alert episode.
Fixes #959