diff --git a/packages/web-shared/src/components/new-trace-viewer/components/event-list.tsx b/packages/web-shared/src/components/new-trace-viewer/components/event-list.tsx index 0c2368a41c..973b27bf4f 100644 --- a/packages/web-shared/src/components/new-trace-viewer/components/event-list.tsx +++ b/packages/web-shared/src/components/new-trace-viewer/components/event-list.tsx @@ -1,13 +1,15 @@ import { Circle } from 'lucide-react'; import { cn } from '../../../lib/utils'; import type { Span } from '../../trace-viewer/types'; -import { formatDuration, getHighResInMs } from '../../trace-viewer/util/timing'; +import { formatDuration } from '../../trace-viewer/util/timing'; import { WorkflowIcon, WebhookIcon, SleepIcon, StepForwardIcon, } from '../icons'; +import { getSpanDurationMs } from '../utils'; +import { MiddleTruncate } from './middle-truncate/middle-truncate'; interface EventStyle { icon: React.ComponentType<{ className?: string }>; @@ -26,6 +28,8 @@ const defaultStyle: EventStyle = { className: 'text-gray-900', }; +const ROW_HEIGHT_CLASS = 'h-10'; + function getEventStyle(resource: string, isErrored: boolean): EventStyle { const style = eventStyles[resource] ?? defaultStyle; return { @@ -43,7 +47,7 @@ const EventRow = ({ isSelected: boolean; onSelectSpan: (spanId: string) => void; }) => { - const durationMs = getHighResInMs(span.duration); + const durationMs = getSpanDurationMs(span); const isErrored = (span.attributes.data as Record).status === 'failed'; const { icon: Icon, className: tagClassName } = getEventStyle( @@ -53,24 +57,31 @@ const EventRow = ({ return (
  • onSelectSpan(span.spanId)} > -
    -
    - - - - {span.name} -
    -
    - - {formatDuration(durationMs)} - +
    +
    +
    + + + + + + +
    +
    + + {formatDuration(durationMs)} + +
  • @@ -87,11 +98,7 @@ const EventList = ({ onSelectSpan: (spanId: string) => void; }) => { return ( -