Repository navigation
fix(popover): use non-passive wheel listener - #16309
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
Merge Risk: ⚪ Minimal · up to This change updates popover wheel handling and related palette markers; no actionable merge-blocking risk remains, so it is merge-ready after normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides a concise summary and validation commands, but it omits most required template sections. The linked issue is empty, visual proof is missing, testing details and checklist confirmations are incomplete, and required considerations are not documented. Resolution Complete the required template sections: ELI5, What Changed, Why, Linked Issue with an issue number, Visual Proof or exactly N/A with a reason, Testing details and platform coverage, AI Disclosure if applicable, Review, Agent skill upstream boundary, Notes, and the Checklist. Document the pending Electron input validation or complete it before merging. ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Electron QA (session
|
| Setup | Window | Method | ΔscrollTop | ratio |
|---|---|---|---|---|
| Native Electron window | inner 1728×1013, dpr 1 | CDP mouse.wheel δY 100 |
100 | 1.0 |
| Repeat, same window | 1728×1013 | CDP mouse.wheel δY 100 |
100 (100→200) | 1.0 |
Playwright setViewportSize(600,800) (not a real OS resize; outer stayed 1728×1013) |
emulated 600×800 | CDP mouse.wheel δY 100 |
200 | 2.0 |
| Same emulated 600×800 | 600×800 | synthetic WheelEvent δY 100 |
100 | 1.0 |
On merged main the brief recorded 200px (ratio 2.0) at default and 300px at 600px width. On this branch the comparable native-window CDP gesture is 1.0. I could not take a real 600px window measurement: window.resizeTo is a no-op and Browser.setWindowBounds is not exposed on this page CDP session. The 2.0 under setViewportSize is viewport-emulation, not the same 600px-width run as on main; the shim-only synthetic event stayed 1.0 there.
Emulated 600px (for completeness, not a real window resize):
Check 3 — descendant cancellation — PASS (shim); CDP mouse.wheel overshoots
Product surface: cmd-j PaletteFilterFieldOptions list (overflow-y: auto, 280×456) inside PopoverContent.popover-wheel-scroll. That descendant installs a non-passive listener that preventDefault()s and writes scrollTop.
- Synthetic
WheelEventδY 100 on the inner list:scrollTop100,defaultPrevented: true, ratio 1.0. The shim did not add a second 100. - Same surface, CDP
mouse.wheelδY 100: 176 (clamped to remaining room). CDP δY 40: 160 (ratio 4.0). That is not 1:1. I am not claiming a trackpad result. The synthetic event is the one that isolates the shim from Chromium's mouseWheel scaling.
Emoji CommandList (also descendant preventDefault) matched: synthetic δY 20 → 20, defaultPrevented: true.
Check 4 — regression sweep — PASS for reached surfaces; Jira issue popover not reachable
| Surface | Open | Scroll | Close |
|---|---|---|---|
Emoji suggestion popover (nested CommandList + popover-scroll-content) |
yes | yes (nested scroller 238/292) | yes (Esc / dialog Close) |
cmd-j palette Filter (marker moved onto PopoverContent this PR) |
yes | yes (280/456) | yes |
| GitHub Tasks Filters + nested Status | yes | n/a (no overflow) | yes |
| Linear Tasks Filters | yes | n/a (no overflow) | yes |
| Jira issue popover | no — throwaway profile, Jira unconnected | — | — |
Check 5 — CombinedDiffViewer — PASS for the reachable popover; onWheel is not on PopoverContent
CombinedDiffViewer does not pass onWheel to PopoverContent. onWheel={markDirectScrollInput} is on .combined-diff-scroll-container. The AI-notes PopoverContent has no onWheel and was not reachable (no AI notes). The file-tree Filter diff files popover opened and closed normally (no shim class; not overflowing). Esc closed it. CDP mouse.wheel on the combined-diff scroller did not change scrollTop in this session (native path; not the shim).
Summary
| Check | Result |
|---|---|
| 1 Filters height / footer | PASS — 471px, footer pinned |
| 2 Over-scroll ratio | PASS — 1.0 (CDP wheel δY 100 → 100px at 1728×1013). All numbers CDP-synthesised. No trackpad. |
| 3 Descendant cancellation | PASS for the shim (synthetic 1.0). CDP mouse.wheel on that descendant overshot (40→160). |
| 4 Other popovers | PASS emoji, cmd-j Filter, GitHub/Linear task filters. Jira issue popover not reachable. |
| 5 CombinedDiffViewer | PASS file-tree filter popover. onWheel is not on PopoverContent. |
Status: review-clean, QA-clean, mergingReview loop. Two rounds. The first found a real blocker: the WeakSet bridge that carries React's synthetic wheel cancellation to the native shim was attached only when the consumer passed an Electron QA (isolated instance, own CDP port, named session, target identity verified): 5/5 PASS. Evidence comment above. The number this PR existed to settle: on merged What is not verified, stated plainly:
Relationship to #16206: that PR made the Filters panel wheel-scrollable for the first time, which is what exposed this pre-existing race from #14629. #16206 was merged but had not shipped in any tagged release, so this lands before either reaches users. |
* fix(popover): use non-passive wheel listener * fix(popover): preserve wheel handler cancellation and ref cleanup * fix(popover): bridge descendant wheel cancellation (cherry picked from commit b55836d)
* fix(popover): use non-passive wheel listener * fix(popover): preserve wheel handler cancellation and ref cleanup * fix(popover): bridge descendant wheel cancellation
* fix(popover): use non-passive wheel listener * fix(popover): preserve wheel handler cancellation and ref cleanup * fix(popover): bridge descendant wheel cancellation










Summary
Validation
pnpm run typechecknpx oxlint src/renderer/src/components/ui src/renderer/src/components/cmd-jpnpm run audit:code-quality:type-awarepnpm run lint:react-doctor:changedpnpm run verify:localization-catalognpx vitest run --config config/vitest.config.ts src/renderer/src/components/ui/popover-wheel-scroll.test.tsx src/renderer/src/components/cmd-j/palette-filter-option-list.test.tsElectron input validation remains to be run on the pushed branch.