Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deadclicks in heatmaps #1510

Merged
merged 15 commits into from
Nov 12, 2024
Merged

feat: deadclicks in heatmaps #1510

merged 15 commits into from
Nov 12, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Nov 3, 2024

we want to allow deadclicks collection in heatmaps

it gives you less information but doesn't cost money, folk that want more information can turn on standalone deadclicks capture

to keep things loose the heatmap starts its own instance of deadclicks capture, deadclicks was altered to receive varying behviour by constructor injection


running locally I can capture deadclicks correctly with both deadclicks and heatmaps enabled or either one enabled

Copy link

vercel bot commented Nov 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 8, 2024 8:32pm

Copy link

github-actions bot commented Nov 3, 2024

Size Change: +4.78 kB (+0.16%)

Total Size: 3.01 MB

Filename Size Change
dist/all-external-dependencies.js 193 kB +202 B (+0.1%)
dist/array.full.es5.js 252 kB +380 B (+0.15%)
dist/array.full.js 342 kB +542 B (+0.16%)
dist/array.full.no-external.js 342 kB +542 B (+0.16%)
dist/array.js 169 kB +366 B (+0.22%)
dist/array.no-external.js 168 kB +366 B (+0.22%)
dist/dead-clicks-autocapture.js 13 kB +202 B (+1.58%)
dist/main.js 169 kB +366 B (+0.22%)
dist/module.full.js 342 kB +542 B (+0.16%)
dist/module.full.no-external.js 341 kB +542 B (+0.16%)
dist/module.js 169 kB +366 B (+0.22%)
dist/module.no-external.js 168 kB +366 B (+0.22%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 8.8 kB
dist/external-scripts-loader.js 2.19 kB
dist/recorder-v2.js 102 kB
dist/recorder.js 103 kB
dist/surveys-preview.js 56.7 kB
dist/surveys.js 62.1 kB
dist/tracing-headers.js 1.33 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

@pauldambra pauldambra marked this pull request as ready for review November 5, 2024 11:44

export function isElementInToolbar(el: Element): boolean {
// NOTE: .closest is not supported in IE11 hence the operator check
return el.id === TOOLBAR_ID || !!el.closest?.('#' + TOOLBAR_ID)
Copy link
Member Author

Choose a reason for hiding this comment

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

this was only working previously by accident because there is also ph-no-capture which autocapture obeys

closest does not escape shadow roots and TOOLBAR_ID is outside the shadow root.

switched to a selector inside the shadow root (the selector provided is at the root of the toolbar inside the shadow root

e.g.

<div id="TOOLBAR_ID">
    <shadow_root>
       <div class=TOOLBAR_CONTAINER_CLASS>

@pauldambra pauldambra requested a review from a team November 8, 2024 20:34
@pauldambra pauldambra added the bump minor Bump minor version when this PR gets merged label Nov 12, 2024
@pauldambra pauldambra merged commit 838e83a into main Nov 12, 2024
17 checks passed
@pauldambra pauldambra deleted the feat/deadmaps branch November 12, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants