88import { ChatMessageList } from "@shared/components/ui/chat/chat-message-list" ;
99import { ChatInput } from "@shared/components/ui/chat/chat-input" ;
1010import { Button } from "@/shared/components/ui/button" ;
11-
1211import {
1312 ChatClientWithSession ,
1413 RagFlowMessage ,
@@ -36,8 +35,7 @@ export default function MessageBox({
3635 const [ isLoading , setIsLoading ] = useState ( false ) ;
3736
3837 function cleanMessage ( content : string ) : string {
39- // Remove any reference patterns like ##number$$
40- return content . replace ( / # # \d + \$ \$ / g, "" ) . trim ( ) ;
38+ return content . replace ( / \s # # \d + \$ \$ / g, "" ) . trim ( ) ;
4139 }
4240
4341 async function handleSend ( ) {
@@ -66,17 +64,19 @@ export default function MessageBox({
6664 }
6765
6866 return (
69- < div className = "flex h-[600px] w-11/12 flex-col place-self-center rounded border p-4 text-gray-800 shadow dark:text-white" >
67+ < div className = "flex h-[80vh] min-h-[400px] w-11/12 flex-col place-self-center rounded border p-4 text-gray-800 shadow dark:text-white max-[500px]:w-full " >
7068 < Logo
71- className = { "size-24 place-self-center stroke-black stroke-[10px]" }
69+ className = {
70+ "size-[6vmin] h-fit min-w-10 place-self-center stroke-black stroke-[10px]"
71+ }
7272 />
73- { /* doesn't seem like 400 px does much */ }
74- < div className = "h-[400px] flex-1 overflow-auto" >
75- < ChatMessageList smooth >
73+ < div className = "flex-1 overflow-auto" >
74+ < ChatMessageList smooth className = "max-[500px]:px-0" >
7675 { messages . map ( ( msg , index ) => (
7776 < ChatBubble
7877 key = { index }
7978 variant = { msg . role === "assistant" ? "received" : "sent" }
79+ className = "max-w-[80%]"
8080 >
8181 { msg . role === "assistant" ? (
8282 < ChatBubbleAvatar fallback = "AI" />
@@ -99,18 +99,15 @@ export default function MessageBox({
9999 ) }
100100 </ ChatMessageList >
101101 </ div >
102- < div className = "relative mt-4 " >
102+ < div className = "flex w-full items-center justify-between gap-2 rounded-lg border bg-background p-1 " >
103103 < ChatInput
104104 value = { value }
105105 onChange = { ( e ) => setValue ( e . target . value ) }
106106 placeholder = "Type your message..."
107107 onEnter = { handleSend }
108+ className = "focus-visible:ringof min-h-10 resize-none border-0 bg-background shadow-none focus-visible:ring-0"
108109 />
109- < Button
110- onClick = { handleSend }
111- size = "default"
112- className = "absolute right-2 top-1/2 -translate-y-1/2"
113- >
110+ < Button onClick = { handleSend } size = "sm" className = "ml-auto mr-3" >
114111 Send < SendIcon />
115112 </ Button >
116113 </ div >
0 commit comments