diff --git a/webview-ui/src/components/ChatRow.tsx b/webview-ui/src/components/ChatRow.tsx index aaaa233..0301350 100644 --- a/webview-ui/src/components/ChatRow.tsx +++ b/webview-ui/src/components/ChatRow.tsx @@ -125,6 +125,8 @@ const ChatRow: React.FC = ({ message }) => { color: "var(--vscode-badge-foreground)", borderRadius: "3px", padding: "8px", + whiteSpace: "pre-line", + wordWrap: "break-word" }}> {message.text} diff --git a/webview-ui/src/components/ChatView.tsx b/webview-ui/src/components/ChatView.tsx index dff773d..5c940f3 100644 --- a/webview-ui/src/components/ChatView.tsx +++ b/webview-ui/src/components/ChatView.tsx @@ -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 (