mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Fix icon alignment
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
||||||
import { KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState } from "react"
|
import { KeyboardEvent, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"
|
||||||
import vsDarkPlus from "react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus"
|
import vsDarkPlus from "react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus"
|
||||||
import DynamicTextArea from "react-textarea-autosize"
|
import DynamicTextArea from "react-textarea-autosize"
|
||||||
import { useEvent, useMount } from "react-use"
|
import { useEvent, useMount } from "react-use"
|
||||||
@@ -55,6 +55,8 @@ const ChatView = ({
|
|||||||
const textAreaRef = useRef<HTMLTextAreaElement>(null)
|
const textAreaRef = useRef<HTMLTextAreaElement>(null)
|
||||||
const [textAreaDisabled, setTextAreaDisabled] = useState(false)
|
const [textAreaDisabled, setTextAreaDisabled] = useState(false)
|
||||||
const [isTextAreaFocused, setIsTextAreaFocused] = useState(false)
|
const [isTextAreaFocused, setIsTextAreaFocused] = useState(false)
|
||||||
|
const textAreaContainerRef = useRef<HTMLDivElement>(null)
|
||||||
|
const [textAreaContainerHeight, setTextAreaContainerHeight] = useState(51)
|
||||||
const [selectedImages, setSelectedImages] = useState<string[]>([])
|
const [selectedImages, setSelectedImages] = useState<string[]>([])
|
||||||
const [thumbnailsHeight, setThumbnailsHeight] = useState(0)
|
const [thumbnailsHeight, setThumbnailsHeight] = useState(0)
|
||||||
|
|
||||||
@@ -457,6 +459,17 @@ const ChatView = ({
|
|||||||
selectedImages.length >= MAX_IMAGES_PER_MESSAGE ||
|
selectedImages.length >= MAX_IMAGES_PER_MESSAGE ||
|
||||||
isInputPipingToStdin
|
isInputPipingToStdin
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
if (textAreaContainerRef.current) {
|
||||||
|
let height = textAreaContainerRef.current.clientHeight
|
||||||
|
// some browsers return 0 for clientHeight
|
||||||
|
if (!height) {
|
||||||
|
height = textAreaContainerRef.current.getBoundingClientRect().height
|
||||||
|
}
|
||||||
|
setTextAreaContainerHeight(height)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -573,6 +586,7 @@ const ChatView = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
ref={textAreaContainerRef}
|
||||||
style={{
|
style={{
|
||||||
padding: "10px 15px",
|
padding: "10px 15px",
|
||||||
opacity: textAreaDisabled ? 0.5 : 1,
|
opacity: textAreaDisabled ? 0.5 : 1,
|
||||||
@@ -648,10 +662,10 @@ const ChatView = ({
|
|||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
right: 20,
|
right: 20,
|
||||||
bottom: 13.5, // Align with the bottom padding of the container
|
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "flex-end",
|
alignItems: "flex-center",
|
||||||
height: "calc(100% - 20px)", // Full height minus top and bottom padding
|
height: textAreaContainerHeight - 20,
|
||||||
|
bottom: 10,
|
||||||
}}>
|
}}>
|
||||||
<div style={{ display: "flex", flexDirection: "row", alignItems: "center" }}>
|
<div style={{ display: "flex", flexDirection: "row", alignItems: "center" }}>
|
||||||
<VSCodeButton
|
<VSCodeButton
|
||||||
@@ -662,7 +676,7 @@ const ChatView = ({
|
|||||||
style={{ marginRight: "2px" }}>
|
style={{ marginRight: "2px" }}>
|
||||||
<span
|
<span
|
||||||
className="codicon codicon-device-camera"
|
className="codicon codicon-device-camera"
|
||||||
style={{ fontSize: 18, marginLeft: -2 }}></span>
|
style={{ fontSize: 18, marginLeft: -2, marginBottom: 0.5 }}></span>
|
||||||
</VSCodeButton>
|
</VSCodeButton>
|
||||||
<VSCodeButton
|
<VSCodeButton
|
||||||
disabled={textAreaDisabled}
|
disabled={textAreaDisabled}
|
||||||
|
|||||||
Reference in New Issue
Block a user