fix dialog animations, mobile input ux, and tool descriptions (#1362)
This commit is contained in:
parent
4d3ba8d9fe
commit
22de923298
6 changed files with 101 additions and 74 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue