feat: add mcp app renderer (#6095)

Co-authored-by: Douwe Osinga <douwe@block.xyz>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Andrew Harvard
2025-12-22 18:01:21 -05:00
committed by GitHub
parent 762b2cf54d
commit 91a6b21f39
29 changed files with 1786 additions and 95 deletions
+13 -19
View File
@@ -265,27 +265,10 @@ function BaseChatContent({
});
};
const renderProgressiveMessageList = (chat: ChatType) => (
<>
<ProgressiveMessageList
messages={messages}
chat={chat}
toolCallNotifications={toolCallNotifications}
isUserMessage={(m: Message) => m.role === 'user'}
isStreamingMessage={chatState !== ChatState.Idle}
onRenderingComplete={handleRenderingComplete}
onMessageUpdate={onMessageUpdate}
submitElicitationResponse={submitElicitationResponse}
append={(text: string) => handleSubmit(text)}
/>
</>
);
const showPopularTopics =
messages.length === 0 && !initialMessage && chatState === ChatState.Idle;
const chat: ChatType = {
messageHistoryIndex: 0,
messages,
recipe,
sessionId,
@@ -375,10 +358,21 @@ function BaseChatContent({
</div>
)}
{/* Messages or Popular Topics */}
{messages.length > 0 || recipe ? (
<>
<SearchView>{renderProgressiveMessageList(chat)}</SearchView>
<SearchView>
<ProgressiveMessageList
messages={messages}
chat={{ sessionId }}
toolCallNotifications={toolCallNotifications}
append={(text: string) => handleSubmit(text)}
isUserMessage={(m: Message) => m.role === 'user'}
isStreamingMessage={chatState !== ChatState.Idle}
onRenderingComplete={handleRenderingComplete}
onMessageUpdate={onMessageUpdate}
submitElicitationResponse={submitElicitationResponse}
/>
</SearchView>
<div className="block h-8" />
</>