@@ -31,7 +31,6 @@ import DBRowSidePanelHeader, {
3131import useResizable from '@/hooks/useResizable' ;
3232import { WithClause } from '@/hooks/useRowWhere' ;
3333import useWaterfallSearchState from '@/hooks/useWaterfallSearchState' ;
34- import { LogSidePanelKbdShortcuts } from '@/LogSidePanelElements' ;
3534import { getEventBody } from '@/source' ;
3635import TabBar from '@/TabBar' ;
3736import { SearchConfig } from '@/types' ;
@@ -41,11 +40,11 @@ import { useZIndex, ZIndexContext } from '@/zIndex';
4140import ServiceMapSidePanel from './ServiceMap/ServiceMapSidePanel' ;
4241import ContextSubpanel from './ContextSidePanel' ;
4342import DBInfraPanel from './DBInfraPanel' ;
44- import { RowDataPanel , useRowData } from './DBRowDataPanel' ;
43+ import { RowDataPanel , rowHasK8sContext , useRowData } from './DBRowDataPanel' ;
4544import { RowOverviewPanel } from './DBRowOverviewPanel' ;
4645import { DBSessionPanel , useSessionId } from './DBSessionPanel' ;
4746import DBTracePanel from './DBTracePanel' ;
48- import { getInitialDrawerWidthPercent } from './DrawerUtils' ;
47+ import { INITIAL_DRAWER_WIDTH_PERCENT } from './DrawerUtils' ;
4948
5049import styles from '@/../styles/LogSidePanel.module.scss' ;
5150
@@ -289,26 +288,10 @@ const DBRowSidePanel = ({
289288 enabled : rowId != null ,
290289 } ) ;
291290
292- const hasK8sContext = useMemo ( ( ) => {
293- try {
294- if (
295- ! ( 'resourceAttributesExpression' in source ) ||
296- ! source ?. resourceAttributesExpression ||
297- ! normalizedRow
298- ) {
299- return false ;
300- }
301-
302- const resourceAttrs = normalizedRow [ '__hdx_resource_attributes' ] ;
303- return (
304- resourceAttrs ?. [ 'k8s.pod.uid' ] != null ||
305- resourceAttrs ?. [ 'k8s.node.name' ] != null
306- ) ;
307- } catch ( e ) {
308- console . error ( e ) ;
309- return false ;
310- }
311- } , [ source , normalizedRow ] ) ;
291+ const hasK8sContext = useMemo (
292+ ( ) => rowHasK8sContext ( source , normalizedRow ) ,
293+ [ source , normalizedRow ] ,
294+ ) ;
312295
313296 const initialRowHighlightHint = useMemo ( ( ) => {
314297 if ( normalizedRow ) {
@@ -554,7 +537,6 @@ const DBRowSidePanel = ({
554537 </ Box >
555538 </ ErrorBoundary >
556539 ) }
557- < LogSidePanelKbdShortcuts />
558540 </ >
559541 ) ;
560542} ;
@@ -572,12 +554,12 @@ export default function DBRowSidePanelErrorBoundary({
572554 const drawerZIndex = contextZIndex + 10 ;
573555
574556 const { size, setSize, startResize } = useResizable (
575- getInitialDrawerWidthPercent ( ) ,
557+ INITIAL_DRAWER_WIDTH_PERCENT ,
576558 ) ;
577559
578560 const isFullWidth = size >= 99 ;
579561 const toggleFullWidth = useCallback ( ( ) => {
580- setSize ( isFullWidth ? getInitialDrawerWidthPercent ( ) : 100 ) ;
562+ setSize ( isFullWidth ? INITIAL_DRAWER_WIDTH_PERCENT : 100 ) ;
581563 } , [ isFullWidth , setSize ] ) ;
582564
583565 // Keep track of sub-drawers so we can disable closing this root drawer
0 commit comments