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: copy and cut autocapture #1047

Merged
merged 14 commits into from
Mar 5, 2024
Merged

feat: copy and cut autocapture #1047

merged 14 commits into from
Mar 5, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Mar 1, 2024

More than once a user has said it would be useful for them if we autocaptured people selecting text on the page

on testing it we found that selecting text would be noisy. we had to debounce events to avoid triggering multiple events even in the simple case

Worse if someone holds down CTRL and SHIFT then every 500ms hits left arrow until they've selected 100 characters, should we capture 100 events, or wait N seconds and risk missing the event

but we can listen to cut and copy events, and they're concrete, it did or didn't fire

you can't read the clipboard directly but we can get the selection from the window when we see a cut/copy event. If there's selected text then we assume that's what the user just copied

it's implemented as an extension to autocapture so we get all the allow and denylist functionality "for free"

2024-03-04 21 01 20

Copy link

github-actions bot commented Mar 1, 2024

Size Change: +2.68 kB (0%)

Total Size: 864 kB

Filename Size Change
dist/array.full.js 186 kB +677 B (0%)
dist/array.js 127 kB +669 B (+1%)
dist/es.js 127 kB +669 B (+1%)
dist/module.js 127 kB +669 B (+1%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12 kB
dist/recorder-v2.js 106 kB
dist/recorder.js 58.6 kB
dist/surveys-module-previews.js 62 kB
dist/surveys.js 58.3 kB

compressed-size-action

@pauldambra pauldambra requested a review from daibhin March 1, 2024 14:41
@pauldambra
Copy link
Member Author

this is very early @daibhin but I'm interested for your subconscious to chew on it :)

Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

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

Will think about it a bit more but overall think it's pretty neat. Would never have guessed it was as possible and feels like it could be useful in some niche cases

src/extensions/selection-autocapture.ts Outdated Show resolved Hide resolved
src/extensions/selection-autocapture.ts Outdated Show resolved Hide resolved
@pauldambra pauldambra marked this pull request as ready for review March 4, 2024 21:08
@pauldambra pauldambra added the bump minor Bump minor version when this PR gets merged label Mar 4, 2024
@pauldambra pauldambra requested a review from daibhin March 4, 2024 21:14
@pauldambra pauldambra changed the title feat: selection autocapture spike feat: copy and cut autocapture Mar 4, 2024
@pauldambra
Copy link
Member Author

see PostHog/posthog#20700

@pauldambra pauldambra merged commit 0f58ea7 into main Mar 5, 2024
13 checks passed
@pauldambra pauldambra deleted the feat/selection-autocapture branch March 5, 2024 10:25
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