Improve framework event filtering

Summary: Now when entering framework event table from a tree root we filter that so you can see all tree events. Also we use exact matches to avoid and nasty substring bugs

Reviewed By: lblasa

Differential Revision: D48560169

fbshipit-source-id: 1df375a2b8c5035003d82c210b55adebda8bd4ec
This commit is contained in:
Luke De Feo
2023-08-23 01:51:31 -07:00
committed by Facebook GitHub Bot
parent 206ef79cf9
commit 7d9744b8ff
5 changed files with 41 additions and 17 deletions

View File

@@ -24,7 +24,14 @@ import {formatDuration, formatTimestampMillis} from '../utils/timeUtils';
import {eventTypeToName} from './sidebar/inspector/FrameworkEventsInspector';
import {startCase} from 'lodash';
export function FrameworkEventsTable({nodeId}: {nodeId: Id; nodes: NodeMap}) {
export function FrameworkEventsTable({
nodeId,
isTree,
}: {
nodeId: Id;
nodes: NodeMap;
isTree: boolean;
}) {
const instance = usePlugin(plugin);
const managerRef = useRef<DataTableManager<AugmentedFrameworkEvent> | null>(
@@ -34,9 +41,17 @@ export function FrameworkEventsTable({nodeId}: {nodeId: Id; nodes: NodeMap}) {
useEffect(() => {
if (nodeId != null) {
managerRef.current?.resetFilters();
managerRef.current?.addColumnFilter('nodeId', nodeId as string);
if (isTree) {
managerRef.current?.addColumnFilter('treeId', nodeId as string, {
exact: true,
});
} else {
managerRef.current?.addColumnFilter('nodeId', nodeId as string, {
exact: true,
});
}
}
}, [nodeId]);
}, [isTree, nodeId]);
return (
<Layout.Container grow>