@@ -12,7 +12,6 @@ import {
12
12
useCallback ,
13
13
useContext ,
14
14
useEffect ,
15
- useMemo ,
16
15
useRef ,
17
16
useState ,
18
17
} from "react" ;
@@ -150,16 +149,16 @@ export function Chat() {
150
149
useHistory ( dispatch ) ;
151
150
152
151
const scrollToBottom = useCallback ( ( ) => {
153
- if ( ! topGuiDivRef . current ) return
152
+ if ( ! topGuiDivRef . current ) return ;
154
153
const elem = topGuiDivRef . current ;
155
154
elem . scrollTop = elem . scrollHeight - elem . clientHeight ;
156
155
157
156
setIsAtBottom ( true ) ;
158
- } , [ topGuiDivRef , setIsAtBottom ] )
157
+ } , [ topGuiDivRef , setIsAtBottom ] ) ;
159
158
160
159
useEffect ( ( ) => {
161
- if ( active ) scrollToBottom ( )
162
- } , [ active , scrollToBottom ] )
160
+ if ( active ) scrollToBottom ( ) ;
161
+ } , [ active , scrollToBottom ] ) ;
163
162
164
163
useEffect ( ( ) => {
165
164
// Cmd + Backspace to delete current step
@@ -314,7 +313,7 @@ export function Chat() {
314
313
return (
315
314
< >
316
315
< TopGuiDiv
317
- className = { `${ state . history . length > 0 ? ' h-full' : '' } ` }
316
+ className = { `${ state . history . length > 0 ? " h-full" : "" } ` }
318
317
ref = { topGuiDivRef }
319
318
onScroll = { handleScroll }
320
319
showScrollbar = { state . config . ui ?. showChatScrollbar || false }
@@ -371,7 +370,7 @@ export function Chat() {
371
370
: true
372
371
: stepsOpen [ index ] !
373
372
}
374
- onToggle = { ( ) => { } }
373
+ onToggle = { ( ) => { } }
375
374
>
376
375
< StepContainer
377
376
index = { index }
@@ -383,14 +382,14 @@ export function Chat() {
383
382
: stepsOpen [ index ] !
384
383
}
385
384
key = { index }
386
- onUserInput = { ( input : string ) => { } }
385
+ onUserInput = { ( input : string ) => { } }
387
386
item = { item }
388
- onReverse = { ( ) => { } }
387
+ onReverse = { ( ) => { } }
389
388
onRetry = { ( ) => {
390
389
streamResponse (
391
390
state . history [ index - 1 ] . editorState ,
392
391
state . history [ index - 1 ] . modifiers ??
393
- defaultInputModifiers ,
392
+ defaultInputModifiers ,
394
393
ideMessenger ,
395
394
index - 1 ,
396
395
) ;
@@ -427,8 +426,7 @@ export function Chat() {
427
426
/>
428
427
</ TopGuiDiv >
429
428
430
-
431
- < div className = { `relative ${ state . history . length > 0 ? 'pt-1 border-0 border-t border-solid border-t-zinc-700' : '' } ` } >
429
+ < div className = { `relative` } >
432
430
< div className = "absolute -top-8 right-2 z-30" >
433
431
{ ttsActive && (
434
432
< StopButton
@@ -463,10 +461,12 @@ export function Chat() {
463
461
sendInput ( editorContent , modifiers ) ;
464
462
} }
465
463
/>
466
- < div style = { {
467
- // opacity: active ? 0 : 1,
468
- pointerEvents : active ? 'none' : 'auto' ,
469
- } } >
464
+ < div
465
+ style = { {
466
+ // opacity: active ? 0 : 1,
467
+ pointerEvents : active ? "none" : "auto" ,
468
+ } }
469
+ >
470
470
{ state . history . length > 0 ? (
471
471
< div className = "xs:inline mt-2 hidden" >
472
472
< NewSessionButton
@@ -516,4 +516,3 @@ export function Chat() {
516
516
</ >
517
517
) ;
518
518
}
519
-
0 commit comments