ui: fix LAT mapping

This commit is contained in:
nick-delirium 2025-04-03 17:14:59 +02:00
parent c37b27d1d2
commit 1f824502be
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
4 changed files with 8 additions and 5 deletions

View file

@ -27,8 +27,9 @@ function LongTaskPanel() {
const [searchValue, setSearchValue] = React.useState('');
const { currentTab, tabStates } = store.get();
const longTasks: LongAnimationTask[] = mockData; //tabStates[currentTab]?.longTasksList || [];
const longTasks = tabStates[currentTab]?.longTaskList || [];
console.log('list', longTasks)
const filteredList = useRegExListFilterMemo(
longTasks,
(task: LongAnimationTask) => [

View file

@ -15,6 +15,7 @@ import {
} from 'Player/web/messages';
import ListWalker from '../common/ListWalker';
import ListWalkerWithMarks from '../common/ListWalkerWithMarks';
import { ILongAnimationTask } from './types/longTask';
type stackMsg = {
name: string;
@ -44,7 +45,7 @@ type MsgTypeMap = {
profilerList: profilerMsg;
exceptionsList: exceptionsMsg;
frustrationsList: Issue | InjectedEvent;
longTaskList: longTaskMsg;
longTaskList: ILongAnimationTask;
};
type ListMessageType<K> = K extends keyof MsgTypeMap
? Array<MsgTypeMap[K]>

View file

@ -33,6 +33,7 @@ import { TYPES as EVENT_TYPES } from 'Types/session/event';
import { Decoder } from 'syncod';
import type { PerformanceChartPoint } from './managers/PerformanceTrackManager';
import { getLongTask } from './types/longTask';
export interface TabState extends ListsState {
performanceAvailability?: PerformanceTrackManager['availability'];
@ -338,7 +339,7 @@ export default class TabSessionManager {
this.lists.lists.profiles.append(msg);
break;
case MType.LongAnimationTask:
this.lists.lists.longTask.append(msg);
this.lists.lists.longTask.append(getLongTask(msg));
break;
/* ===|=== */
default:

View file

@ -27,7 +27,7 @@ export interface LATOptions {
}
export default function (app: App, opts: Partial<LATOptions>): void {
if (!opts.longTasks || !('PerformanceObserver' in window) || !('LongTaskObserver' in window)) {
if (!opts.longTasks || !('PerformanceObserver' in window)) {
return;
}
const onEntry = (entry: LongAnimationTask) => {
@ -58,4 +58,4 @@ export default function (app: App, opts: Partial<LATOptions>): void {
app.attachStopCallback(() => {
observer.disconnect()
})
}
}