@@ -672,7 +672,7 @@ class SessionsViewPane extends ViewPane {
672
672
if ( provider instanceof LocalChatSessionsProvider ) {
673
673
this . _register ( provider . onDidChange ( ( ) => {
674
674
if ( this . tree && this . isBodyVisible ( ) ) {
675
- this . tree . updateChildren ( this . provider ) ;
675
+ this . refreshTreeWithProgress ( ) ;
676
676
}
677
677
} ) ) ;
678
678
}
@@ -684,10 +684,34 @@ class SessionsViewPane extends ViewPane {
684
684
685
685
public refreshTree ( ) : void {
686
686
if ( this . tree && this . isBodyVisible ( ) ) {
687
- this . tree . updateChildren ( this . provider ) ;
687
+ this . refreshTreeWithProgress ( ) ;
688
688
}
689
689
}
690
690
691
+ private async refreshTreeWithProgress ( ) : Promise < void > {
692
+ if ( ! this . tree ) {
693
+ return ;
694
+ }
695
+
696
+ const progressIndicator = this . getProgressIndicator ( ) ;
697
+
698
+ // Show progress while refreshing tree data
699
+ const refreshPromise = this . tree . updateChildren ( this . provider ) ;
700
+ await progressIndicator . showWhile ( refreshPromise , 0 ) ; // Show immediately, no delay
701
+ }
702
+
703
+ private async loadDataWithProgress ( ) : Promise < void > {
704
+ if ( ! this . tree ) {
705
+ return ;
706
+ }
707
+
708
+ const progressIndicator = this . getProgressIndicator ( ) ;
709
+
710
+ // Show progress while loading data
711
+ const loadingPromise = this . tree . setInput ( this . provider ) ;
712
+ await progressIndicator . showWhile ( loadingPromise , 0 ) ; // Show immediately, no delay
713
+ }
714
+
691
715
protected override renderBody ( container : HTMLElement ) : void {
692
716
super . renderBody ( container ) ;
693
717
@@ -753,13 +777,13 @@ class SessionsViewPane extends ViewPane {
753
777
// Handle visibility changes to load data
754
778
this . _register ( this . onDidChangeBodyVisibility ( async visible => {
755
779
if ( visible && this . tree ) {
756
- await this . tree . setInput ( this . provider ) ;
780
+ await this . loadDataWithProgress ( ) ;
757
781
}
758
782
} ) ) ;
759
783
760
784
// Initially load data if visible
761
785
if ( this . isBodyVisible ( ) && this . tree ) {
762
- this . tree . setInput ( this . provider ) ;
786
+ this . loadDataWithProgress ( ) ;
763
787
}
764
788
}
765
789
0 commit comments