diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/InputBox.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/InputBox.tsx deleted file mode 100644 index b90e218d..00000000 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/InputBox.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import { useService } from '../util/services.js'; -import { HistoryInputBox } from '../../../../../../../base/browser/ui/inputbox/inputBox.js'; -import { defaultInputBoxStyles } from '../../../../../../../platform/theme/browser/defaultStyles.js'; - -export const InputBox = ({ onChangeText, placeholder, historyInputBoxRef, }: { - onChangeText: (value: string) => void; - placeholder: string; - historyInputBoxRef: React.MutableRefObject; // update this whenever historyInputBoxRef.current changes -}) => { - const contextViewProvider = useService('contextViewService'); - - const containerRef = useRef(null); - - useEffect(() => { - if (!containerRef.current) return; - - // create and mount the HistoryInputBox - historyInputBoxRef.current = new HistoryInputBox( - containerRef.current, - contextViewProvider, - { - inputBoxStyles: { - ...defaultInputBoxStyles, - inputBackground: 'transparent', - }, - placeholder, - history: [], - flexibleHeight: true, - flexibleMaxHeight: 500, - flexibleWidth: false, - } - ); - - - historyInputBoxRef.current.onDidChange((newStr) => { - onChangeText(newStr) - }) - - // historyInputBoxRef.current.onDidHeightChange((newHeight) => { - // console.log('CHANGE height', newHeight); - // }) - - // cleanup - return () => { - if (historyInputBoxRef.current) { - historyInputBoxRef.current.dispose(); - if (containerRef.current) { - while (containerRef.current.firstChild) { - containerRef.current.removeChild(containerRef.current.firstChild); - } - } - historyInputBoxRef.current = null; - } - }; - }, [onChangeText, placeholder, contextViewProvider]); // Empty dependency array since we only want to mount/unmount once - - return
; -}; 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 df90ba48..2c44a9ad 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 @@ -19,7 +19,7 @@ import { IDisposable } from '../../../../../../../base/common/lifecycle.js'; import { ErrorDisplay } from './ErrorDisplay.js'; import { LLMMessageServiceParams } from '../../../../../../../platform/void/common/llmMessageTypes.js'; import { getCmdKey } from '../../../getCmdKey.js' -import { InputBox } from './InputBox.js'; +import { InputBox } from './inputs.js'; import { HistoryInputBox } from '../../../../../../../base/browser/ui/inputbox/inputBox.js'; // read files from VSCode @@ -298,7 +298,9 @@ export const SidebarChat = () => { {/*