fix(ui): jump to first event in session automatically
This commit is contained in:
parent
cf728eb310
commit
848520790b
6 changed files with 20 additions and 2 deletions
|
|
@ -84,6 +84,10 @@ function WebPlayer(props: any) {
|
|||
if (activeTab === '' && !showNoteModal && isPlayerReady) {
|
||||
contextValue.player && contextValue.player.play()
|
||||
}
|
||||
const visualOffset = contextValue.player?.checkVisualOffset?.() || 0
|
||||
if (visualOffset !== 0) {
|
||||
contextValue.player.jump(visualOffset)
|
||||
}
|
||||
}, [activeTab, isPlayerReady, showNoteModal])
|
||||
|
||||
// LAYOUT (TODO: local layout state - useContext or something..)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export function createWebPlayer(session: Record<string, any>, wrapStore?: (s:IWe
|
|||
}
|
||||
|
||||
const player = new WebPlayer(store, session, false)
|
||||
window.__or_player = player;
|
||||
return [player, store]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ export default class MessageManager {
|
|||
private sessionStart: number;
|
||||
private navigationStartOffset: number = 0;
|
||||
private lastMessageTime: number = 0;
|
||||
public firstVisualEvent: number = 0;
|
||||
|
||||
constructor(
|
||||
private readonly session: any /*Session*/,
|
||||
|
|
@ -467,6 +468,7 @@ export default class MessageManager {
|
|||
default:
|
||||
switch (msg.tp) {
|
||||
case MType.CreateDocument:
|
||||
if (this.firstVisualEvent === 0) this.firstVisualEvent = msg.time;
|
||||
this.windowNodeCounter.reset();
|
||||
this.performanceTrackManager.setCurrentNodesCount(this.windowNodeCounter.count);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ export default class WebPlayer extends Player {
|
|||
|
||||
// @ts-ignore
|
||||
window.playerJumpToTime = this.jump.bind(this)
|
||||
|
||||
}
|
||||
|
||||
updateLists = (session: any) => {
|
||||
|
|
@ -147,6 +146,10 @@ export default class WebPlayer extends Player {
|
|||
this.screen.cursor.showTag(name)
|
||||
}
|
||||
|
||||
checkVisualOffset = () => {
|
||||
return this.messageManager.firstVisualEvent
|
||||
}
|
||||
|
||||
clean = () => {
|
||||
super.clean()
|
||||
this.screen.clean()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
# 6.0.1
|
||||
|
||||
- fix webworker writer re-init request
|
||||
- remove useless logs
|
||||
|
||||
# 6.0.0
|
||||
|
||||
**(Compatible with OpenReplay v1.11.0+ only)**
|
||||
|
||||
- **[breaking]:** Capture mouse thrashing, input hesitation+duration, click hesitation
|
||||
- Capture DOM node drop event (>30% nodes removed)
|
||||
- Capture iframe network requests
|
||||
|
|
@ -18,7 +25,9 @@
|
|||
- Use `@medv/finder` instead of our own implementation of `getSelector` for better clickmaps experience
|
||||
|
||||
## 5.0.0
|
||||
|
||||
**(Compatible with OpenReplay v1.10.0+ only)**
|
||||
|
||||
- **[breaking]:** string dictionary to reduce session size
|
||||
- Added "tel" to supported input types
|
||||
- Added `{ withCurrentTime: true }` to `tracker.getSessionURL` method which will return sessionURL with current session's timestamp
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ export default function (app: App, options?: MouseHandlerOptions): void {
|
|||
|
||||
const acceleration = (nextVelocity - velocity) / shakeCheckInterval
|
||||
if (directionChangeCount > 3 && acceleration > shakeThreshold) {
|
||||
console.log('Mouse shake detected!')
|
||||
app.send(MouseThrashing(now()))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue