Skip to content

Reduce repeated actions from high-resolution scrolling - #1433

Merged
lujjjh merged 1 commit into
mainfrom
fix-high-resolution-scroll-action-repeats
Oct 5, 2026
Merged

lujjjh merged 1 commit into
mainfrom
fix-high-resolution-scroll-action-repeats

Conversation

@lujjjh

@lujjjh lujjjh commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Use the same distance accumulation as line scrolling: trigger after half a detent, then once per full detent, while retaining the 300 ms throttle. Consume suppressed steps without queuing actions.

Validated with 141 related tests.

Summary by CodeRabbit

  • Bug Fixes
    • Scroll actions now respond more consistently to wheel detents, including movement split across multiple events and movement in either direction.
    • Partial detent movement is accumulated until it reaches a step threshold. Detents that cross the threshold during the action cooldown are consumed rather than triggering a delayed action afterward.
    • Scroll input continues to follow movement, while non-detent input clears accumulated movement for its axis.

@lujjjh lujjjh added the bug Something isn't working label Oct 5, 2026
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8091da3-a229-4715-9670-f4f11b5ac101
📥 Commits

Reviewing files that changed from the base of the PR and between 1d7d57f and b3990d6.

📒 Files selected for processing (6)
  • LinearMouse/EventTransformer/ScrollActionRecognizer.swift
  • LinearMouse/EventTransformer/ScrollInput.swift
  • LinearMouse/EventTransformer/ScrollMovementAccumulator.swift
  • LinearMouseUnitTests/EventTransformer/ButtonMappingTransformerTests.swift
  • LinearMouseUnitTests/EventTransformer/ScrollActionRecognizerTests.swift
  • LinearMouseUnitTests/EventTransformer/ScrollActionStateTests.swift

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


📝 Walkthrough

Walkthrough

Detent input now accumulates movement toward the nearest step before action throttling. Crossings that occur during cooldown are consumed rather than queued. Tests cover accumulation, direction, event splits, cooldown behavior, and related scroll actions.

Changes

Detent scroll actions

Layer / File(s) Summary
Nearest-step movement accumulation
LinearMouse/EventTransformer/ScrollMovementAccumulator.swift
The accumulator records whether nearest-step rounding is active and resets state when that setting changes. In rounding mode, it counts progress in the input direction and retains signed remainder.
Detent action recognition and validation
LinearMouse/EventTransformer/ScrollActionRecognizer.swift, LinearMouse/EventTransformer/ScrollInput.swift, LinearMouseUnitTests/EventTransformer/ScrollActionRecognizerTests.swift, LinearMouseUnitTests/EventTransformer/ScrollActionStateTests.swift, LinearMouseUnitTests/EventTransformer/ButtonMappingTransformerTests.swift
The recognizer accumulates detent movement before throttling and does not queue crossings during cooldown. Documentation and tests describe and check detent thresholds, cooldown behavior, and related scroll actions.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b3990

This change reduces repeated actions from high-resolution scrolling by accumulating detent distance before throttling. No concrete merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: reducing repeated actions caused by high-resolution scrolling.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@lujjjh
lujjjh merged commit eaa97d3 into main Oct 5, 2026
2 checks passed
@lujjjh
lujjjh deleted the fix-high-resolution-scroll-action-repeats branch October 5, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant