ui: fix events filtering, net panel scroll and default tab

This commit is contained in:
nick-delirium 2025-04-02 14:40:13 +02:00
parent 586472c7dd
commit c003057cf0
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
3 changed files with 25 additions and 10 deletions

View file

@ -38,8 +38,8 @@ function WebPlayer(props: any) {
uxtestingStore,
uiPlayerStore,
integrationsStore,
userStore,
} = useStore();
const devTools = sessionStore.devTools
const session = sessionStore.current;
const { prefetched } = sessionStore;
const startedAt = sessionStore.current.startedAt || 0;
@ -66,6 +66,10 @@ function WebPlayer(props: any) {
};
document.addEventListener('visibilitychange', handleActivation);
}
return () => {
devTools.update('network', { activeTab: 'ALL' });
}
}, []);
useEffect(() => {

View file

@ -85,19 +85,30 @@ function EventsBlock(props: IProps) {
}
});
}
const eventsWithMobxNotes = [...notesWithEvents, ...notes].sort(sortEvents);
return mergeEventLists(
filteredLength > 0 ? filteredEvents : eventsWithMobxNotes,
tabChangeEvents,
).filter((e) =>
zoomEnabled
const eventsWithMobxNotes = [...notesWithEvents, ...notes]
.sort(sortEvents);
const filteredTabEvents = query.length
? tabChangeEvents
.filter((e => (e.activeUrl as string).includes(query)))
: tabChangeEvents;
const list = mergeEventLists(
query.length > 0 ? filteredEvents : eventsWithMobxNotes,
filteredTabEvents
)
if (zoomEnabled) {
return list.filter((e) =>
zoomEnabled
? 'time' in e
? e.time >= zoomStartTs && e.time <= zoomEndTs
: false
: true,
);
: true
);
} else {
return list
}
}, [
filteredLength,
query,
notesWithEvtsLength,
notesLength,
zoomEnabled,

View file

@ -145,7 +145,7 @@ function TimeTable(props: Props) {
]);
React.useEffect(() => {
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);
}
}, [props.activeIndex]);