Skip to content

Commit 039b350

Browse files
authored
Fix chat editor overflow (microsoft#235212)
* Fix chat overflow Use layout service instead Fixes microsoft#234902 * Use `getContainer`
1 parent c59c59b commit 039b350

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/vs/workbench/contrib/chat/browser/chatViewPane.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { $ } from '../../../../base/browser/dom.js';
6+
import { $, getWindow } from '../../../../base/browser/dom.js';
77
import { CancellationToken } from '../../../../base/common/cancellation.js';
88
import { DisposableStore } from '../../../../base/common/lifecycle.js';
99
import { MarshalledId } from '../../../../base/common/marshallingIds.js';
@@ -14,6 +14,7 @@ import { IHoverService } from '../../../../platform/hover/browser/hover.js';
1414
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
1515
import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';
1616
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
17+
import { ILayoutService } from '../../../../platform/layout/browser/layoutService.js';
1718
import { ILogService } from '../../../../platform/log/common/log.js';
1819
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
1920
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
@@ -67,6 +68,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
6768
@IChatService private readonly chatService: IChatService,
6869
@IChatAgentService private readonly chatAgentService: IChatAgentService,
6970
@ILogService private readonly logService: ILogService,
71+
@ILayoutService private readonly layoutService: ILayoutService,
7072
) {
7173
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
7274

@@ -164,7 +166,9 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
164166

165167
const scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
166168
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+
168172
this._widget = this._register(scopedInstantiationService.createInstance(
169173
ChatWidget,
170174
this.chatOptions.location,
@@ -181,7 +185,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
181185
},
182186
},
183187
enableImplicitContext: this.chatOptions.location === ChatAgentLocation.Panel,
184-
// editorOverflowWidgetsDomNode: editorOverflowNode,
188+
editorOverflowWidgetsDomNode: editorOverflowNode,
185189
},
186190
{
187191
listForeground: SIDE_BAR_FOREGROUND,
@@ -196,7 +200,6 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
196200
}));
197201
this._register(this._widget.onDidClear(() => this.clear()));
198202
this._widget.render(parent);
199-
parent.appendChild(editorOverflowNode);
200203

201204
const sessionId = this.getSessionId();
202205
const disposeListener = this._register(this.chatService.onDidDisposeSession((e) => {

0 commit comments

Comments
 (0)