Skip to content

feat(aula): support SC590 Pro DPI stages in OpenMouse - #1758

Merged
onyxhq-dev merged 4 commits into
OpenMouse-Project:mainfrom
Vantesh:aula-sc590-pro
Dec 4, 2026
Merged

onyxhq-dev merged 4 commits into
OpenMouse-Project:mainfrom
Vantesh:aula-sc590-pro

Conversation

@Vantesh

@Vantesh Vantesh commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Use the optional per-stage DPI ranges in the editor, controller and hardware diagnostics. The AULA SC590 Pro's sixth stage has a different range and step.
  • Commit typed fixed-stage DPI values on Enter or blur, preserving untouched stages.
  • Map the SC590 Pro model name to the hosted aula-sc590-pro.png filename. No vendor binary is included; see artwork request #1757.

Dependency and verification

Depends on mouse-protocol #341. This draft keeps the current published dependency so it remains buildable. Once the driver is published, update the dependency and verify device discovery before marking this ready for review.

OpenMouse's build, bundle-size checks and all 770 tests passed with the published dependency and the local protocol branch.

  • Run npm run check against the released protocol dependency that contains the driver.
  • Verify USB and 2.4 GHz discovery and DPI editing with that release.

Note

Add per-stage DPI options for SC590 Pro in OpenMouse

  • Adds dpiOptionsForStage in dpi-presets.ts to filter DPI options by the stage editor's min, max, and step limits. With a stage index it uses that stage's override; without one it returns the intersection across reported stages.
  • Updates the controller in controller.ts so custom DPI input clamping, validation, and nearest-option lookup all use the pending active stage's options instead of device-wide options.
  • Reworks DpiStageEditor in DpiCard.tsx: per-stage slider bounds, writes by hardware stage index, typed edits commit on blur or Enter in fixed-stage mode, and single-DPI fills snap to shared options.
  • Adds SC590 Pro artwork name matching (spaced or hyphenated) in device-images.ts, and filters hardware-test DPI targets by the active stage in HardwareTestPage.tsx.
  • Behavioral Change: DPI values not available for the active stage are now rejected or clamped; check commitCustomDpi and applyDpiStageValue in controller.ts for consumers of the old device-wide option list.

Macroscope summarized 223bda8.

Summary by CodeRabbit

  • New Features
    • DPI choices now reflect the supported range and increments for each device stage across editing and hardware testing.
    • Fixed-count DPI tables preserve edits until you confirm them by pressing Enter or leaving the field.
    • Added device artwork for AULA SC590 Pro name variants.
  • Bug Fixes
    • Custom DPI values are validated against the selected stage, including pending stage changes.

Honor optional per-stage DPI ranges in the editor, controller and hardware test. Commit fixed-stage numeric edits on blur or Enter so intermediate digits and untouched stages are not staged for writing.

Reserve the hosted artwork filename without bundling a vendor image. SC590 Pro discovery will become available when OpenMouse adopts a protocol release containing the driver.
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Comment thread src/device/controller.ts Resolved
Vantesh and others added 2 commits December 4, 2026 00:39
Use the pending preview for preset and custom DPI validation so a value supported by the queued stage can be applied in the same batch. Verified on an SC590 Pro by queuing stage 6 and 20,000 DPI together.
# Conflicts:
#	src/device/controller.ts
#	src/device/profile-write-ownership.test.ts
@onyxhq-dev
onyxhq-dev marked this pull request as ready for review December 4, 2026 19:17
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 4, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The change adds SC590 Pro stage-specific DPI limits and updates shared stage editing. An unresolved finding identifies a mode-switch sequence that can leave unequal DPI stages in Single mode, allowing unexpected sensitivity cycling.

Notes:

  • The correctness review posted 1 finding. Your repo's Minimum Blocking Severity is Off, so they do not automatically block approval.

You can add or adjust custom eligibility rules. Learn more.

Comment thread src/features/devices/cards/DpiCard.tsx Resolved
Comment thread src/features/devices/cards/DpiCard.tsx Resolved
…DPI view

- A slider edit still waiting on its debounce is committed with the view it was made in, instead of being dropped by the switch
- Switching to Single shows the snapped DPI it stages
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 4, 2026 19:24

Dismissing prior approval to re-evaluate 223bda8

@onyxhq-dev
onyxhq-dev merged commit fe38af7 into OpenMouse-Project:main Dec 4, 2026
5 of 6 checks passed
useEffect(() => {
if (mode === lastModeRef.current) return;
lastModeRef.current = mode;
flushRef.current();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High cards/DpiCard.tsx:214

Switching to Single before a fixed-stage edit's debounce expires can leave DPI cycling enabled: for [400, 800, 1600] with stage 0 active, moving stage 0 to 1200 and switching modes produces [1200, 400, 400]. flushRef.current() commits 1200, but the rest of this effect uses the captured, pre-flush status.dpiStages, so applySingleDpi(400) skips stage 0; perform the conversion using the post-flush stage values or on a subsequent render.

🤖 Copy this AI Prompt to have your agent fix this:
In file @src/features/devices/cards/DpiCard.tsx around line 214:

Switching to Single before a fixed-stage edit's debounce expires can leave DPI cycling enabled: for `[400, 800, 1600]` with stage 0 active, moving stage 0 to `1200` and switching modes produces `[1200, 400, 400]`. `flushRef.current()` commits `1200`, but the rest of this effect uses the captured, pre-flush `status.dpiStages`, so `applySingleDpi(400)` skips stage 0; perform the conversion using the post-flush stage values or on a subsequent render.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants