From 87775e794d08d7dee744cc2085802c19716c3df9 Mon Sep 17 00:00:00 2001 From: Abdullah Khan Date: Sat, 6 Dec 2025 14:08:24 -0500 Subject: [PATCH] feat(trace-tree-node): Mitigating txn node type guards usage --- .../views/insights/agents/components/aiSpanList.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/static/app/views/insights/agents/components/aiSpanList.tsx b/static/app/views/insights/agents/components/aiSpanList.tsx index 99fa166af38a9c..015a150bbba31d 100644 --- a/static/app/views/insights/agents/components/aiSpanList.tsx +++ b/static/app/views/insights/agents/components/aiSpanList.tsx @@ -22,7 +22,6 @@ import { } from 'sentry/views/insights/agents/utils/query'; import type {AITraceSpanNode} from 'sentry/views/insights/agents/utils/types'; import {SpanFields} from 'sentry/views/insights/types'; -import {isTransactionNode} from 'sentry/views/performance/newTraceDetails/traceGuards'; import type {EapSpanNode} from 'sentry/views/performance/newTraceDetails/traceModels/traceTreeNode/eapSpanNode'; import type {TransactionNode} from 'sentry/views/performance/newTraceDetails/traceModels/traceTreeNode/transactionNode'; @@ -266,12 +265,6 @@ function getNodeInfo(node: AITraceSpanNode, colors: readonly string[]) { color: colors[1], }; - if (isTransactionNode(node)) { - nodeInfo.title = node.value.transaction || 'Transaction'; - nodeInfo.subtitle = node.value['transaction.op'] || ''; - return nodeInfo; - } - const op = node.op ?? 'default'; const truncatedOp = op.startsWith('gen_ai.') ? op.slice(7) : op; nodeInfo.title = truncatedOp; @@ -328,10 +321,10 @@ function getNodeInfo(node: AITraceSpanNode, colors: readonly string[]) { nodeInfo.color = colors[5]; } else if (getIsHandoffSpan({op})) { nodeInfo.icon = ; - nodeInfo.subtitle = node.value.description || ''; + nodeInfo.subtitle = node.description || ''; nodeInfo.color = colors[4]; } else { - nodeInfo.subtitle = node.value.description || ''; + nodeInfo.subtitle = node.description || ''; } // Override the color and icon if the node has errors