fix:Made the main inputbox focus styling better, added better spacing in openai compatible section

This commit is contained in:
Prathmesh Vhatkar
2025-01-30 11:21:54 +05:30
parent 4026a87d2c
commit fec57e30a8
2 changed files with 9 additions and 1 deletions

View File

@@ -103,6 +103,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
const [intendedCursorPosition, setIntendedCursorPosition] = useState<number | null>(null) const [intendedCursorPosition, setIntendedCursorPosition] = useState<number | null>(null)
const contextMenuContainerRef = useRef<HTMLDivElement>(null) const contextMenuContainerRef = useRef<HTMLDivElement>(null)
const [isEnhancingPrompt, setIsEnhancingPrompt] = useState(false) const [isEnhancingPrompt, setIsEnhancingPrompt] = useState(false)
const [isFocused, setIsFocused] = useState(false)
// Fetch git commits when Git is selected or when typing a hash // Fetch git commits when Git is selected or when typing a hash
useEffect(() => { useEffect(() => {
@@ -379,6 +380,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
if (!isMouseDownOnMenu) { if (!isMouseDownOnMenu) {
setShowContextMenu(false) setShowContextMenu(false)
} }
setIsFocused(false)
}, [isMouseDownOnMenu]) }, [isMouseDownOnMenu])
const handlePaste = useCallback( const handlePaste = useCallback(
@@ -537,6 +539,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
backgroundColor: "var(--vscode-input-background)", backgroundColor: "var(--vscode-input-background)",
margin: "10px 15px", margin: "10px 15px",
padding: "8px", padding: "8px",
outline: "none",
border: "1px solid",
borderColor: isFocused ? "var(--vscode-focusBorder)" : "transparent",
borderRadius: "2px",
}} }}
onDrop={async (e) => { onDrop={async (e) => {
e.preventDefault() e.preventDefault()
@@ -647,6 +653,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
handleInputChange(e) handleInputChange(e)
updateHighlights() updateHighlights()
}} }}
onFocus={() => setIsFocused(true)}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
onKeyUp={handleKeyUp} onKeyUp={handleKeyUp}
onBlur={handleBlur} onBlur={handleBlur}
@@ -665,6 +672,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
autoFocus={true} autoFocus={true}
style={{ style={{
width: "100%", width: "100%",
outline: "none",
boxSizing: "border-box", boxSizing: "border-box",
backgroundColor: "transparent", backgroundColor: "transparent",
color: "var(--vscode-input-foreground)", color: "var(--vscode-input-foreground)",

View File

@@ -563,7 +563,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
)} )}
{selectedProvider === "openai" && ( {selectedProvider === "openai" && (
<div> <div style={{ display: "flex", flexDirection: "column", rowGap: "5px" }}>
<VSCodeTextField <VSCodeTextField
value={apiConfiguration?.openAiBaseUrl || ""} value={apiConfiguration?.openAiBaseUrl || ""}
style={{ width: "100%" }} style={{ width: "100%" }}