🛠️ refactor: Improve Input Placeholder Handling and Error Management 🔄 (#1296)

* chore: identify new chat buttons with testid

* fix: avoid parsing error in useSSE, which causes errorHandler to fail

* fix: ensure last message isn't setting latestMessage when conversationId is `new` and text is the same due to possible re-renders

* refactor: set placeholder through inputRef and useEffect

* Update useSSE.ts

* Update useSSE.ts
This commit is contained in:
Danny Avila 2023-12-06 14:10:06 -05:00 committed by GitHub
parent 2e390596ea
commit 9b2359fc27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 23 deletions

View file

@ -11,7 +11,6 @@ export default function Textarea({ value, disabled, onChange, setText, submitMes
handleKeyDown,
handleCompositionStart,
handleCompositionEnd,
placeholder,
} = useTextarea({ setText, submitMessage, disabled });
return (
@ -31,7 +30,6 @@ export default function Textarea({ value, disabled, onChange, setText, submitMes
data-testid="text-input"
style={{ height: 44, overflowY: 'auto' }}
rows={1}
placeholder={placeholder}
className={cn(
supportsFiles[endpoint] ? ' pl-10 md:pl-[55px]' : 'pl-3 md:pl-4',
'm-0 w-full resize-none border-0 bg-transparent py-[10px] pr-10 placeholder-black/50 focus:ring-0 focus-visible:ring-0 dark:bg-transparent dark:placeholder-white/50 md:py-3.5 md:pr-12 ',