From a14a53edbacb24051a31e73e2d111307c2f0354e Mon Sep 17 00:00:00 2001
From: blackhao <13851610112@163.com>
Date: Mon, 8 Dec 2025 19:54:58 -0600
Subject: before file functions

---
 frontend/src/components/nodes/LLMNode.tsx | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

(limited to 'frontend/src/components/nodes/LLMNode.tsx')

diff --git a/frontend/src/components/nodes/LLMNode.tsx b/frontend/src/components/nodes/LLMNode.tsx
index dce1f2e..8105070 100644
--- a/frontend/src/components/nodes/LLMNode.tsx
+++ b/frontend/src/components/nodes/LLMNode.tsx
@@ -263,22 +263,21 @@ const LLMNode = ({ id, data, selected }: NodeProps<NodeData>) => {
           {data.traces && data.traces
             .filter((trace: Trace) => {
               // Only show continue handle if NOT already connected downstream
-              const evolvedTraceId = `${trace.id}_${id}`;
+              // Now that trace IDs don't evolve, we check the base ID
               const hasOutgoingEdge = edges.some(e => 
                 e.source === id && 
-                (e.sourceHandle === `trace-${trace.id}` || e.sourceHandle === `trace-${evolvedTraceId}`)
+                e.sourceHandle === `trace-${trace.id}`
               );
               // Only show dashed handle if not yet connected
               return !hasOutgoingEdge;
             })
             .map((trace: Trace) => {
-              const evolvedTraceId = `${trace.id}_${id}`;
               return (
                 <div key={`continue-${trace.id}`} className="relative h-4 w-4 my-1" title={`Continue trace: ${trace.id}`}>
                   <Handle 
                      type="source" 
                      position={Position.Right} 
-                     id={`trace-${evolvedTraceId}`}
+                     id={`trace-${trace.id}`}
                      className="!w-3 !h-3 !right-[-6px]"
                      style={{ 
                        backgroundColor: trace.color,
@@ -322,6 +321,11 @@ const LLMNode = ({ id, data, selected }: NodeProps<NodeData>) => {
           
           {/* 2. Merged Trace Handles (with alternating color stripes) */}
           {data.mergedTraces && data.mergedTraces.map((merged: MergedTrace) => {
+            // Check if this merged trace has any outgoing edges
+            const hasOutgoingEdge = edges.some(e => 
+              e.source === id && e.sourceHandle === `trace-${merged.id}`
+            );
+            
             // Create a gradient background from the source trace colors
             const colors = merged.colors.length > 0 ? merged.colors : ['#888'];
             const gradientStops = colors.map((color, idx) => 
@@ -335,11 +339,12 @@ const LLMNode = ({ id, data, selected }: NodeProps<NodeData>) => {
                    type="source" 
                    position={Position.Right} 
                    id={`trace-${merged.id}`}
-                   className="!w-3 !h-3 !right-[-6px] !border-0"
+                   className="!w-3 !h-3 !right-[-6px]"
                    style={{ 
                      background: stripeGradient,
                      top: '50%', 
-                     transform: 'translateY(-50%)' 
+                     transform: 'translateY(-50%)',
+                     border: hasOutgoingEdge ? 'none' : `2px dashed ${isDark ? '#374151' : '#fff'}`
                    }}
                 />
               </div>
-- 
cgit v1.2.3

