Repository navigation
Throttle scroll-triggered actions - #1414
Conversation
|
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
📒 Files selected for processing (16)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughWheel actions now use normalized scroll input, movement accumulation, and per-axis throttling. Transformer routes share gesture ownership and throttle state by device, including for modifier zoom actions. Momentum handling retains or releases ownership according to gesture state. ChangesScroll action flow
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant ScrollGestureTransformer
participant ButtonMappingTransformer
participant ScrollInput
participant ButtonMappingEngine
participant ScrollActionRecognizer
participant ScrollActionThrottle
participant ScrollMovementAccumulator
ScrollGestureTransformer->>ButtonMappingTransformer: Forward direct scroll event
ButtonMappingTransformer->>ScrollInput: Normalize event by axis and units
ButtonMappingTransformer->>ButtonMappingEngine: Select configured wheel mapping
ButtonMappingEngine->>ButtonMappingTransformer: Return action and mapping index
ButtonMappingTransformer->>ScrollActionRecognizer: Submit normalized input and mapped action
ScrollActionRecognizer->>ScrollActionThrottle: Check per-axis action time
ScrollActionRecognizer->>ScrollMovementAccumulator: Accumulate repeating movement
ScrollActionRecognizer->>ButtonMappingTransformer: Return consumed step count and coalesced action
Merge Risk: ⚪ Minimal · up to This change adds a shared 300 ms cooldown for scroll-triggered actions and ties momentum handling to whichever action owns the scroll gesture. Unit tests cover the cooldown, route changes, and zoom behavior. No concrete defect was identified, so the change appears ready to merge. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected changes preserve existing input filtering and action-execution controls while improving scroll-state continuity. No introduced security violation was established. Residual uncertainty concerns device attribution during a gesture and behavior outside the inspected desktop input path. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
…in (#1479) Closes #1455 Since #1414, mappings from the scroll wheel to volume or brightness have gone through the 300 ms cooldown meant for discrete commands. They now fire at most about three times per second, so changing the volume takes much more scrolling than it did in v0.12.0. This change treats volume and brightness (display and keyboard) as incremental controls rather than discrete commands: - **Wheel detents:** the first step comes at half a detent, then one step per full detent, with no cooldown. This is the same counting line scrolling uses, so high-resolution wheels split into any number of events still give one step per notch. Legacy wheels keep v0.12.0's one step per event. - **Continuous input (trackpad / Magic Mouse):** the first step comes at 16 pt, then one every 32 pt. - **Momentum:** still consumed without triggering steps. - **Safety bound:** a single event triggers at most 16 steps. - **Shared cooldown:** these actions neither check nor advance it, so throttled mappings like tab switching (#1028) behave as before. Keyboard shortcuts, Mission Control, Spaces, and the other media keys keep the 300 ms throttle. ## Testing - Updated policy tests and added unit tests for stepping, event splitting, cooldown isolation, continuous input, and the per-event bound. - Ran the scroll and button mapping test suites: 137 tests pass. - Tested manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #1518 Since #1414, zooming with a modifier key and the scroll wheel has shared the 300 ms cooldown meant for discrete commands such as switching tabs. Scroll input during the cooldown was dropped, so a continuous scroll zoomed only once. Zoom now steps with the movement, like volume and brightness: - **Scroll wheels:** one step per wheel event, as in v0.12.0. With smoothed scrolling, high-resolution wheels step once per detent. - **Side wheels:** one step per event. - **Trackpads and Magic Mouse:** the first step comes at 16 pt, then one every 32 pt, instead of one per event. - **Momentum:** still ignored. Zooming no longer checks or advances the cooldown of mapped commands. ## Testing - Replaced the zoom cooldown tests with tests for wheel, side wheel, high-resolution and continuous input. - Ran all unit tests: 1218 pass. - Tested manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Apply a shared 300 ms throttle to discrete scroll actions across both axes, including high-resolution wheels. Keep scroll-output mappings distance-based and preserve their momentum through route and modifier changes.
Validated with 1,017 unit tests.
Closes #1028
Summary by CodeRabbit
New Features
Bug Fixes