diff --git a/desktop/plugins/public/ui-debugger/ClientTypes.tsx b/desktop/plugins/public/ui-debugger/ClientTypes.tsx index 9090c6d23..39348de8f 100644 --- a/desktop/plugins/public/ui-debugger/ClientTypes.tsx +++ b/desktop/plugins/public/ui-debugger/ClientTypes.tsx @@ -55,6 +55,7 @@ type FrameworkEventAttribution = Stacktrace | Reason | UpstreamEvent; export type FrameworkEvent = { id: number; + treeId?: Id; nodeId: Id; type: FrameworkEventType; timestamp: number; @@ -183,7 +184,8 @@ export type Tag = | 'CK' | 'iOS' | 'BloksBoundTree' - | 'BloksDerived'; + | 'BloksDerived' + | 'TreeRoot'; export type Inspectable = | InspectableObject diff --git a/desktop/plugins/public/ui-debugger/components/FrameworkEventsTable.tsx b/desktop/plugins/public/ui-debugger/components/FrameworkEventsTable.tsx index 746cbd606..fd3a6e795 100644 --- a/desktop/plugins/public/ui-debugger/components/FrameworkEventsTable.tsx +++ b/desktop/plugins/public/ui-debugger/components/FrameworkEventsTable.tsx @@ -20,17 +20,17 @@ import {FrameworkEvent, Id} from '../ClientTypes'; import {plugin} from '../index'; import {Button, Tooltip} from 'antd'; -export function FrameworkEventsTable({rootTreeId}: {rootTreeId?: Id}) { +export function FrameworkEventsTable({treeId}: {treeId?: Id}) { const instance = usePlugin(plugin); const managerRef = useRef | null>(null); useEffect(() => { - if (rootTreeId != null) { + if (treeId != null) { managerRef.current?.resetFilters(); - managerRef.current?.addColumnFilter('nodeId', rootTreeId as string); + managerRef.current?.addColumnFilter('treeId', treeId as string); } - }, [rootTreeId]); + }, [treeId]); return ( @@ -59,6 +59,9 @@ const columns: DataTableColumn[] = [ return new Date(row.timestamp).toLocaleTimeString(); }, }, + { + key: 'treeId', + }, { key: 'nodeId', }, diff --git a/desktop/plugins/public/ui-debugger/components/main.tsx b/desktop/plugins/public/ui-debugger/components/main.tsx index 82728bc84..eb35b3560 100644 --- a/desktop/plugins/public/ui-debugger/components/main.tsx +++ b/desktop/plugins/public/ui-debugger/components/main.tsx @@ -101,7 +101,7 @@ export function Component() { } if (viewMode.mode === 'frameworkEventsTable') { - return ; + return ; } return ( diff --git a/desktop/plugins/public/ui-debugger/components/tree/ContextMenu.tsx b/desktop/plugins/public/ui-debugger/components/tree/ContextMenu.tsx index ffd7bcfcf..e6f8fe81b 100644 --- a/desktop/plugins/public/ui-debugger/components/tree/ContextMenu.tsx +++ b/desktop/plugins/public/ui-debugger/components/tree/ContextMenu.tsx @@ -159,38 +159,43 @@ export const ContextMenu: React.FC<{ frameworkEvents.getAllRecordsByIndex({nodeId: hoveredNode.id})) ?? []; - const frameworkEventsTable = matchingFrameworkEvents.length > 0 && ( - { - onSetViewMode({ - mode: 'frameworkEventsTable', - treeRootId: hoveredNode?.id ?? '', - }); - }} - icon={} - /> - ); + const frameworkEventsTable = hoveredNode?.tags.includes('TreeRoot') && + matchingFrameworkEvents.length > 0 && ( + { + onSetViewMode({ + mode: 'frameworkEventsTable', + treeRootId: hoveredNode?.id ?? '', + }); + }} + icon={} + /> + ); return ( { onContextMenuOpen(visible); }} - overlay={() => ( - - {treeCollapseItems} - {focus} - {removeFocus} - {frameworkEventsTable} - {(focus || removeFocus || frameworkEventsTable) && ( - - )} - {copyItems} + overlay={() => { + return ( + + {treeCollapseItems} + {focus} + {removeFocus} + {frameworkEventsTable} + {(focus || removeFocus || frameworkEventsTable) && ( + + )} + {copyItems} - {hoveredNode && } - - )} + {hoveredNode && ( + + )} + + ); + }} trigger={['contextMenu']}> {children}