@@ -4,6 +4,7 @@ import React, { useState, useRef, useEffect, useMemo, useCallback, useLayoutEffe
44import { createPortal } from 'react-dom' ;
55import { Send , Plus , Bot , User , AlertCircle , Brain , ChevronDown , X , ArrowUp , Download , ExternalLink , HardDrive , RefreshCw , Mic , Check , Loader2 , Wrench , Copy } from 'lucide-react' ;
66import Image from 'next/image' ;
7+ import { useRouter } from 'next/navigation' ;
78import ReactMarkdown from 'react-markdown' ;
89import remarkGfm from 'remark-gfm' ;
910import { cn } from '@/lib/utils' ;
@@ -1339,7 +1340,7 @@ export function ChatInterface() {
13391340 if ( ! stepName ) return ;
13401341
13411342 const label = stepType === 'call_model'
1342- ? `Calling model `
1343+ ? `Calling ${ stepName } `
13431344 : `Routing to ${ stepName } ` ;
13441345
13451346 const last = streamToolCalls [ streamToolCalls . length - 1 ] ;
@@ -1377,7 +1378,7 @@ export function ChatInterface() {
13771378 if ( ! rawTool ) return false ;
13781379 const input = getStringValue ( payload . input , payload . data ) || undefined ;
13791380 handleToolStartEvent ( rawTool , input ) ;
1380- streamActivityLine = `${ formatToolName ( rawTool ) } ` ;
1381+ streamActivityLine = `Tool: ${ formatToolName ( rawTool ) } ` ;
13811382 hasDetailedActivity = true ;
13821383 return true ;
13831384 }
@@ -1782,6 +1783,8 @@ export function ChatInterface() {
17821783 logoUrl = { selectedAgentData ?. logoUrl ?? undefined }
17831784 suggestions = { selectedAgentData ?. suggestions }
17841785 onSuggestionClick = { ( prompt ) => { setInput ( prompt ) ; focusChatInput ( ) ; } }
1786+ onSuggestionHover = { ( value ) => setInput ( value ) }
1787+ onSuggestionLeave = { ( ) => setInput ( '' ) }
17851788 />
17861789 ) : (
17871790 < div className = "mx-auto max-w-3xl space-y-6" >
@@ -2231,16 +2234,26 @@ function EmptyState({
22312234 logoUrl,
22322235 suggestions,
22332236 onSuggestionClick,
2237+ onSuggestionHover,
2238+ onSuggestionLeave,
22342239} : {
22352240 selectedAgentName : string ;
22362241 logoUrl ?: string | null ;
2237- suggestions ?: Array < { label : string ; value : string } > ;
2242+ suggestions ?: Array < { label : string ; value : string ; description ?: string ; disabled ?: boolean ; cta ?: string } > ;
22382243 onSuggestionClick : ( prompt : string ) => void ;
2244+ onSuggestionHover ?: ( value : string ) => void ;
2245+ onSuggestionLeave ?: ( ) => void ;
22392246} ) {
2247+ const router = useRouter ( ) ;
2248+ const { setActivePanelSection } = useWorkspaceStore ( ) ;
2249+ const { user } = useAuthStore ( ) ;
22402250 const resolvedLogoUrl = logoUrl ? getLogoUrl ( logoUrl ) : undefined ;
2251+
2252+ const firstName = user ?. name ?. split ( ' ' ) [ 0 ] ;
2253+ const greeting = firstName ? `Hello, ${ firstName } .` : 'Hello.' ;
22412254 return (
2242- < div className = "flex h-full flex-col items-center justify-center" >
2243- < div className = "mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-workspace-accent-10 overflow-hidden" >
2255+ < div className = "flex h-full flex-col items-center justify-center px-4 " >
2256+ < div className = "mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-workspace-accent-10 overflow-hidden" >
22442257 { resolvedLogoUrl ? (
22452258 // eslint-disable-next-line @next/next/no-img-element
22462259 < img
@@ -2249,28 +2262,72 @@ function EmptyState({
22492262 className = "h-full w-full object-contain p-1"
22502263 />
22512264 ) : (
2252- < Bot size = { 32 } className = "text-workspace-accent" />
2265+ < Bot size = { 24 } className = "text-workspace-accent" />
22532266 ) }
22542267 </ div >
2255- < p className = "mb-8 max-w-md text-center text-muted-foreground" >
2256- Start a conversation with { selectedAgentName } . Ask questions, explore your data, or get
2257- help with tasks.
2268+ < p className = "mb-6 text-center text-muted-foreground" >
2269+ { greeting } Pick a suggestion or type a message to get started.
22582270 </ p >
22592271 { Array . isArray ( suggestions ) && suggestions . length > 0 && (
2260- < div className = "grid w-full max-w-xl grid-cols-2 gap-3" >
2261- { suggestions . map ( ( suggestion , index ) => {
2262- const isOddLastItem = suggestions . length % 2 === 1 && index === suggestions . length - 1 ;
2272+ < div className = "flex w-full max-w-lg flex-col gap-1.5" >
2273+ { suggestions . map ( ( suggestion ) => {
2274+ const baseClass = cn (
2275+ 'glass-card flex min-w-0 items-center justify-between px-4 py-2.5 text-left transition-all' ,
2276+ suggestion . disabled
2277+ ? 'opacity-40 cursor-not-allowed'
2278+ : 'hover:border-primary/30 hover:glow-primary-sm cursor-pointer'
2279+ ) ;
2280+
2281+ const content = (
2282+ < >
2283+ < div className = "min-w-0 flex-1" >
2284+ < span className = "block truncate text-sm font-medium leading-tight" > { suggestion . label } </ span >
2285+ { suggestion . description && (
2286+ < span className = "block truncate text-xs text-muted-foreground leading-snug" >
2287+ { suggestion . description }
2288+ </ span >
2289+ ) }
2290+ { suggestion . disabled && (
2291+ < span className = "block text-xs text-muted-foreground/60 italic" >
2292+ Coming soon
2293+ </ span >
2294+ ) }
2295+ </ div >
2296+ { ! suggestion . disabled && (
2297+ < span className = "ml-3 shrink-0 text-muted-foreground/40" > ›</ span >
2298+ ) }
2299+ </ >
2300+ ) ;
2301+
2302+ if ( suggestion . cta && ! suggestion . disabled ) {
2303+ const sectionId = suggestion . cta . replace ( / ^ \/ / , '' ) as Parameters < typeof setActivePanelSection > [ 0 ] ;
2304+ return (
2305+ < button
2306+ key = { `${ suggestion . label } :${ suggestion . value } ` }
2307+ onMouseEnter = { ( ) => onSuggestionHover ?.( suggestion . label ) }
2308+ onMouseLeave = { ( ) => onSuggestionLeave ?.( ) }
2309+ onClick = { ( ) => {
2310+ setActivePanelSection ( sectionId ) ;
2311+ router . push ( suggestion . cta ! ) ;
2312+ } }
2313+ className = { baseClass }
2314+ >
2315+ { content }
2316+ </ button >
2317+ ) ;
2318+ }
2319+
22632320 return (
2264- < button
2265- key = { `${ suggestion . label } :${ suggestion . value } ` }
2266- onClick = { ( ) => onSuggestionClick ( suggestion . value ) }
2267- className = { cn (
2268- 'glass-card p-4 text-center text-sm transition-all hover:border-primary/30 hover:glow-primary-sm' ,
2269- isOddLastItem && 'col-span-2 w-full max-w-[calc(50%-0.375rem)] justify-self-center'
2270- ) }
2271- >
2272- { suggestion . label }
2273- </ button >
2321+ < button
2322+ key = { `${ suggestion . label } :${ suggestion . value } ` }
2323+ onMouseEnter = { ( ) => ! suggestion . disabled && onSuggestionHover ?. ( suggestion . value ) }
2324+ onMouseLeave = { ( ) => onSuggestionLeave ?. ( ) }
2325+ onClick = { ( ) => ! suggestion . disabled && onSuggestionClick ( suggestion . value ) }
2326+ disabled = { suggestion . disabled }
2327+ className = { baseClass }
2328+ >
2329+ { content }
2330+ </ button >
22742331 ) ;
22752332 } ) }
22762333 </ div >
0 commit comments