File tree Expand file tree Collapse file tree 3 files changed +10
-44
lines changed
app/classrooms/[classroomId]/chat
shared/components/ui/chat/hooks Expand file tree Collapse file tree 3 files changed +10
-44
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,17 @@ export default function MessageBox({
6565 }
6666
6767 return (
68- < div className = "flex h-[600px ] w-11/12 flex-col place-self-center rounded border p-4 text-gray-800 shadow dark:text-white" >
68+ < 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" >
6969 < Logo
70- className = { "size-24 place-self-center stroke-black stroke-[10px]" }
70+ className = { "size-[4vmin] place-self-center stroke-black stroke-[10px]" }
7171 />
72-
73- < AutoScroll messages = { messages } >
72+ < div className = "flex-1 overflow-auto" >
7473 < ChatMessageList smooth >
7574 { messages . map ( ( msg , index ) => (
7675 < ChatBubble
7776 key = { index }
7877 variant = { msg . role === "assistant" ? "received" : "sent" }
78+ className = "max-w-[80%]"
7979 >
8080 { msg . role === "assistant" ? (
8181 < ChatBubbleAvatar fallback = "AI" />
@@ -97,20 +97,16 @@ export default function MessageBox({
9797 </ ChatBubble >
9898 ) }
9999 </ ChatMessageList >
100- </ AutoScroll >
101-
102- < div className = "relative mt-4" >
100+ </ div >
101+ < div className = "flex w-full items-center justify-between gap-2 rounded-lg border bg-background p-1" >
103102 < ChatInput
104103 value = { value }
105104 onChange = { ( e ) => setValue ( e . target . value ) }
106105 placeholder = "Type your message..."
107106 onEnter = { handleSend }
107+ className = "focus-visible:ringof min-h-10 resize-none border-0 bg-background shadow-none focus-visible:ring-0"
108108 />
109- < Button
110- onClick = { handleSend }
111- size = "default"
112- className = "absolute right-2 top-1/2 -translate-y-1/2"
113- >
109+ < Button onClick = { handleSend } size = "sm" className = "ml-auto mr-3" >
114110 Send < SendIcon />
115111 </ Button >
116112 </ div >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function useAutoScroll(options: UseAutoScrollOptions = {}) {
6767 setScrollState ( ( ) => ( {
6868 isAtBottom : atBottom ,
6969 // Re-enable auto-scroll if at the bottom
70- autoScrollEnabled : true //atBottom ? true : prev.autoScrollEnabled,
70+ autoScrollEnabled : true , //atBottom ? true : prev.autoScrollEnabled,
7171 } ) ) ;
7272 } , [ checkIsAtBottom ] ) ;
7373
@@ -120,7 +120,7 @@ export function useAutoScroll(options: UseAutoScrollOptions = {}) {
120120 userHasScrolled . current = true ;
121121 setScrollState ( ( prev ) => ( {
122122 ...prev ,
123- autoScrollEnabled : true //false,
123+ autoScrollEnabled : true , //false,
124124 } ) ) ;
125125 }
126126 } , [ checkIsAtBottom ] ) ;
You can’t perform that action at this time.
0 commit comments