-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
The desktop pointer cursor is not representative of mobile #662
The desktop pointer cursor is not representative of mobile #662
Conversation
4dd1bbd
to
97d42a0
Compare
…to index.ts from machine.ts (so they can be dealt with in bulk)
…o the last position so that it's in the correct place when the timer starts - previous `needCastInSyncMode` added in 4bf533a meant that the isSync versions of MouseMove/TouchMove were being accidentally ignored - each synchronous MouseMove would have resulted in a separate mouse position update - the Click/TouchStart/TouchEnd events didn't have an async version
97d42a0
to
44de72b
Compare
… on a mobile device. Instead, check a recording for any presence of a Touch event, and switch to a touch visualisation mode for the entire recording. (for now, we use this mode even for mixed touch/mouse devices - this could be improved upon in future) Show a round circle representing the users' finger which is visible only between TouchStart and TouchEnd events Again this can be evolved upon, but this change should be a good start in the right direction.
… as user can lift finger off screen and place elsewhere; however we can now have much smoother touch movement during the .touch-active phase as we know the finger is on the screen. This has a .25s delaying effect on the touch position which IMO is acceptable; e.g. scroll position can lag behind a touch movement and this seems to bring them more in sync
…f synchronous events
44de72b
to
72bf5e1
Compare
…n user has lifted their finger and placed it into a new position. This is apparent in a replay session where the user is scrolling the page using repeated TouchMove bottom-to-top movements
packages/rrweb/src/replay/index.ts
Outdated
@@ -115,6 +123,8 @@ export class Replayer { | |||
|
|||
private newDocumentQueue: addedNodeMutation[] = []; | |||
|
|||
private mouseState: mouseState | null = null; |
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.
The code to maintain this state looks a bit complex. Is it possible to use a getter to compute whenever need?
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.
It's supposed to be a lightweight object to hold mouse x/y and whether touch is active or not. The extra id
(and debugData) is for moveAndHover
.
It's only relevant during application of 'sync' events, to maintain a record of the last change to mouse state, and is cleared after each batch.
I'm not sure what a getter would achieve?
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.
Ok actually some of the complexity comes from me trying to wrap two separate things into the same state object. I've separated them out in 5606987 and this should make things clearer.
…into their own global vars
Good Job! |
The desktop pointer cursor is not representative of what is happening on a mobile device.
Instead, check a recording for any presence of a Touch event, and switch to a touch visualisation mode for the entire recording.
(for now, we use this mode even for mixed touch/mouse devices - this could be improved upon in future)
Show a round circle representing the users' finger which is visible only between TouchStart and TouchEnd events
Again this can be evolved upon, but this change should be a good start in the right direction.