From 6b897a6f71e3f17e9b82d90eb09cdf8ac2bb4933 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Mon, 17 Mar 2025 02:44:49 -0700 Subject: [PATCH] state simplify --- .../browser/react/src/sidebar-tsx/SidebarChat.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index 10288453..36475e36 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -1654,9 +1654,9 @@ const toolNameToComponent: { [T in ToolName]: { type ChatBubbleMode = 'display' | 'edit' -type ChatBubbleProps = { chatMessage: ChatMessage, messageIdx: number, isCommitted: boolean, isLast: boolean, showApproveRejectButtons: boolean } +type ChatBubbleProps = { chatMessage: ChatMessage, messageIdx: number, isCommitted: boolean, isLast: boolean } -const ChatBubble = ({ chatMessage, isCommitted, messageIdx, isLast, showApproveRejectButtons }: ChatBubbleProps) => { +const ChatBubble = ({ chatMessage, isCommitted, messageIdx, isLast }: ChatBubbleProps) => { const role = chatMessage.role if (role === 'user') { @@ -1677,10 +1677,10 @@ const ChatBubble = ({ chatMessage, isCommitted, messageIdx, isLast, showApproveR else if (role === 'tool_request') { const ToolRequestWrapper = toolNameToComponent[chatMessage.name].requestWrapper as React.FC<{ toolRequest: any }> // ts isnt smart enough... if (ToolRequestWrapper) { - return <> - {isLast && } - {showApproveRejectButtons && } - + return isLast ? <> + + + : null } return null @@ -1978,7 +1978,6 @@ export const SidebarChat = () => { messageIdx={i} isLast={isLast} isCommitted={true} - showApproveRejectButtons={isLast} /> } ) @@ -1996,7 +1995,6 @@ export const SidebarChat = () => { messageIdx={streamingChatIdx} isCommitted={!isRunning} isLast={true} - showApproveRejectButtons={false} /> : null const allMessagesHTML = [...previousMessagesHTML, currStreamingMessageHTML]