@@ -26,7 +26,7 @@ import { IViewContainersRegistry, IViewDescriptor, IViewDescriptorService, IView
26
26
import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js' ;
27
27
import { IViewsService } from '../../../services/views/common/viewsService.js' ;
28
28
import { CONTEXT_CHAT_EXTENSION_INVALID , CONTEXT_CHAT_PANEL_PARTICIPANT_REGISTERED , CONTEXT_CHAT_SHOULD_SHOW_MOVED_VIEW_WELCOME } from '../common/chatContextKeys.js' ;
29
- import { showChatView } from './chat.js' ;
29
+ import { CHAT_VIEW_ID , showChatView } from './chat.js' ;
30
30
import { CHAT_SIDEBAR_OLD_VIEW_PANEL_ID , CHAT_SIDEBAR_PANEL_ID } from './chatViewPane.js' ;
31
31
32
32
// TODO@bpasero TODO@sbatten remove after a few months
@@ -64,7 +64,7 @@ export class MoveChatViewContribution implements IWorkbenchContribution {
64
64
this . registerListeners ( ) ;
65
65
this . registerCommands ( ) ;
66
66
this . registerMovedChatWelcomeView ( ) ;
67
- this . hideViewIfOldViewIsInSecondarySidebar ( ) ;
67
+ this . hideViewIfOldViewIsMovedFromDefaultLocation ( ) ;
68
68
}
69
69
70
70
private markViewToHide ( ) : void {
@@ -80,7 +80,20 @@ export class MoveChatViewContribution implements IWorkbenchContribution {
80
80
}
81
81
}
82
82
83
- private hideViewIfOldViewIsInSecondarySidebar ( ) : void {
83
+ private hideViewIfOldViewIsMovedFromDefaultLocation ( ) : void {
84
+ // If the chat view is not actually moved to the new view container, then we should hide the welcome view.
85
+ const newViewContainer = this . viewDescriptorService . getViewContainerById ( CHAT_SIDEBAR_PANEL_ID ) ;
86
+ if ( ! newViewContainer ) {
87
+ return ;
88
+ }
89
+
90
+ const currentChatViewContainer = this . viewDescriptorService . getViewContainerByViewId ( CHAT_VIEW_ID ) ;
91
+ if ( currentChatViewContainer !== newViewContainer ) {
92
+ this . markViewToHide ( ) ;
93
+ return ;
94
+ }
95
+
96
+ // If the chat view is in the new location, but the old view container was in the auxiliary bar anyway, then we should hide the welcome view.
84
97
const oldViewContainer = this . viewDescriptorService . getViewContainerById ( CHAT_SIDEBAR_OLD_VIEW_PANEL_ID ) ;
85
98
if ( ! oldViewContainer ) {
86
99
return ;
0 commit comments