Repository navigation
fix: remove broken throttle from VirtualGrid scroll tracking - #12781
mattmillerai merged 2 commits into
Conversation
VueUse >=14 throttleFilter drops events spaced wider than the throttle window when leading=false (regression of vueuse#2390), so useScroll with throttle: 64 froze scrollY for discrete mouse-wheel input. Every VirtualGrid consumer (assets sidebar, manager dialog, widget select dropdown) rendered a blank viewport on wheel scroll and never fired approach-end. Trackpad scrolling masked the bug by emitting events faster than the window. Scroll events are frame-aligned and the handler is cheap; drop the throttle and the unused scrollThrottle prop.
|
Warning Review limit reached
More reviews will be available in 1 minute and 37 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesRemove scrollThrottle prop and scroll throttling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Suggested reviewers
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 1668 passed, 0 failed📊 Browser Reports
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #12781 +/- ##
===========================================
- Coverage 75.36% 61.59% -13.78%
===========================================
Files 1565 1454 -111
Lines 91360 75060 -16300
Branches 23977 21192 -2785
===========================================
- Hits 68851 46231 -22620
- Misses 21779 28475 +6696
+ Partials 730 354 -376
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1133 files with indirect coverage changes 🚀 New features to boost your workflow:
|
## Summary Every `VirtualGrid` consumer (assets sidebar, manager dialog, widget select dropdown) is blind to discrete mouse-wheel scrolling: `useScroll`'s `throttle: 64` never reports scroll position, so the virtualization window stays frozen — users see blank space below the first viewport of items and `approach-end` (infinite scroll) never fires. Trackpad scrolling masks the bug by emitting events faster than the throttle window. ## Changes - **What**: drop the `throttle` option from `useScroll` in `VirtualGrid` and remove the `scrollThrottle` prop (no consumer passes it). Scroll events are frame-aligned and the handler is cheap, so the throttle bought nothing even when it worked. - **Root cause**: VueUse ≥14 `throttleFilter` with `leading=false` (what `useScroll` uses) marks spaced-out events as executed without executing them — each event re-arms an `isLeading` restore timer that makes the next event skip its invoke, and the trailing branch is unreachable when `elapsed > duration`. Regression of vueuse#2390; still present on vueuse `main`. ## Review Focus - Verified live against staging: with the throttle, sidebar scrolled to `scrollTop` 1250 while `scrollY` stayed 0 and the render window stayed at `[0..3)` of 27 (blank viewport); with this fix, `scrollY` tracks 1:1 and the window advances. Bare-vs-throttled `useScroll` compared side-by-side on the same element to isolate the cause. - Unblocks wheel-scroll for #12780's dropdown infinite scroll with no changes there. - Fixes FE-990 🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary Every `VirtualGrid` consumer (assets sidebar, manager dialog, widget select dropdown) is blind to discrete mouse-wheel scrolling: `useScroll`'s `throttle: 64` never reports scroll position, so the virtualization window stays frozen — users see blank space below the first viewport of items and `approach-end` (infinite scroll) never fires. Trackpad scrolling masks the bug by emitting events faster than the throttle window. ## Changes - **What**: drop the `throttle` option from `useScroll` in `VirtualGrid` and remove the `scrollThrottle` prop (no consumer passes it). Scroll events are frame-aligned and the handler is cheap, so the throttle bought nothing even when it worked. - **Root cause**: VueUse ≥14 `throttleFilter` with `leading=false` (what `useScroll` uses) marks spaced-out events as executed without executing them — each event re-arms an `isLeading` restore timer that makes the next event skip its invoke, and the trailing branch is unreachable when `elapsed > duration`. Regression of vueuse#2390; still present on vueuse `main`. ## Review Focus - Verified live against staging: with the throttle, sidebar scrolled to `scrollTop` 1250 while `scrollY` stayed 0 and the render window stayed at `[0..3)` of 27 (blank viewport); with this fix, `scrollY` tracks 1:1 and the window advances. Bare-vs-throttled `useScroll` compared side-by-side on the same element to isolate the cause. - Unblocks wheel-scroll for #12780's dropdown infinite scroll with no changes there. - Fixes FE-990 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Every
VirtualGridconsumer (assets sidebar, manager dialog, widget select dropdown) is blind to discrete mouse-wheel scrolling:useScroll'sthrottle: 64never reports scroll position, so the virtualization window stays frozen — users see blank space below the first viewport of items andapproach-end(infinite scroll) never fires. Trackpad scrolling masks the bug by emitting events faster than the throttle window.Changes
throttleoption fromuseScrollinVirtualGridand remove thescrollThrottleprop (no consumer passes it). Scroll events are frame-aligned and the handler is cheap, so the throttle bought nothing even when it worked.throttleFilterwithleading=false(whatuseScrolluses) marks spaced-out events as executed without executing them — each event re-arms anisLeadingrestore timer that makes the next event skip its invoke, and the trailing branch is unreachable whenelapsed > duration. Regression of vueuse#2390; still present on vueusemain.Review Focus
Verified live against staging: with the throttle, sidebar scrolled to
scrollTop1250 whilescrollYstayed 0 and the render window stayed at[0..3)of 27 (blank viewport); with this fix,scrollYtracks 1:1 and the window advances. Bare-vs-throttleduseScrollcompared side-by-side on the same element to isolate the cause.Unblocks wheel-scroll for feat(assets): wire infinite scroll to the flat-output provider in the widget select dropdown #12780's dropdown infinite scroll with no changes there.
Fixes FE-990
🤖 Generated with Claude Code