fix dialog animations, mobile input ux, and tool descriptions (#1362)

This commit is contained in:
josh 2025-12-20 00:23:15 +00:00 committed by GitHub
parent 4d3ba8d9fe
commit 22de923298
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 101 additions and 74 deletions

View file

@ -11,7 +11,6 @@ import {
type SetStateAction,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
@ -100,6 +99,17 @@ function PureMultimodalInput({
}
}, [adjustHeight]);
const hasAutoFocused = useRef(false);
useEffect(() => {
if (!hasAutoFocused.current && width) {
const timer = setTimeout(() => {
textareaRef.current?.focus();
hasAutoFocused.current = true;
}, 100);
return () => clearTimeout(timer);
}
}, [width]);
const resetHeight = useCallback(() => {
if (textareaRef.current) {
textareaRef.current.style.height = "44px";
@ -352,8 +362,7 @@ function PureMultimodalInput({
)}
<div className="flex flex-row items-start gap-1 sm:gap-2">
<PromptInputTextarea
autoFocus
className="grow resize-none border-0! border-none! bg-transparent p-2 text-sm outline-none ring-0 [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden"
className="grow resize-none border-0! border-none! bg-transparent p-2 text-base outline-none ring-0 [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden"
data-testid="multimodal-input"
disableAutoResize={true}
maxHeight={200}