Browse Source

Remove text area height calculation

Saoud Rizwan 1 year ago
parent
commit
d84e6c6fb1
3 changed files with 5 additions and 11 deletions
  1. 2 2
      package-lock.json
  2. 1 1
      package.json
  3. 2 8
      webview-ui/src/components/ChatView.tsx

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "claude-dev",
   "name": "claude-dev",
-  "version": "1.0.83",
+  "version": "1.0.84",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "claude-dev",
       "name": "claude-dev",
-      "version": "1.0.83",
+      "version": "1.0.84",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@anthropic-ai/sdk": "^0.24.3",
         "@anthropic-ai/sdk": "^0.24.3",

+ 1 - 1
package.json

@@ -2,7 +2,7 @@
   "name": "claude-dev",
   "name": "claude-dev",
   "displayName": "Claude Dev",
   "displayName": "Claude Dev",
   "description": "Autonomous software engineer right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
   "description": "Autonomous software engineer right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
-  "version": "1.0.83",
+  "version": "1.0.84",
   "icon": "icon.png",
   "icon": "icon.png",
   "engines": {
   "engines": {
     "vscode": "^1.84.0"
     "vscode": "^1.84.0"

+ 2 - 8
webview-ui/src/components/ChatView.tsx

@@ -31,7 +31,6 @@ const ChatView = ({ messages, isHidden, vscodeThemeName, showAnnouncement, hideA
 
 
 	const [inputValue, setInputValue] = useState("")
 	const [inputValue, setInputValue] = useState("")
 	const textAreaRef = useRef<HTMLTextAreaElement>(null)
 	const textAreaRef = useRef<HTMLTextAreaElement>(null)
-	const [textAreaHeight, setTextAreaHeight] = useState<number | undefined>(undefined)
 	const [textAreaDisabled, setTextAreaDisabled] = useState(false)
 	const [textAreaDisabled, setTextAreaDisabled] = useState(false)
 
 
 	// we need to hold on to the ask because useEffect > lastMessage will always let us know when an ask comes in and handle it, but by the time handleMessage is called, the last message might not be the ask anymore (it could be a say that followed)
 	// we need to hold on to the ask because useEffect > lastMessage will always let us know when an ask comes in and handle it, but by the time handleMessage is called, the last message might not be the ask anymore (it could be a say that followed)
@@ -275,12 +274,6 @@ const ChatView = ({ messages, isHidden, vscodeThemeName, showAnnouncement, hideA
 		textAreaRef.current?.focus()
 		textAreaRef.current?.focus()
 	})
 	})
 
 
-	useEffect(() => {
-		if (textAreaRef.current && !textAreaHeight) {
-			setTextAreaHeight(textAreaRef.current.offsetHeight)
-		}
-	}, [textAreaHeight])
-
 	useEffect(() => {
 	useEffect(() => {
 		const timer = setTimeout(() => {
 		const timer = setTimeout(() => {
 			if (!isHidden && !textAreaDisabled && !enableButtons) {
 			if (!isHidden && !textAreaDisabled && !enableButtons) {
@@ -463,7 +456,8 @@ const ChatView = ({ messages, isHidden, vscodeThemeName, showAnnouncement, hideA
 						right: 20,
 						right: 20,
 						display: "flex",
 						display: "flex",
 						alignItems: "center",
 						alignItems: "center",
-						...(!!textAreaHeight ? { height: textAreaHeight, bottom: 12 } : { top: 0, bottom: 1.5 }),
+						top: 0,
+						bottom: 1.5,
 					}}>
 					}}>
 					<VSCodeButton
 					<VSCodeButton
 						disabled={textAreaDisabled}
 						disabled={textAreaDisabled}