Skip to content

fix(gui): embed the Sleep action's moon glyph - #790

Open
AalmanSadath wants to merge 1 commit into
AprilNEA:masterfrom
AalmanSadath:fix/sleep-action-icon
Open

fix(gui): embed the Sleep action's moon glyph#790
AalmanSadath wants to merge 1 commit into
AprilNEA:masterfrom
AalmanSadath:fix/sleep-action-icon

Conversation

@AalmanSadath

Copy link
Copy Markdown

Summary

The "Sleep" action rendered with a blank icon in the button picker. action_icon_path has mapped Action::Sleep to action-icons/moon.svg since #395 landed the file and the arm together, but the glyph was never added to ACTION_ICONS. ActionIcons::load answers Ok(None) for an unlisted path, so the row drew an empty slot — there is no error path for this, at runtime or at compile time.

moon.svg was the only referenced-but-unembedded path in the tree, and nothing is embedded-but-orphaned, so this is the whole of the bug.

Changes

openlogi-ui

  • Register moon.svg in ACTION_ICONS, positioned after monitor.svg.
  • every_bundled_glyph_is_embedded: walks action-icons/ and asserts each .svg resolves through the asset source. Catches a glyph added to the directory but left out of the table — this bug's exact shape. Lives here rather than in the GUI crate so it also runs in the Linux test lane.

openlogi-desktop

  • every_reachable_action_icon_is_embedded: asserts every path action_icon_path can return is embedded, guarding the opposite direction — an arm naming a glyph nobody shipped. Action::catalog() omits ShowActionsRing (not_pickable, but still drawn wherever it is already bound) and the parameterised variants, which hold the only references to keyboard.svg and terminal.svg; those are listed explicitly so all 51 Action variants are reached.

Testing

Local gate, green on the final tree:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace                                  # 1059 tests, 0 failed
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items \
  --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agent
cargo xtask ci

cargo xtask ci reports 8 passed, 0 failed, 1 skipped. tests (macos) did not run — this is a Linux host, so that job is unverified here; CI covers it.

The rustdoc job excludes both crates touched here, so I ran rustdoc on them directly as well: openlogi-ui is clean; openlogi-desktop reports 12 unresolved intra-doc links that are all pre-existing on master and unrelated to this change.

The guard is proven rather than assumed — deleting the table entry fails the new test on the real path:

action-icons/moon.svg is on disk but missing from ACTION_ICONS
test result: FAILED. 1 passed; 1 failed

Runtime-tested on hardware: MX Master 3S over Bluetooth-direct on Fedora 44 (Wayland, GNOME). The moon glyph renders on the Sleep row and matches its neighbours in the System section.

Fixes #770.

Before fix:
Before

After fix:
After

`action_icon_path` has mapped `Action::Sleep` to `action-icons/moon.svg`
since the F-row remapper landed the file and the arm together, but the
glyph was never added to `ACTION_ICONS`. The asset source answers with
`Ok(None)` for an unlisted path, so the Sleep row rendered an empty slot
with no error anywhere to catch it. It was the only referenced-but-unembedded
path in the tree, and nothing was embedded-but-orphaned.

Guard both directions so this cannot recur:

- `every_bundled_glyph_is_embedded` walks `action-icons/` and asserts each
  file resolves, catching a glyph added to the directory but not the table
  (this bug). It lives in openlogi-ui, so it runs in the Linux test lane too.
- `every_reachable_action_icon_is_embedded` asserts every path the picker can
  return is embedded, catching an arm that names a glyph nobody shipped. The
  catalog omits `ShowActionsRing` and the parameterised variants — which hold
  the only references to the keyboard and terminal glyphs — so those are
  covered explicitly and all 51 `Action` variants are reached.

Verified by deleting the table entry and watching the first test fail on
`moon.svg`, then in the running GUI on an MX Master 3S over Bluetooth-direct.

Fixes AprilNEA#770.
@AalmanSadath
AalmanSadath requested a review from AprilNEA as a code owner August 22, 2026 14:51
@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Greptile Summary

The PR embeds the previously omitted moon glyph so the Sleep action renders its icon, and adds regression coverage in both directions.

  • Registers action-icons/moon.svg in the shared ActionIcons asset source.
  • Verifies every bundled SVG is represented by the embedded asset table.
  • Verifies every icon path reachable from current Action variants resolves to embedded bytes.

Confidence Score: 5/5

The PR appears safe to merge, with the missing Sleep icon correctly embedded and guarded by focused regression tests.

The changed asset table now resolves the existing moon path, while the new tests cover both bundled-file registration and action-to-asset references without introducing a concrete runtime or build failure.

Important Files Changed

Filename Overview
crates/openlogi-desktop/src/features/mouse/picker.rs Adds comprehensive coverage asserting catalogued and explicitly uncatalogued action variants resolve to embedded icons; no actionable defect found.
crates/openlogi-ui/src/action_icons.rs Embeds the missing moon SVG and adds a source-tree completeness test for bundled glyphs; no actionable defect found.

Reviews (1): Last reviewed commit: "fix(gui): embed the Sleep action's moon ..." | Re-trigger Greptile

@davidbudnick davidbudnick added type: bug Something is broken or behaves incorrectly area: gui Graphical user interface platform: all Cross-platform issue labels Aug 22, 2026
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: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The icon of the "Sleep" built-in action is missing while remapping buttons

2 participants