ui: fix events filtering, net panel scroll and default tab
This commit is contained in:
parent
586472c7dd
commit
c003057cf0
3 changed files with 25 additions and 10 deletions
|
|
@ -38,8 +38,8 @@ function WebPlayer(props: any) {
|
||||||
uxtestingStore,
|
uxtestingStore,
|
||||||
uiPlayerStore,
|
uiPlayerStore,
|
||||||
integrationsStore,
|
integrationsStore,
|
||||||
userStore,
|
|
||||||
} = useStore();
|
} = useStore();
|
||||||
|
const devTools = sessionStore.devTools
|
||||||
const session = sessionStore.current;
|
const session = sessionStore.current;
|
||||||
const { prefetched } = sessionStore;
|
const { prefetched } = sessionStore;
|
||||||
const startedAt = sessionStore.current.startedAt || 0;
|
const startedAt = sessionStore.current.startedAt || 0;
|
||||||
|
|
@ -66,6 +66,10 @@ function WebPlayer(props: any) {
|
||||||
};
|
};
|
||||||
document.addEventListener('visibilitychange', handleActivation);
|
document.addEventListener('visibilitychange', handleActivation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
devTools.update('network', { activeTab: 'ALL' });
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -85,19 +85,30 @@ function EventsBlock(props: IProps) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const eventsWithMobxNotes = [...notesWithEvents, ...notes].sort(sortEvents);
|
const eventsWithMobxNotes = [...notesWithEvents, ...notes]
|
||||||
return mergeEventLists(
|
.sort(sortEvents);
|
||||||
filteredLength > 0 ? filteredEvents : eventsWithMobxNotes,
|
const filteredTabEvents = query.length
|
||||||
tabChangeEvents,
|
? tabChangeEvents
|
||||||
).filter((e) =>
|
.filter((e => (e.activeUrl as string).includes(query)))
|
||||||
zoomEnabled
|
: tabChangeEvents;
|
||||||
|
const list = mergeEventLists(
|
||||||
|
query.length > 0 ? filteredEvents : eventsWithMobxNotes,
|
||||||
|
filteredTabEvents
|
||||||
|
)
|
||||||
|
if (zoomEnabled) {
|
||||||
|
return list.filter((e) =>
|
||||||
|
zoomEnabled
|
||||||
? 'time' in e
|
? 'time' in e
|
||||||
? e.time >= zoomStartTs && e.time <= zoomEndTs
|
? e.time >= zoomStartTs && e.time <= zoomEndTs
|
||||||
: false
|
: false
|
||||||
: true,
|
: true
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
return list
|
||||||
|
}
|
||||||
}, [
|
}, [
|
||||||
filteredLength,
|
filteredLength,
|
||||||
|
query,
|
||||||
notesWithEvtsLength,
|
notesWithEvtsLength,
|
||||||
notesLength,
|
notesLength,
|
||||||
zoomEnabled,
|
zoomEnabled,
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ function TimeTable(props: Props) {
|
||||||
]);
|
]);
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (props.activeIndex && props.activeIndex >= 0 && scroller.current) {
|
if (props.activeIndex && props.activeIndex >= 0 && scroller.current) {
|
||||||
scroller.current.scrollToIndex(props.activeIndex);
|
scroller.current.scrollToIndex(props.activeIndex, { align: 'center', smooth: false });
|
||||||
setFirstVisibleRowIndex(props.activeIndex ?? 0);
|
setFirstVisibleRowIndex(props.activeIndex ?? 0);
|
||||||
}
|
}
|
||||||
}, [props.activeIndex]);
|
}, [props.activeIndex]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue