diff --git a/apps/web/src/components/sme/SmeChatWorkspace.tsx b/apps/web/src/components/sme/SmeChatWorkspace.tsx index d9c57db6c..2f888e4b4 100644 --- a/apps/web/src/components/sme/SmeChatWorkspace.tsx +++ b/apps/web/src/components/sme/SmeChatWorkspace.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from "react"; -import { BookOpenIcon, SendIcon } from "lucide-react"; +import { BookOpenIcon, ArrowUpIcon, SparklesIcon } from "lucide-react"; import type { SmeConversationId, SmeMessage, SmeMessageId } from "@okcode/contracts"; import { ensureNativeApi } from "~/nativeApi"; import { useSmeStore } from "~/smeStore"; @@ -39,6 +39,14 @@ export function SmeChatWorkspace({ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }); }, [messages, streamingText]); + // Auto-resize textarea + useEffect(() => { + const textarea = textareaRef.current; + if (!textarea) return; + textarea.style.height = "auto"; + textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`; + }, [inputText]); + const handleSend = useCallback(async () => { if (!conversationId || !inputText.trim() || sending) return; @@ -106,11 +114,15 @@ export function SmeChatWorkspace({ if (!conversationId) { return ( -
-
- -

- Select a conversation or create a new one to start chatting +

+
+ +
+
+

SME Chat

+

+ Select a conversation or create a new one to start chatting with your subject matter + expert.

@@ -118,17 +130,16 @@ export function SmeChatWorkspace({ } return ( -
- {/* Header */} -
- Conversation +
+ {/* Minimal Header */} +
{/* Messages */} -
-
+
+
{messages.map((msg) => ( ))} @@ -158,39 +169,54 @@ export function SmeChatWorkspace({ /> ) : null} {sending && !streamingText ? ( -
-
- - - +
+
+ +
+
+

SME Assistant

+
+
+ + + +
+ Thinking... +
- Thinking...
) : null}
- {/* Composer */} -
-
-