From 1df2c09973c3c699f73003f406ef0f22a870860e Mon Sep 17 00:00:00 2001 From: Val Alexander Date: Thu, 9 Apr 2026 18:51:38 -0500 Subject: [PATCH] Refresh SME chat with modern sidebar and composer - Restyle the SME workspace with a cleaner chat layout, auto-sizing composer, and updated empty/loading states - Update conversation and knowledge panels with tighter spacing, clearer actions, and improved visual hierarchy - Rework message bubbles to show speaker labels, refined avatars, and a better streaming cursor --- .../src/components/sme/SmeChatWorkspace.tsx | 108 +++++++++++------- .../components/sme/SmeConversationRail.tsx | 52 +++++---- .../src/components/sme/SmeKnowledgePanel.tsx | 43 +++---- .../src/components/sme/SmeMessageBubble.tsx | 49 +++++--- 4 files changed, 148 insertions(+), 104 deletions(-) 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 */} -
-
-