-
Notifications
You must be signed in to change notification settings - Fork 125
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: dead click detection #1463
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +46.6 kB (+1.58%) Total Size: 3.01 MB
ℹ️ View Unchanged
|
import { uuidv7 } from '../../uuidv7' | ||
import { DeadClicksAutocapture } from '../../extensions/dead-clicks-autocapture' | ||
|
||
describe('DeadClicksAutocapture', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this outer wrapper delegates entirely to the lazy loaded one so we can test it interacts with a mock as desired and ignore the behaviour
src/autocapture.ts
Outdated
@@ -37,6 +37,202 @@ function limitText(length: number, text: string): string { | |||
return text | |||
} | |||
|
|||
export function getAugmentPropertiesFromElement(elem: Element): Properties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bunch of functions move out of the class so we can use them directly because they (mostly) don't rely on state of the class
it should help with bundle size a tiny bit since the names are now minifiable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look at the implentation of the dead click detection tooooo closely but did a general pass through and I think the approach and changes all look good
We autocapture valid webpage interactions
But some people will want to autocapture invalid interactions
for example in some places in posthog these "i" icons are clickable in others they aren't
deadclick autocapture lets you detect clicks that are not followed by scroll or DOM mutation, so you can see if folk are clicking things thinking something will happen and nothing happens
## Needs