@@ -103,7 +103,7 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
103103 setTreeNodes ( updatedTreeNodes ) ;
104104 setSelectedNodeId ( newSelectedNodeId ) ;
105105 }
106- } , [ messages , treeNodes , selectedNodeId ] ) ;
106+ } , [ messages ] ) ;
107107
108108 // Render the tree visualization
109109 useEffect ( ( ) => {
@@ -221,7 +221,7 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
221221 : theme === 'dark' ? "#374151" : "#D1D5DB" )
222222 . attr ( "stroke-width" , d => d . data . id === selectedNodeId ? 3 : 2 ) ;
223223
224- // Add node labels directly on the node circles
224+ // Add node labels with tooltips
225225 nodes . append ( "text" )
226226 . attr ( "dy" , ".35em" )
227227 . attr ( "x" , d => d . children ? - 18 : 18 )
@@ -230,19 +230,18 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
230230 // For root node
231231 if ( d . data . parent_id === null ) return "ROOT" ;
232232
233- // Extract action name from action string
233+ // Show full action string
234234 if ( d . data . action ) {
235- const actionMatch = d . data . action . match ( / ^ ( [ a - z A - Z _ ] + ) \( / ) ;
236- return actionMatch ? actionMatch [ 1 ] : "action" ;
235+ return d . data . action ;
237236 }
238237
239238 return d . data . id . toString ( ) . slice ( - 4 ) ;
240239 } )
241- . attr ( "font-size" , "14px " )
240+ . attr ( "font-size" , "15px " )
242241 . attr ( "font-weight" , "500" )
243242 . attr ( "fill" , d => {
244243 if ( d . data . id === selectedNodeId ) {
245- return theme === 'dark' ? "#93C5FD" : "#2563EB" ;
244+ return "#ff5722" ; // Orange for selected node
246245 }
247246 return theme === 'dark' ? "#FFFFFF" : "#111827" ;
248247 } ) ;
@@ -264,29 +263,21 @@ const SimpleSearchVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) =>
264263 // Add tooltip interactions
265264 nodes
266265 . on ( "mouseover" , function ( event , d ) {
267- if ( tooltipRef . current ) {
268- let content = `<div><strong>Node ID:</strong> ${ d . data . id } </div>` ;
269- if ( d . data . action ) content += `<div><strong>Action:</strong> ${ d . data . action } </div>` ;
270- if ( d . data . description ) content += `<div><strong>Description:</strong> ${ d . data . description } </div>` ;
271- if ( typeof d . data . value === 'number' ) content += `<div><strong>Value:</strong> ${ d . data . value . toFixed ( 2 ) } </div>` ;
272- if ( typeof d . data . reward === 'number' ) content += `<div><strong>Reward:</strong> ${ d . data . reward . toFixed ( 2 ) } </div>` ;
273- if ( typeof d . data . visits === 'number' ) content += `<div><strong>Visits:</strong> ${ d . data . visits } </div>` ;
274- if ( d . data . feedback ) content += `<div><strong>Feedback:</strong> ${ d . data . feedback } </div>` ;
275-
266+ if ( tooltipRef . current && d . data . description ) {
276267 const tooltip = d3 . select ( tooltipRef . current ) ;
277268 tooltip . transition ( )
278269 . duration ( 200 )
279270 . style ( "opacity" , .9 ) ;
280- tooltip . html ( content )
271+ tooltip . html ( d . data . description )
281272 . style ( "left" , ( event . pageX + 15 ) + "px" )
282- . style ( "top" , ( event . pageY - 30 ) + "px" ) ;
273+ . style ( "top" , ( event . pageY - 60 ) + "px" ) ;
283274 }
284275 } )
285276 . on ( "mousemove" , function ( event ) {
286277 if ( tooltipRef . current ) {
287278 d3 . select ( tooltipRef . current )
288279 . style ( "left" , ( event . pageX + 15 ) + "px" )
289- . style ( "top" , ( event . pageY - 30 ) + "px" ) ;
280+ . style ( "top" , ( event . pageY - 28 ) + "px" ) ;
290281 }
291282 } )
292283 . on ( "mouseout" , function ( ) {
0 commit comments