Skip to content

Fixes #36496: Drill into the node under the fingers on a lineage map pinch - #38772

Merged
harsh-vador merged 2 commits into
mainfrom
fix/lineage-pinch-zoom-target
Nov 26, 2026
Merged

harsh-vador merged 2 commits into
mainfrom
fix/lineage-pinch-zoom-target

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 had clientX. React Flow forwards d3-zoom's sourceEvent, and a pinch arrives as a TouchEvent, which has no clientX. 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.

  • New pure helper getZoomGesturePoint (LineageMap.utils.ts): the pointer for a wheel/mouse event; for a touch event, the midpoint of touches (d3-zoom's pinch focal point), or of changedTouches once every finger has lifted; undefined otherwise.
  • pickZoomTargetNode uses 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.
pinch

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Wheel/mouse event → pointer position (unchanged behaviour).
  • Two-finger pinch → midpoint of the fingers.
  • Touch event with no remaining touches → midpoint of the lifted fingers.
  • No event, or a touch event with no touches → undefined (centre fallback).

Unit tests

  • I added unit tests for the new/changed logic.
  • LineageMap.utils.test.ts: new zoom gesture point suite (4 tests).
  • npx jest src/components/Lineage/LineageMap → 105 passed.

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • Not applicable: needs a multi-touch pinch on a touch device; point resolution covered by unit tests.

Manual testing performed

None; verified with unit tests. ESLint (0 errors), Prettier and tsc clean on the changed files.

🤖 Generated with Claude Code

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).
@harsh-vador
harsh-vador requested a review from a team as a code owner November 26, 2026 06:04
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

UI browser tests

Ran: 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%)

File Changed lines Executed %
src/components/Lineage/LineageMap/LineageMap.component.tsx 3 0 0%
src/components/Lineage/LineageMap/LineageMap.utils.ts 7 1 14%

@harsh-vador harsh-vador added safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Nov 26, 2026
@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Using 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 getZoomGesturePoint helper used by pickZoomTargetNode, with wheel behaviour unchanged. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador merged commit 12bba3e into main Nov 26, 2026
43 of 44 checks passed
@harsh-vador
harsh-vador deleted the fix/lineage-pinch-zoom-target branch November 26, 2026 11:05
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.1 opened as #38840 (clean cherry-pick). It merges itself once the checks pass.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Not backported to 2.0. Claude looked at the conflict and declined to resolve it:

Backport aborted: PR #38772 does not apply to 2.0

Source PR

fix(ui): drill into the node under the fingers on a lineage map pinch (#38772)
Merge commit: 12bba3efa26cdb5b458493bc5ef6307534f80a32

Reason

PR #38772 fixes a bug in pickZoomTargetNode inside
openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/,
a scene-graph-based lineage canvas (React Flow + a custom "hierarchical
lineage" scene model) built from LineageMap.component.tsx and
LineageMap.utils.ts.

That entire LineageMap directory does not exist on 2.0. It was
introduced as part of the "Hierarchical lineage" feature work (see
e976bceb33 "Fixes 37678: Hierarchical lineage fixes from 2.1 release
testing"), which only ever landed on the 2.1 line and later branches —
git branch -a --contains e976bceb33 shows origin/2.1, origin/2.1.0,
origin/2.1.1, and various 2.1 backport branches, but not 2.0.

On 2.0, lineage is still rendered by the older
components/Lineage/Lineage.component.tsx, which has no LineageMap
scene model, no pickZoomTargetNode/zoom-gesture resolution logic, and no
touch/pinch handling of the kind this PR fixes. There is no coherent place
to apply this fix without first backporting the entire hierarchical
lineage rewrite, which is far outside the scope of this bug-fix PR.

Action taken

No files were modified. The cherry-pick (12bba3efa26cdb5b458493bc5ef6307534f80a32)
remains in progress with the three paths (LineageMap.component.tsx,
LineageMap.utils.test.ts, LineageMap.utils.ts) marked "deleted by us"
(i.e., absent on 2.0). This backport should be closed/skipped rather than
merged.

resolver run

harsh-vador added a commit that referenced this pull request Nov 27, 2026
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Lineage map pinch-zoom drills into the wrong entity on touch devices

2 participants