The desktop pointer cursor is not representative of mobile#662
The desktop pointer cursor is not representative of mobile#662Yuyz0112 merged 8 commits intorrweb-io:masterfrom
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
|
|
||
| private newDocumentQueue: addedNodeMutation[] = []; | ||
|
|
||
| private mouseState: mouseState | null = null; |
There was a problem hiding this comment.
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.
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.
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.