Skip to content

fix: ignore background coordinates for programmatic clicks - #20

Merged
bwin merged 1 commit into
devfrom
fix/background-click
Nov 3, 2026
Merged

bwin merged 1 commit into
devfrom
fix/background-click

Conversation

@bwin

@bwin bwin commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes CONFIRMED-FINDINGS.md item 3: detail-zero clicks on the SVG background fell through to locate(e), whose default clientX/clientY of 0 could hit a subject at the viewport's top-left corner.

  • src/SankeyDiagram.tsx: for detail === 0, resolve a subject only from a [data-flow-subject] control. Background clicks now yield no subject and skip locate.
  • tests/browser/inspection.spec.ts: dispatches a detail-0 click on the SVG background while the coordinates point at a node, asserts no tooltip/emphasis appears, then dispatches a detail-0 click on the node control and asserts inspection opens.
  • CHANGELOG.md: one [Unreleased] / Fixed entry.

Verification

  • npm run format — passed
  • npm run format:check — passed
  • npm run typecheck — passed
  • npm run lint — passed
  • npm test — 152 tests passed
  • npm run build — passed
  • npx playwright test tests/browser/inspection.spec.ts --workers=1 — 3 passed (Chromium)
  • Confirmed the new browser regression fails against the pre-fix source, then passes with the fix.

Notes

Only the focused inspection spec was run to avoid the shared demo server port. No screenshot: this changes programmatic/assistive click semantics, not normal rendered output.

@bwin
bwin merged commit 8fd98b6 into dev Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant