Skip to content

Commit fec57e3

Browse files
committed
fix:Made the main inputbox focus styling better, added better spacing in openai compatible section
1 parent 4026a87 commit fec57e3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
103103
const [intendedCursorPosition, setIntendedCursorPosition] = useState<number | null>(null)
104104
const contextMenuContainerRef = useRef<HTMLDivElement>(null)
105105
const [isEnhancingPrompt, setIsEnhancingPrompt] = useState(false)
106+
const [isFocused, setIsFocused] = useState(false)
106107

107108
// Fetch git commits when Git is selected or when typing a hash
108109
useEffect(() => {
@@ -379,6 +380,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
379380
if (!isMouseDownOnMenu) {
380381
setShowContextMenu(false)
381382
}
383+
setIsFocused(false)
382384
}, [isMouseDownOnMenu])
383385

384386
const handlePaste = useCallback(
@@ -537,6 +539,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
537539
backgroundColor: "var(--vscode-input-background)",
538540
margin: "10px 15px",
539541
padding: "8px",
542+
outline: "none",
543+
border: "1px solid",
544+
borderColor: isFocused ? "var(--vscode-focusBorder)" : "transparent",
545+
borderRadius: "2px",
540546
}}
541547
onDrop={async (e) => {
542548
e.preventDefault()
@@ -647,6 +653,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
647653
handleInputChange(e)
648654
updateHighlights()
649655
}}
656+
onFocus={() => setIsFocused(true)}
650657
onKeyDown={handleKeyDown}
651658
onKeyUp={handleKeyUp}
652659
onBlur={handleBlur}
@@ -665,6 +672,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
665672
autoFocus={true}
666673
style={{
667674
width: "100%",
675+
outline: "none",
668676
boxSizing: "border-box",
669677
backgroundColor: "transparent",
670678
color: "var(--vscode-input-foreground)",

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
563563
)}
564564

565565
{selectedProvider === "openai" && (
566-
<div>
566+
<div style={{ display: "flex", flexDirection: "column", rowGap: "5px" }}>
567567
<VSCodeTextField
568568
value={apiConfiguration?.openAiBaseUrl || ""}
569569
style={{ width: "100%" }}

0 commit comments

Comments
 (0)