@@ -219,7 +219,6 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
219219 : elements . nodes . push ( e )
220220 }
221221 } )
222- console . log ( chart . add ( graph . extend ( elements ) ) . map ( ( e ) => e . id ( ) ) ) ;
223222
224223 chart . elements ( ) . filter ( ( e ) => {
225224 console . log ( e . id ( ) ) ;
@@ -230,6 +229,7 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
230229 } else if ( e . isNode ( ) ) {
231230 e . removeStyle ( ) . style ( PATH_NODE_STYLE ) ;
232231 }
232+
233233 if ( e . isEdge ( ) ) {
234234 e . removeStyle ( ) . style ( SELECTED_PATH_EDGE_STYLE ) ;
235235 }
@@ -363,7 +363,6 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
363363 className = "Tip"
364364 onClick = { ( ) => {
365365 setTipOpen ( false )
366- setPath ( { } )
367366 setMessages ( prev => [
368367 ...RemoveLastPath ( prev ) ,
369368 { type : MessageTypes . Query , text : "Create a path" } ,
@@ -378,7 +377,10 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
378377 type : MessageTypes . Response ,
379378 text : "Please select a starting point and the end point. Select or press relevant item on the graph"
380379 } ] ) , 300 )
381- setTimeout ( ( ) => setMessages ( prev => [ ...prev , { type : MessageTypes . Path } ] ) , 4000 )
380+ setTimeout ( ( ) => {
381+ setPath ( { } )
382+ setMessages ( prev => [ ...prev , { type : MessageTypes . Path } ] )
383+ } , 4000 )
382384 } }
383385 >
384386 < Lightbulb />
@@ -455,8 +457,9 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
455457 key = { i }
456458 className = { cn (
457459 "flex text-wrap border p-2 gap-2 rounded-md" ,
458- p . nodes . length === selectedPath ?. nodes . length &&
459- selectedPath ?. nodes . every ( node => p ?. nodes . some ( ( n ) => n . id === node . id ) ) && "border-[#FF66B3] bg-[#FFF0F7]" ,
460+ p . nodes . length === selectedPath ?. nodes . length
461+ && selectedPath ?. nodes . every ( node => p ?. nodes . some ( ( n ) => n . id === node . id ) )
462+ && "border-[#FF66B3] bg-[#FFF0F7]" ,
460463 message . graphName !== graph . Id && "opacity-50 bg-gray-200"
461464 ) }
462465 title = { message . graphName !== graph . Id ? `Move to graph ${ message . graphName } to use this path` : undefined }
@@ -469,13 +472,14 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
469472 } ) ;
470473 return ;
471474 }
475+
472476 if ( p . nodes . length === selectedPath ?. nodes . length &&
473477 selectedPath ?. nodes . every ( node => p ?. nodes . some ( ( n ) => n . id === node . id ) ) ) return ;
474478 handleSetSelectedPath ( p ) ;
475479 setIsPath ( true ) ;
476480 } }
477481 >
478- < p className = "font-bold" > #{ i } </ p >
482+ < p className = "font-bold" > #{ i + 1 } </ p >
479483 < div className = "flex flex-wrap" >
480484 { p . nodes . map ( ( node : any , j : number ) => (
481485 < span key = { j } className = { cn ( ( j === 0 || j === p . nodes . length - 1 ) && "font-bold" ) } >
@@ -533,7 +537,7 @@ export function Chat({ repo, path, setPath, graph, chartRef, selectedPathId, isP
533537 </ button >
534538 < form className = "grow flex items-center border rounded-md px-2" onSubmit = { sendQuery } >
535539 < DropdownMenuTrigger asChild >
536- < button className = "bg-gray-200 p-2 rounded-md hover:bg-gray-300" >
540+ < button data-name = "questionOptionsMenu" className = "bg-gray-200 p-2 rounded-md hover:bg-gray-300" >
537541 < ArrowDown color = "white" />
538542 </ button >
539543 </ DropdownMenuTrigger >
0 commit comments