Skip to content

feat(overlay): show keyboard backlight level - #1695

Open
nathan-fontenele wants to merge 7 commits into
AprilNEA:masterfrom
nathan-fontenele:feat/keyboard-backlight-osd
Open

nathan-fontenele wants to merge 7 commits into
AprilNEA:masterfrom
nathan-fontenele:feat/keyboard-backlight-osd

Conversation

@nathan-fontenele

@nathan-fontenele nathan-fontenele commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Show the keyboard backlight level when an MX Keys backlight key changes it. The indicator updates promptly, reaches a full bar at the highest selectable level, and remains independent of the Actions Ring.

Changes

  • openlogi-device: decode HID++ backlight notifications into a separate latest-value channel and refresh older Bolt probe caches so their backlight feature index is discovered.
  • openlogi-agent-core: forward backlight readings without waiting for inventory scans and keep indicator generation, publication, and expiry ordered.
  • openlogi-ipc: append the observation method without changing existing request numbers; keep wire goldens pinned.
  • openlogi-overlay: retain the observer connection, repaint changed levels, and close only the window belonging to each overlay.
  • openlogi-core and openlogi-cli: present the highest selectable level as nb_levels - 1 (for example, 7 / 7 when the device reports eight levels).
  • Merged master twice to resolve conflicts. The first was with the 0x1F20 ADC-measurement work: both event indices are kept, the IPC protocol is bumped to v36 and the probe-cache schema to v5 (each side had independently taken v35 / v4), and the backlight ast-grep rule moves to crates/openlogi-core/.ast-grep/rules/. The second (head 8e9f007f) was with the DeviceWake reconnection event from fix(agent): reapply volatile settings on device reconnection and retry disagreeing DPI writes #1270: InventoryEvent keeps both BacklightChanged and DeviceWake, with an arm for each in the agent lifecycle and the replay tests. master is still on IPC v35 / cache v4, so v36 / v5 do not collide.

Testing

Re-run locally on the merged head (8e9f007f, Linux):

  • cargo fmt --all --check
  • cargo check --all-targets for openlogi-agent-core, openlogi-agent, openlogi-overlay, openlogi-device, openlogi-ipc
  • cargo clippy --all-targets -- -D warnings for openlogi-agent-core and openlogi-agent
  • cargo test for openlogi-agent-core, openlogi-agent, openlogi-device, openlogi-ipc (all pass, including wire_format pinned at v36)

Not run locally on this head:

  • openlogi-overlay unit tests: the test binary does not link on this machine (libxkbcommon-x11 is missing); the crate does pass cargo check.
  • ast-grep scan, typos, cargo xtask ci wasm, Windows/macOS clippy, cargo-deny: left to CI.

Hardware: the Linux MX Keys check (rapid Fn+F6/F7 presses end at the last level, the highest level shows 7 / 7 with a full bar, the earlier IPC EOF loop is gone) was done before either merge and has not been repeated on the merged head.

Fixes #1663

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issue was established.

Summary

Adds a transient keyboard backlight indicator with a separate latest-value channel and a generation-based IPC observation.

  • Keyboard backlight changes now show in their own temporary indicator.
  • Backlight readouts now use the highest selectable level as their maximum.

All eight supplied previous threads were rechecked. Their reported problems are addressed in the current code; none had a supplied Comment number.

The previous and current commits have different merge bases with the target commit, so the full PR diff was reviewed as the changes since the last review. No tests were run during this review. Native GPUI visual capture was unavailable because this helper has no browser target.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  K[Keyboard notification] --> D[Decode backlight reading]
  D --> W[Keep latest reading]
  W --> A[Agent publishes indicator]
  A --> I[IPC observation]
  I --> O[Overlay updates backlight window]
  A --> T[Expiry after 1.5 seconds]
  T --> I
  L[Agent connection lost] --> H[Hide backlight window]
Loading

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

Comment thread crates/openlogi-overlay/src/ipc.rs Outdated
Comment thread crates/openlogi-agent-core/src/watchers/inventory.rs Outdated
Comment thread crates/openlogi-agent-core/src/backlight_overlay.rs Outdated
Comment thread crates/openlogi-overlay/src/main.rs Outdated
Comment thread crates/openlogi-overlay/src/main.rs Outdated
Comment thread crates/openlogi-device/src/inventory/events.rs
Comment thread crates/openlogi-ipc/src/ipc.rs Outdated
@davidbudnick davidbudnick added area: gui Graphical user interface platform: all Cross-platform issue type: feature New feature request labels Oct 9, 2026
Resolve conflicts with the ADC-measurement event work: keep both the
backlight and adc_measurement event indices, bump the IPC protocol to v36
and the inventory cache schema to v5 (both sides had independently taken
v35 / v4), and move the backlight ast-grep rule to crates/openlogi-core.
Comment thread crates/openlogi-overlay/src/ipc.rs
The indicator's expiry timer lives in the agent, so an agent that exits
while the indicator is visible never sends the hide. The overlay window
stayed up until a later observation arrived after reconnecting. Emit a
hidden observation when the observer loses its connection.
@nathan-fontenele

Copy link
Copy Markdown
Contributor Author

Merged master into this branch to resolve the conflicts with the 0x1F20 ADC-measurement work. Both event indices are kept, the IPC protocol is bumped to v36 and the probe-cache schema to v5 (each side had independently taken v35 / v4), and the backlight ast-grep rule moved to openlogi-core. Greptile's latest finding (indicator stuck after an agent crash) is fixed in 0652bae.

Local checks on the final head: fmt, clippy -D warnings, rustdoc, and cargo test --workspace including desktop and overlay. Not run locally: ast-grep, typos, wasm, Windows/macOS clippy, cargo-deny, so the workflows still need approval to cover those. The MX Keys check was done before the merge and not repeated on this head.

@AprilNEA @davidbudnick could you review and approve the pending workflows when you have a moment?

davidbudnick
davidbudnick previously approved these changes Oct 10, 2026
@davidbudnick davidbudnick modified the milestones: Approved, v1.0.0 Oct 10, 2026
…klight-osd

# Conflicts:
#	crates/openlogi-agent-core/src/watchers/inventory.rs
#	crates/openlogi-agent-core/src/watchers/inventory/replay_tests.rs
#	crates/openlogi-agent/src/lifecycle.rs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gui Graphical user interface platform: all Cross-platform issue type: feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: On-screen level indicator when adjusting MX Keys backlight (Backlight Up/Down)

2 participants