3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { $ } from '../../../../base/browser/dom.js' ;
6
+ import { $ , getWindow } from '../../../../base/browser/dom.js' ;
7
7
import { CancellationToken } from '../../../../base/common/cancellation.js' ;
8
8
import { DisposableStore } from '../../../../base/common/lifecycle.js' ;
9
9
import { MarshalledId } from '../../../../base/common/marshallingIds.js' ;
@@ -14,6 +14,7 @@ import { IHoverService } from '../../../../platform/hover/browser/hover.js';
14
14
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js' ;
15
15
import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js' ;
16
16
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js' ;
17
+ import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js' ;
17
18
import { ILogService } from '../../../../platform/log/common/log.js' ;
18
19
import { IOpenerService } from '../../../../platform/opener/common/opener.js' ;
19
20
import { IStorageService , StorageScope , StorageTarget } from '../../../../platform/storage/common/storage.js' ;
@@ -67,6 +68,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
67
68
@IChatService private readonly chatService : IChatService ,
68
69
@IChatAgentService private readonly chatAgentService : IChatAgentService ,
69
70
@ILogService private readonly logService : ILogService ,
71
+ @ILayoutService private readonly layoutService : ILayoutService ,
70
72
) {
71
73
super ( options , keybindingService , contextMenuService , configurationService , contextKeyService , viewDescriptorService , instantiationService , openerService , themeService , telemetryService , hoverService ) ;
72
74
@@ -164,7 +166,9 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
164
166
165
167
const scopedInstantiationService = this . _register ( this . instantiationService . createChild ( new ServiceCollection ( [ IContextKeyService , this . scopedContextKeyService ] ) ) ) ;
166
168
const locationBasedColors = this . getLocationBasedColors ( ) ;
167
- const editorOverflowNode = $ ( '.chat-editor-overflow-widgets' ) ;
169
+ const editorOverflowNode = this . layoutService . getContainer ( getWindow ( parent ) ) . appendChild ( $ ( '.chat-editor-overflow.monaco-editor' ) ) ;
170
+ this . _register ( { dispose : ( ) => editorOverflowNode . remove ( ) } ) ;
171
+
168
172
this . _widget = this . _register ( scopedInstantiationService . createInstance (
169
173
ChatWidget ,
170
174
this . chatOptions . location ,
@@ -181,7 +185,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
181
185
} ,
182
186
} ,
183
187
enableImplicitContext : this . chatOptions . location === ChatAgentLocation . Panel ,
184
- // editorOverflowWidgetsDomNode: editorOverflowNode,
188
+ editorOverflowWidgetsDomNode : editorOverflowNode ,
185
189
} ,
186
190
{
187
191
listForeground : SIDE_BAR_FOREGROUND ,
@@ -196,7 +200,6 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
196
200
} ) ) ;
197
201
this . _register ( this . _widget . onDidClear ( ( ) => this . clear ( ) ) ) ;
198
202
this . _widget . render ( parent ) ;
199
- parent . appendChild ( editorOverflowNode ) ;
200
203
201
204
const sessionId = this . getSessionId ( ) ;
202
205
const disposeListener = this . _register ( this . chatService . onDidDisposeSession ( ( e ) => {
0 commit comments