File tree 2 files changed +13
-0
lines changed
extensions/vscode/e2e/tests
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,8 @@ describe("GUI Test", () => {
400
400
GUISelectors . getThreadMessageByText ( view , llmResponse ) ,
401
401
) ;
402
402
403
+ await new Promise ( resolve => setTimeout ( resolve , 500 ) ) ;
404
+
403
405
const viewportHeight = await driver . executeScript (
404
406
"return window.innerHeight" ,
405
407
) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,17 @@ export const useAutoScroll = (
9
9
useEffect ( ( ) => {
10
10
if ( history . length ) {
11
11
setUserHasScrolled ( false ) ;
12
+ if ( ref . current ) {
13
+ // smooth scroll to the bottom of the chat
14
+ ref . current . style . scrollBehavior = "smooth" ;
15
+ ref . current . scrollTop = ref . current . scrollHeight ;
16
+
17
+ // use 100 ms delay to scroll to restore the scroll and wait for the chat to be scrolled
18
+ const timer = setTimeout ( ( ) => {
19
+ ref . current ! . style . scrollBehavior = "auto" ;
20
+ clearTimeout ( timer ) ;
21
+ } , 100 ) ;
22
+ }
12
23
}
13
24
} , [ history . length ] ) ;
14
25
You can’t perform that action at this time.
0 commit comments