Fix user_feedback word wrap issue; auto focus textarea when feedback is required

This commit is contained in:
Saoud Rizwan
2024-07-10 07:23:44 -04:00
parent cb985f3ce8
commit e4710e8d2c
2 changed files with 13 additions and 0 deletions

View File

@@ -125,6 +125,8 @@ const ChatRow: React.FC<ChatRowProps> = ({ message }) => {
color: "var(--vscode-badge-foreground)",
borderRadius: "3px",
padding: "8px",
whiteSpace: "pre-line",
wordWrap: "break-word"
}}>
<span>{message.text}</span>
</div>

View File

@@ -255,6 +255,17 @@ const ChatView = ({ messages, isHidden }: ChatViewProps) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isHidden])
useEffect(() => {
const timer = setTimeout(() => {
if (!textAreaDisabled) {
textAreaRef.current?.focus()
}
}, 50)
return () => {
clearTimeout(timer)
}
}, [textAreaDisabled])
return (
<div
style={{