-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add userTriggered
#495
Add userTriggered
#495
Conversation
Thanks, @Juice10 ! Things I'm thinking about
|
Because this also covers events for radio buttons that get automatically get unselected when you click on a different radio button. I believe technically ‘isTrusted’ would be true in this case. (But I could be wrong and then ‘isTrusted’ would be a perfect name for it.)
Could you elaborate a bit on how you’d like the plug-in system to work? I’m guessing you’d want something more elaborate than a simple config flag to toggle this data collection on and off. |
I'd say that in the context of a replayer, there may be cases where you'd want to have a visual effect when you know an event was performed by the user vs. otherwise. |
@Yuyz0112 I talked to Justin about this today. |
@Yuyz0112 I'd be happy to, will let you know when its done! |
…o user-triggered
@eoghanmurray @Yuyz0112 I added userTriggered behind the |
The code looks good to me. Not sure why there is some code diff from other commits. |
@Yuyz0112 ah I think that's because I did a git rebase. |
@Yuyz0112 fixed it, the diff should be correct now on this PR |
@Juice10 So we only apply this to input event, but not to other events like mouse interactions? |
@Yuyz0112 yes thats correct |
@Yuyz0112 Im happy to implement this for mouse as well later on, once I've found some good ways of replicating it. |
@@ -115,6 +115,7 @@ export class Replayer { | |||
triggerFocus: true, | |||
UNSAFE_replayCanvas: false, | |||
pauseAnimation: true, | |||
userTriggeredOnInput: true, |
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.
@Juice10 I found this option doesn't perform any work in the replay part. Did I miss something?
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.
Good catch @Mark-Fenng! It should only be on the recording end. I'm going to remove it on the replayer today.
What does userTriggered indicate?
userTriggered
gets added to input events that indicates if this event was triggered directly by the user or not.Example of
userTriggered
in action: User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)Background:
When analysing RRweb events I was having a hard time trying to figure out if an event was directly generated by a user or not. This PR adds a notation to indicate wherever this was the case or not.
Naming considerations: I was doubting if userTriggered or isTrusted was the right name for this attribute. But since isTrusted doesn't completely cover all the cases I thought
userTriggered
might be a better name.