Skip to content

fix(finalmouse): make the Starlight X polling rate read-only - #221

Merged
snekxs merged 1 commit into
mainfrom
fix/finalmouse-slx-fixed-polling
Oct 13, 2026
Merged

snekxs merged 1 commit into
mainfrom
fix/finalmouse-slx-fixed-polling

Conversation

@snekxs

@snekxs snekxs commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Closes part of #213.

The Starlight X (361D:0300/0301) runs PerfectPolling — a fixed-rate pipeline. It reports a polling rate, but unlike the Ultralight X there is nothing to select. The shared Finalmouse driver advertised the whole 500/1000/2000/4000/8000 ladder for both, so the app offered an 8k option that does nothing on the SLX.

Changes

  • Split the family on isSlx:
    • supportedPollingRates for SLX is [] (PerfectPolling is fixed); ULX keeps the full ladder.
    • setPollingRate rejects a write on SLX (the reported pollingRateHz is still surfaced for telemetry).
    • ui.pollingReadOnly + ui.hideMotionSync are set for SLX, so the app drops the rate selector and the non-user-facing Motion Sync toggle. ULX output is byte-identical.
  • Register the Starlight X dongle PIDs in SUPPORTED_HID_FILTERS. They were accepted by FinalmouseHidClient.isSupported but absent from the picker, so navigator.hid.requestDevice() never offered the SLX dongle. (Auto-detect on an already-authorized device worked, which is why this went unnoticed.)

Tests

  • Finalmouse Starlight X exposes a fixed PerfectPolling rate, not a picker — asserts the SLX advertises no rates, sets the two UI hints, and refuses setPollingRate(8000).
  • every Finalmouse dongle the driver accepts is offered by the picker — pins the filter ↔ isSupported agreement (mirrors the G-Wolves catalog/filter guard).
  • tsc clean; full suite green (2385 pass).

Notes

Every SLX path is still flagged unverified on hardware in docs/finalmouse-testing.md; this change does not depend on a verified readback — it only stops offering a control the SLX does not have.

Summary by CodeRabbit

  • New Features
    • Added support for detecting Starlight X dongles.
  • Bug Fixes
    • Starlight X polling rates are now read-only, with no selectable rates, and Motion Sync controls are hidden. Ultralight X retains its selectable polling rates and Motion Sync toggle.

The Starlight X (361D:0300/0301) runs PerfectPolling, a fixed-rate
pipeline: it reports a polling rate but has none to select, unlike the
Ultralight X. The shared Finalmouse driver advertised the whole
500-8000 Hz ladder for both, so the app offered an 8k option that does
nothing on the SLX.

Split the family on `isSlx`: the SLX now advertises no selectable rates,
refuses `setPollingRate`, and sets `pollingReadOnly` / `hideMotionSync`
so the app drops the selector and the (non-user-facing) Motion Sync
toggle. The ULX keeps the full ladder and its toggle byte-for-byte.

Also register the Starlight X dongle PIDs in `SUPPORTED_HID_FILTERS`:
they were accepted by `FinalmouseHidClient.isSupported` but absent from
the WebHID picker, so the browser never offered the SLX dongle at all.
A regression test pins the filter/`isSupported` agreement.
@github-actions github-actions Bot added the type: bug PR title category: bug label Oct 13, 2026
@github-actions github-actions Bot added area: protocol Protocol codecs and shared types area: drivers Device drivers and transport integration area: tests Protocol and driver tests area: documentation Documentation labels Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: OpenMouse-Project/mouse-protocol/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24a26847-9957-4483-a1ca-bac8490119f2
📥 Commits

Reviewing files that changed from the base of the PR and between eb9387f and 1fc981e.

📒 Files selected for processing (5)
  • docs/finalmouse-testing.md
  • src/drivers/finalmouse/hid.ts
  • src/drivers/finalmouse/protocol.test.ts
  • src/drivers/finalmouse/vendors.test.ts
  • src/drivers/vendors.ts

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

📝 Walkthrough

Walkthrough

The Finalmouse driver adds picker filters for Starlight X dongles. Starlight X reports no selectable polling rates, rejects polling-rate changes, and hides polling and Motion Sync controls. Ultralight X retains its configurable polling rates.

Changes

Finalmouse device support

Layer / File(s) Summary
Device discovery
src/drivers/vendors.ts, src/drivers/finalmouse/vendors.test.ts
Adds filters for each Starlight X dongle product ID and tests picker filters and client support for Finalmouse devices.
Starlight X polling behavior
src/drivers/finalmouse/hid.ts, src/drivers/finalmouse/protocol.test.ts, docs/finalmouse-testing.md
Uses device-specific supported polling rates. Starlight X has no selectable rates, read-only polling status, and hidden Motion Sync controls. Tests and documentation describe this behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1fc98

No actionable issue was established that prevents merging. Starlight X hardware behavior remains unverified, as the testing guidance notes.

Security architecture risk: 🔵 Low · up to 1fc98

The change is narrowly scoped to two Starlight X dongle models and prevents unsupported polling writes before any device operation. No introduced security vulnerability was established. Starlight X hardware behavior and the consuming application's picker integration remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The added discovery scope is limited to vendor 0x361d, dongle products 0x0300 and 0x0301, and collections on usage page 0xff00. Usage within that page is intentionally unrestricted because the exact SLX usage has not been confirmed.

Trust Boundaries and Controls

  • inferred — The inspected change broadens discovery rather than granting HID permission: it adds filter data without introducing an acquisition or authorization path. Existing driver matching remains in place. The external application caller is unavailable, so its user-gesture, authorization, and filter-use behavior cannot be verified here.
Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: making the Starlight X polling rate read-only. It matches the main implementation and test changes.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@snekxs
snekxs merged commit ace6375 into main Oct 13, 2026
7 checks passed
@snekxs
snekxs deleted the fix/finalmouse-slx-fixed-polling branch October 13, 2026 01:39
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.40.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

area: documentation Documentation area: drivers Device drivers and transport integration area: protocol Protocol codecs and shared types area: tests Protocol and driver tests released type: bug PR title category: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant