Skip to content

fix(asusd): carry Slash display mode as u8 over the D-Bus stack - #273

Open
NB-Group wants to merge 1 commit into
OpenGamingCollective:mainfrom
NB-Group:rogcc-slash-u8
Open

fix(asusd): carry Slash display mode as u8 over the D-Bus stack#273
NB-Group wants to merge 1 commit into
OpenGamingCollective:mainfrom
NB-Group:rogcc-slash-u8

Conversation

@NB-Group

@NB-Group NB-Group commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Split out of #230, where it was buried inside the UI redesign. It is a self-contained backend change and has nothing to do with the UI work, so it gets its own PR.

The Slash display mode was leaking through the D-Bus stack as the raw animation interval, while every caller actually wanted the mode discriminant. Thread it as u8 instead:

  • rog-slash: SlashMode is now #[repr(u8)]
  • asusd trait impl + rog-dbus binding return u8
  • asusctl CLI parses u8
  • rog-control-center setup_slash consumes u8, with a short retry because the single post-startup read races asusd coming up

No UI page is touched. Builds clean across rog-slash / rog-dbus / asusd / asusctl / rog-control-center.

Carry the Slash display mode as a u8 end-to-end instead of leaking the
animation interval where callers expect the mode discriminant: rog-slash
data type is #[repr(u8)], the asusd trait impl and rog-dbus binding
return it as u8, the asusctl CLI reader parses u8, and rog-control-center's
setup_slash consumes it with a short retry (the single post-startup read
races asusd). Self-contained backend change; no UI page touches.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the reported Slash display mode so it reflects the configured mode rather than the display interval.
    • Improved Slash mode loading and updates with validation, including a retry when initial loading fails.
    • Unknown or invalid mode values now produce a warning and preserve a safe default instead of causing failures.
    • CLI output now displays recognized mode names and clearly identifies unrecognized values.

Walkthrough

Slash mode access now uses raw u8 values at the D-Bus boundary. Consumers validate those values with SlashMode::try_from, retry failed UI reads, and report unknown modes without applying invalid state.

Changes

Slash mode validation

Layer / File(s) Summary
SlashMode byte contract
rog-slash/src/data.rs
SlashMode now has an explicit u8 representation. TryFrom<u8> maps known discriminants and rejects unknown values.
D-Bus mode access
rog-dbus/src/zbus_slash.rs, asusd/src/aura_slash/trait_impls.rs
The D-Bus getter returns the raw configured display mode byte. The asusd getter returns display_mode instead of display_interval.
UI and CLI mode handling
rog-control-center/src/ui/setup_slash.rs, asusctl/src/slash_cli.rs
The control center validates startup and event values, retries failed reads once, and keeps its default mode after repeated failure. The CLI displays validated names or an unknown(0x..) fallback.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: asusd, asusctl, rog-slash, rog-control-center, fix

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly summarizes the change, motivation, scope, and claimed build status, but it omits the required template sections and verification checklist. Add the required Description, issue, Tested Hardware & Environment, and Verification and testing sections, then mark each completed verification item.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the primary change: carrying the Slash display mode as u8 through the asusd D-Bus stack.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added asusctl CLI Tool asusd System Daemon / D-Bus fix Fix a bug or an issue rog-control-center ROG Control Center GUI rog-slash Slash LED Bar labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asusctl CLI Tool asusd System Daemon / D-Bus fix Fix a bug or an issue rog-control-center ROG Control Center GUI rog-slash Slash LED Bar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant