Skip to content

Comments

Shadow Clicks#1445

Merged
korgon merged 3 commits intodevelopfrom
shadow-clicks
Feb 18, 2026
Merged

Shadow Clicks#1445
korgon merged 3 commits intodevelopfrom
shadow-clicks

Conversation

@korgon
Copy link
Contributor

@korgon korgon commented Feb 12, 2026

  • tracking clickthrough events originating from the shadows

@korgon korgon requested review from Copilot and dkonieczek February 12, 2026 19:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates clickthrough detection to correctly handle events originating within Shadow DOM by using the event’s composed path, with accompanying test updates.

Changes:

  • Switch link-detection traversal from parentElement walking to MouseEvent.composedPath() traversal (Shadow DOM aware).
  • Limit traversal depth using CLICK_THROUGH_CLOSEST_MAX_LEVELS over the composed path.
  • Update and extend unit tests to mock composedPath(), including Shadow DOM and fallback behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/snap-controller/src/utils/isClickWithinProductLink.ts Uses composedPath() to detect product-link clicks through Shadow DOM boundaries.
packages/snap-controller/src/utils/isClickWithinProductLink.test.ts Adjusts tests to mock composedPath() and adds Shadow DOM + fallback coverage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
dkonieczek
dkonieczek previously approved these changes Feb 12, 2026
@korgon korgon merged commit 19d3530 into develop Feb 18, 2026
1 check passed
@korgon korgon deleted the shadow-clicks branch February 18, 2026 21:37
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.

2 participants