Skip to content

Commit 343e7c3

Browse files
authored
Avoid unnecessary layouts while typing in chat input (#286935)
* Don't relayout the chat widget when typing in the input Fix #286531 This was added to rerender the working set to show file attachments in it, but we don't do that anymore * Possibly more ambitious change but both of these seem redundnat
1 parent 9d9e881 commit 343e7c3

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,9 @@ export class ChatWidget extends Disposable implements IChatWidget {
493493
this._editingSession.set(undefined, undefined);
494494
this.renderChatEditingSessionState();
495495
}));
496-
r.store.add(this.onDidChangeParsedInput(() => {
497-
this.renderChatEditingSessionState();
498-
}));
499496
r.store.add(this.inputEditor.onDidChangeModelContent(() => {
500497
if (this.getInput() === '') {
501498
this.refreshParsedInput();
502-
this.renderChatEditingSessionState();
503499
}
504500
}));
505501
this.renderChatEditingSessionState();
@@ -1211,10 +1207,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
12111207
return;
12121208
}
12131209
this.input.renderChatEditingSessionState(this._editingSession.get() ?? null);
1214-
1215-
if (this.bodyDimension) {
1216-
this.layout(this.bodyDimension.height, this.bodyDimension.width);
1217-
}
12181210
}
12191211

12201212
private async renderFollowups(): Promise<void> {
@@ -2045,10 +2037,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
20452037
this.scrollToEnd();
20462038
}
20472039
})));
2048-
this.viewModelDisposables.add(autorun(reader => {
2049-
this._editingSession.read(reader); // re-render when the session changes
2050-
this.renderChatEditingSessionState();
2051-
}));
20522040
this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(() => {
20532041
// Ensure that view state is saved here, because we will load it again when a new model is assigned
20542042
if (this.viewModel?.editing) {

0 commit comments

Comments
 (0)