sarutak opened a new pull request, #56694:
URL: https://github.com/apache/spark/pull/56694

   ### What changes were proposed in this pull request?
   
   Require Ctrl (or Cmd on macOS) + scroll wheel to zoom the SQL plan DAG on 
the `/SQL/execution` page. Unmodified scroll gestures now pass through for 
normal page scrolling.
   
   Additionally, a transient overlay hint ("⌘ + scroll to zoom" on Mac, "Ctrl + 
scroll to zoom" otherwise) is shown when the user scrolls without the modifier 
key, following the same UX pattern as Google Maps.
   
   ### Why are the changes needed?
   
   The DAG visualization occupies a 70vh viewport and captures all wheel events 
for zoom via d3-zoom. This makes it nearly impossible to scroll past the DAG 
without moving the cursor to the narrow margins on either side of the graph 
area. The problem is especially pronounced on pages with additional content 
below the DAG (e.g., when a node detail panel is not open).
   
   ### How does this fix work?
   1. Added a `wheel` event type check in the `d3.zoom().filter()` to reject 
unmodified wheel events.
   2. After `svg.call(planVizZoom)`, the d3-zoom wheel listener (registered 
with `{passive: false}`) is detached and replaced with a custom wrapper that 
only forwards Ctrl/Cmd+wheel to the original d3 handler. This ensures the 
browser's native scrolling is never blocked by d3's non-passive listener 
registration.
   3. A CSS-animated hint overlay is shown on unmodified scroll to inform users 
how to zoom.
   
   Notes:
   - Trackpad pinch-to-zoom still works because browsers synthesize pinch 
gestures as `wheel` events with `ctrlKey: true`.
   - Drag-to-pan behavior is unchanged.
   - The `+`/`-` toolbar buttons and keyboard shortcuts continue to work as 
before.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. Wheel-zoom on the SQL plan DAG now requires holding Ctrl (Cmd on Mac). 
Plain scroll gestures scroll the page. A hint overlay guides users to the new 
behavior.
   
   ### How was this patch tested?
   
   Manual testing with Chrome and Safari on macOS:
   - Verified unmodified scroll scrolls the page past the DAG
   - Verified Ctrl+scroll zooms the DAG
   - Verified trackpad pinch zooms the DAG
   - Verified drag-to-pan works as before
   - Verified hint overlay appears and fades after 1.5 seconds
   - Verified toolbar +/- buttons and keyboard shortcuts still work
   
   
   
https://github.com/user-attachments/assets/f2b856c5-9cb4-4128-bd60-df5990af47bb
   
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Kiro CLI / Claude


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to