File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default function Page() {
5252 return (
5353 < main data-lk-theme = "default" className = "h-full grid content-center bg-[var(--lk-bg)]" >
5454 < RoomContext . Provider value = { room } >
55- < div className = "lk-room-container" >
55+ < div className = "lk-room-container max-h-[90vh] " >
5656 < SimpleVoiceAssistant onConnectButtonClicked = { onConnectButtonClicked } />
5757 </ div >
5858 </ RoomContext . Provider >
@@ -77,7 +77,7 @@ function SimpleVoiceAssistant(props: { onConnectButtonClicked: () => void }) {
7777 Start a conversation
7878 </ motion . button >
7979 ) }
80- < div className = "w-3/4 lg:w-1/2 mx-auto" >
80+ < div className = "w-3/4 lg:w-1/2 mx-auto h-full " >
8181 < TranscriptionView />
8282 </ div >
8383 </ AnimatePresence >
Original file line number Diff line number Diff line change 11import useCombinedTranscriptions from "@/hooks/useCombinedTranscriptions" ;
2+ import * as React from "react" ;
23
34export default function TranscriptionView ( ) {
45 const combinedTranscriptions = useCombinedTranscriptions ( ) ;
56
7+ // scroll to bottom when new transcription is added
8+ React . useEffect ( ( ) => {
9+ const transcription = combinedTranscriptions [ combinedTranscriptions . length - 1 ] ;
10+ if ( transcription ) {
11+ const transcriptionElement = document . getElementById ( transcription . id ) ;
12+ if ( transcriptionElement ) {
13+ transcriptionElement . scrollIntoView ( { behavior : "smooth" } ) ;
14+ }
15+ }
16+ } , [ combinedTranscriptions ] ) ;
17+
618 return (
7- < div className = "flex flex-col gap-2 overflow-y-auto" >
19+ < div className = "h-full flex flex-col gap-2 overflow-y-auto" >
820 { combinedTranscriptions . map ( ( segment ) => (
921 < div
22+ id = { segment . id }
1023 key = { segment . id }
1124 className = {
1225 segment . role === "assistant"
You can’t perform that action at this time.
0 commit comments