From 261736bde5d4e2e205db56ae21efdbe45a71591b Mon Sep 17 00:00:00 2001 From: Mathew Pareles Date: Mon, 13 Jan 2025 03:23:38 -0800 Subject: [PATCH] prepare edit button --- .../react/src/sidebar-tsx/SidebarChat.tsx | 74 +++++++++++++++---- .../src/sidebar-tsx/SidebarThreadSelector.tsx | 27 ++++--- 2 files changed, 73 insertions(+), 28 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 db450b95..3687938b 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 @@ -28,6 +28,7 @@ import { useScrollbarStyles } from '../util/useScrollbarStyles.js'; import { VOID_CTRL_L_ACTION_ID } from '../../../actionIDs.js'; import { ArrowBigLeftDash, CopyX, Delete, FileX2, SquareX, X } from 'lucide-react'; import { filenameToVscodeLanguage } from '../../../helpers/detectLanguage.js'; +import { Pencil } from 'lucide-react' export const IconX = ({ size, className = '', ...props }: { size: number, className?: string } & React.SVGProps) => { @@ -332,7 +333,7 @@ export const SelectedFiles = ( {/* X button */} {type === 'staging' && { e.stopPropagation(); // don't open/close selection if (type !== 'staging') return; @@ -346,7 +347,7 @@ export const SelectedFiles = ( - {/* delete all selections button */} + {/* clear all selections button */} {type !== 'staging' || selections.length === 0 || i !== selections.length - 1 ? null :
@@ -357,10 +358,14 @@ export const SelectedFiles = ( > { setStaging([]) }} />
@@ -381,7 +386,8 @@ export const SelectedFiles = ( maxHeight={100} showScrollbars={true} /> - } + + } })} @@ -393,6 +399,7 @@ export const SelectedFiles = ( } + const ChatBubble = ({ chatMessage, isLoading }: { chatMessage: ChatMessage, isLoading?: boolean, @@ -400,6 +407,9 @@ const ChatBubble = ({ chatMessage, isLoading }: { const role = chatMessage.role + // edit mode state + const [isEditMode, setIsEditMode] = useState(false) + if (!chatMessage.displayContent) return null @@ -409,30 +419,61 @@ const ChatBubble = ({ chatMessage, isLoading }: { chatbubbleContents = <> {chatMessage.displayContent} + + {/* {!isEditMode ? chatMessage.displayContent : <>} */} + {/* edit mode content */} + {/* TODO this should be the same input box as in the Sidebar */} + {/*