Repository navigation
Fixes #36496: Drill into the node under the fingers on a lineage map pinch - #38772
Conversation
pickZoomTargetNode resolved the point under the gesture only for events with clientX. A pinch arrives as a TouchEvent, which has none, so every pinch fell through to the nearest-to-centre fallback and drilled into whatever drillable node sat near the middle of the canvas. Resolve the pinch to the midpoint of the touches (the changed touches once all fingers lift).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
UI browser testsRan: 2 of 135 test files execute the changed code Result: ✅ 4 passed · 0 skipped Changed code executed by these browser tests: 1 / 10 lines (10%)
|
Code Review ✅ Approved 🟡 Medium riskUsing the touch midpoint for lineage-map pinch targeting changes navigation behavior; incorrect coordinates could drill users into an unintended node. Fixes pinch-zoom drill-down on the lineage map by resolving the gesture point from touch events, so a pinch now targets the node under the fingers instead of an unrelated node near the canvas centre. Adds a VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Not backported to
|
…#38772) (#38840) pickZoomTargetNode resolved the point under the gesture only for events with clientX. A pinch arrives as a TouchEvent, which has none, so every pinch fell through to the nearest-to-centre fallback and drilled into whatever drillable node sat near the middle of the canvas. Resolve the pinch to the midpoint of the touches (the changed touches once all fingers lift). (cherry picked from commit 12bba3e) Co-authored-by: Harsh Vador <58542468+harsh-vador@users.noreply.github.com>
Describe your changes:
Fixes #36496
The lineage map's semantic zoom picks the node to drill into with
pickZoomTargetNode. Its comment says it uses "the one under the pointer for wheel and pinch", but it only resolved a point when the event hadclientX. React Flow forwards d3-zoom'ssourceEvent, and a pinch arrives as aTouchEvent, which has noclientX. So every pinch fell through to the "selected node, else nearest drillable node to the canvas centre" fallback and, after the 250 ms settle, drilled into an unrelated node near the middle of the canvas.getZoomGesturePoint(LineageMap.utils.ts): the pointer for a wheel/mouse event; for a touch event, the midpoint oftouches(d3-zoom's pinch focal point), or ofchangedTouchesonce every finger has lifted;undefinedotherwise.pickZoomTargetNodeuses it, so wheel behaves as before and a pinch now targets the node under the fingers. Button and keyboard zoom (no event) still use the centre fallback.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
undefined(centre fallback).Unit tests
LineageMap.utils.test.ts: newzoom gesture pointsuite (4 tests).npx jest src/components/Lineage/LineageMap→ 105 passed.Backend integration tests
Playwright (UI) tests
Manual testing performed
None; verified with unit tests. ESLint (0 errors), Prettier and
tscclean on the changed files.🤖 Generated with Claude Code