diff --git a/ui/desktop/src/components/BaseChat.tsx b/ui/desktop/src/components/BaseChat.tsx index 142c2801a3..cc59048db4 100644 --- a/ui/desktop/src/components/BaseChat.tsx +++ b/ui/desktop/src/components/BaseChat.tsx @@ -92,6 +92,7 @@ interface BaseChatProps { customChatInputProps?: Record; customMainLayoutProps?: Record; contentClassName?: string; // Add custom class for content area + disableSearch?: boolean; // Disable search functionality (for Hub) } function BaseChatContent({ @@ -107,6 +108,7 @@ function BaseChatContent({ customChatInputProps = {}, customMainLayoutProps = {}, contentClassName = '', + disableSearch = false, }: BaseChatProps) { const location = useLocation(); const scrollRef = useRef(null); @@ -238,6 +240,61 @@ function BaseChatContent({ } }; + // Helper function to render messages + const renderMessages = () => { + return filteredMessages.map((message, index) => { + const isUser = isUserMessage(message); + + return ( +
+ {isUser ? ( + <> + {hasContextHandlerContent(message) ? ( + + ) : ( + + )} + + ) : ( + <> + {hasContextHandlerContent(message) ? ( + + ) : ( + { + const updatedMessages = [...messages, newMessage]; + setMessages(updatedMessages); + }} + toolCallNotifications={toolCallNotifications} + /> + )} + + )} +
+ ); + }); + }; + return (
@@ -278,59 +335,13 @@ function BaseChatContent({ {/* Messages */} {messages.length > 0 && ( <> - - {filteredMessages.map((message, index) => { - const isUser = isUserMessage(message); - - return ( -
- {isUser ? ( - <> - {hasContextHandlerContent(message) ? ( - - ) : ( - - )} - - ) : ( - <> - {hasContextHandlerContent(message) ? ( - - ) : ( - { - const updatedMessages = [...messages, newMessage]; - setMessages(updatedMessages); - }} - toolCallNotifications={toolCallNotifications} - /> - )} - - )} -
- ); - })} -
+ {disableSearch ? ( + // Render messages without SearchView wrapper when search is disabled + renderMessages() + ) : ( + // Render messages with SearchView wrapper when search is enabled + {renderMessages()} + )} {error && (
diff --git a/ui/desktop/src/components/hub.tsx b/ui/desktop/src/components/hub.tsx index 15007bc3a8..f368281832 100644 --- a/ui/desktop/src/components/hub.tsx +++ b/ui/desktop/src/components/hub.tsx @@ -30,7 +30,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from './ui/Tooltip'; import { Bot, Save, Send } from 'lucide-react'; import { useChatContext } from '../contexts/ChatContext'; import BaseChat from './BaseChat'; -import { SearchView } from './conversation/SearchView'; import { Recipe } from '../recipe'; import 'react-toastify/dist/ReactToastify.css'; @@ -189,11 +188,6 @@ export default function Hub({ <> {/* Session Insights - always show on hub page regardless of message count */} {(chat.messages.length === 0 || forceShowInsights) && !isInPairMode && } - - {/* Empty search view when no messages or insights forced */} - {(chat.messages.length === 0 || forceShowInsights) && !isInPairMode && ( - {/* Empty search view when no messages or insights forced */} - )} ); @@ -255,6 +249,7 @@ export default function Hub({ renderHeader={renderHeader} renderBeforeMessages={renderBeforeMessages} customChatInputProps={customChatInputProps} + disableSearch={true} /> {showGame && setShowGame(false)} />}