@@ -194,6 +194,7 @@ export const ChatV2 = () => {
194
194
setMessage ( { content : '' } )
195
195
setPrevResponse ( { id : '' } )
196
196
setCompletion ( '' )
197
+ setIsCompletionDone ( true )
197
198
setFileSearchResult ( null )
198
199
setStreamController ( undefined )
199
200
setTokenUsageWarning ( '' )
@@ -207,6 +208,7 @@ export const ChatV2 = () => {
207
208
}
208
209
209
210
useEffect ( ( ) => {
211
+ // Keep this useEffect for autoscroll effect
210
212
if ( ! appContainerRef . current || ! conversationRef . current || ! settingsRef . current || messages . length === 0 ) return
211
213
212
214
const lastNode = conversationRef . current . lastElementChild as HTMLElement
@@ -218,7 +220,7 @@ export const ChatV2 = () => {
218
220
const containerRect = container . getBoundingClientRect ( )
219
221
const lastNodeRect = lastNode . getBoundingClientRect ( )
220
222
221
- const scrollTopPadding = 100
223
+ const scrollTopPadding = 180
222
224
const scrollOffset = lastNodeRect . top - containerRect . top + container . scrollTop - settingsHeight - scrollTopPadding
223
225
224
226
container . scrollTo ( {
@@ -239,7 +241,7 @@ export const ChatV2 = () => {
239
241
>
240
242
{ /* Course chats columns */ }
241
243
< Box sx = { { position : 'relative' , flex : 1 , borderRight : '1px solid lightgray' } } >
242
- < Box sx = { { position : 'sticky' , left : 0 , top : 0 , padding : '2rem 1.5rem' } } >
244
+ < Box sx = { { position : 'sticky' , top : 80 , padding : '2rem 1.5rem' } } >
243
245
< Typography variant = "h6" fontWeight = "light" >
244
246
Currechat
245
247
</ Typography >
@@ -267,7 +269,7 @@ export const ChatV2 = () => {
267
269
ref = { settingsRef }
268
270
sx = { {
269
271
position : 'sticky' ,
270
- top : 0 ,
272
+ top : 80 ,
271
273
display : 'flex' ,
272
274
justifyContent : 'center' ,
273
275
alignItems : 'center' ,
@@ -299,7 +301,6 @@ export const ChatV2 = () => {
299
301
height : '100%' ,
300
302
display : 'flex' ,
301
303
flexDirection : 'column' ,
302
- gap : 3 ,
303
304
width : '70%' ,
304
305
margin : 'auto' ,
305
306
paddingBottom : '5rem' ,
@@ -332,7 +333,7 @@ export const ChatV2 = () => {
332
333
{ /* Annotations columns */ }
333
334
< Box sx = { { flex : 1 , borderLeft : 'none' , position : 'relative' } } >
334
335
{ ragIndex && (
335
- < Box sx = { { position : 'sticky' , top : 0 } } >
336
+ < Box sx = { { position : 'sticky' , top : 80 } } >
336
337
< CitationsBox messages = { messages } fileSearchResult = { fileSearchResult } />
337
338
</ Box >
338
339
) }
0 commit comments