From db7ec0272adf3ba39867ff31c2d96118f86c9468 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 7 Mar 2025 20:48:57 -0800 Subject: [PATCH] don't display empty assistant messages (these are only used for LLMMessage) --- .../browser/react/src/sidebar-tsx/SidebarChat.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 89a635b5..f577588b 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 @@ -727,8 +727,6 @@ const DropdownComponent = ({ const UserMessageComponent = ({ chatMessage, messageIdx, isLoading }: ChatBubbleProps & { chatMessage: ChatMessage & { role: 'user' } }) => { - const role = chatMessage.role - const accessor = useAccessor() const chatThreadsService = accessor.get('IChatThreadService') @@ -758,7 +756,7 @@ const UserMessageComponent = ({ chatMessage, messageIdx, isLoading }: ChatBubble const _mustInitialize = useRef(true) const _justEnabledEdit = useRef(false) useEffect(() => { - const canInitialize = role === 'user' && mode === 'edit' && textAreaRefState + const canInitialize = mode === 'edit' && textAreaRefState const shouldInitialize = _justEnabledEdit.current || _mustInitialize.current if (canInitialize && shouldInitialize) { setStagingSelections(chatMessage.selections || []) @@ -771,7 +769,7 @@ const UserMessageComponent = ({ chatMessage, messageIdx, isLoading }: ChatBubble _mustInitialize.current = false } - }, [chatMessage, role, mode, _justEnabledEdit, textAreaRefState, textAreaFnsRef.current, _justEnabledEdit.current, _mustInitialize.current]) + }, [chatMessage, mode, _justEnabledEdit, textAreaRefState, textAreaFnsRef.current, _justEnabledEdit.current, _mustInitialize.current]) const onOpenEdit = () => { setIsBeingEdited(true) @@ -893,7 +891,7 @@ const UserMessageComponent = ({ chatMessage, messageIdx, isLoading }: ChatBubble - {role === 'user' && {/* reasoning token */} @@ -1293,6 +1295,8 @@ const ChatBubble = ({ chatMessage, isLoading, messageIdx }: ChatBubbleProps) => const role = chatMessage.role + console.log('ROLE', role) + if (role === 'user') { return