Skip to content

feat: expose LunaFury button polling and hardware controls - #1153

Open
sekiranunn wants to merge 7 commits into
OpenMouse-Project:mainfrom
sekiranunn:codex/lunafury-device-options
Open

sekiranunn wants to merge 7 commits into
OpenMouse-Project:mainfrom
sekiranunn:codex/lunafury-device-options

Conversation

@sekiranunn

@sekiranunn sekiranunn commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Add LunaFury button polling and bottom-button mode to Buttons, and receiver lighting to Advanced. Use reported capabilities and the existing Apply flow.

Button polling is included in game profiles. Bottom-button mode is stored in the onboard profile; lighting applies to the 8K receiver.

Validation: 410 tests, build and stable bundle checks pass.

Summary by CodeRabbit

  • New Features
    • Added LunaFury controls for button polling rate, bottom-button actions, and receiver lighting. Options appear when supported by the connected device.
    • Added button polling rate to game profiles when the device supports the selected rate.
    • Added a LunaFury preview option.
  • Improvements
    • Clarified that button polling rate is independent of USB report rate, and added translated labels and guidance for the new controls.
    • Improved how LunaFury setting changes are handled during profile switches and settings read-back, helping prevent conflicting edits.

@github-actions github-actions Bot added type: enhancement PR title category: enhancement area: ui Interface and styling area: devices Device integration and HID support area: translations Localized interface strings area: ci Automation and build configuration labels Oct 18, 2026
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: OpenMouse-Project/openmouse/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db8083cd-68fd-40bb-a459-af2d424abdd4
📥 Commits

Reviewing files that changed from the base of the PR and between ceaa4d0 and ab9185d.

📒 Files selected for processing: 5
  • build/lunafury-options.test.ts
  • src/device/controller.ts
  • src/features/devices/workspace-tabs.test.ts
  • src/features/devices/workspace-tabs.ts
  • src/features/games/GameProfilePanel.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Adds staged LunaFury controls for button polling rate, bottom-button mode, and receiver lighting. Adds button polling-rate support to profile staging and handles profile switches with status read-back. Adds device workspace controls, a preview fixture, and localized labels.

Changes: LunaFury device controls

Layer / File(s) Summary
Polling rate in profile staging
src/device/lunafury-profile.ts, src/device/lunafury-profile.test.ts, src/device/controller.ts
Profile sanitization accepts supported button polling rates. Profile staging applies a rate only when the current device reports it as supported.
Staged controls and profile read-back
src/device/controller.ts, build/lunafury-options.test.ts
Adds validated handlers for button polling rate, bottom-button mode, and receiver-light mode. LunaFury profile switches block other edits until status read-back completes. Tests cover staging rules, dispatch, and read-back outcomes.
Device controls, availability, and preview
src/features/devices/cards/*, src/features/devices/OverviewPage.tsx, src/features/devices/workspace-tabs.ts, src/features/devices/workspace-tabs.test.ts, src/features/devices/cards/availability.ts, src/features/devices/cards/availability.test.ts, src/features/games/GameProfilePanel.tsx, src/device/preview/preview-fixtures.ts, src/device/preview/preview-modes.ts, src/shared/CardSlot.tsx, src/styles/areas/advanced.css, src/i18n/index.ts, src/i18n/locales/*
Adds bottom-button and receiver-light cards and polling-rate selection. Updates card availability and game-profile tab selection. Adds a LunaFury preview fixture, card glyphs, layout rules, and translations.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LunaFuryCards
  participant Controller
  participant DeviceClient
  User->>LunaFuryCards: Select a supported setting
  LunaFuryCards->>Controller: Stage the selected setting
  User->>Controller: Apply pending operations
  Controller->>DeviceClient: Dispatch the setting through its client setter
Loading

Suggested reviewers: 7eedle, snekxs

Merge Risk: ⚪ Minimal · up to ab918

No identified issue needs to be resolved before merging. The LunaFury controls can proceed through normal merge checks.

Security architecture risk: 🔵 Low · up to ab918

The new controls use the existing connected-device workflow and restrict settings to supported values. No security-boundary bypass was established. Some uncertainty remains around interrupted profile application and ownership when switching devices.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated added authority is limited to supported polling settings, onboard bottom-button behavior, and receiver lighting through the active device client. The existing Bridge profile integration can initiate polling application, but the inspected changes do not establish new service, tenant, credential, or operating-system authority.

Trust Boundaries and Controls

  • observed — Raw profile settings pass through sanitization and device-capability checks before polling is staged. Device selection uses browser-authorized device groups and waits for controller activity to finish. Background refresh also rejects results from a client or device that is no longer active.
  • observed — Disconnection clears active clients, pending changes, and the latest device status. Replacement selection uses devices already returned by the browser's authorized-device API. These are existing cleanup and authorization controls, not guarantees that every interrupted asynchronous operation is identity-safe.

Resilience and Maintainability Implications

  • observed — The pre-existing profile wrapper returns written whenever settings were staged, even though the batch writer handles failures internally. The Bridge applier then records the profile signature for any non-busy result. Newly added polling inherits this completion-reporting limitation, but the comparison did not establish a materially worsened security exposure.

Hardening Proposals

  • proposed — As follow-up hardening of the existing profile lifecycle, propagate explicit complete or partial-failure outcomes to the profile applier before committing an applied signature, and document whether changing the target device intentionally migrates the current draft.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 26 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: exposing LunaFury button polling and hardware controls.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Labels

area: ci Automation and build configuration area: devices Device integration and HID support area: translations Localized interface strings area: ui Interface and styling type: enhancement PR title category: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant