mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-28 05:37:48 +01:00
Fixes rendering of response that is below the fold (#191337)
Steps: 1. ask `reverse a linked list` 2. scroll up right after hitting ENTER 3. wait for response to finish 4. scroll down the view should grow to the response.
This commit is contained in:
@@ -354,7 +354,15 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
templateData.contextKeyService));
|
||||
}
|
||||
|
||||
element.currentRenderedHeight = templateData.rowContainer.offsetHeight;
|
||||
const newHeight = templateData.rowContainer.offsetHeight;
|
||||
const fireEvent = !element.currentRenderedHeight || element.currentRenderedHeight !== newHeight;
|
||||
element.currentRenderedHeight = newHeight;
|
||||
if (fireEvent) {
|
||||
const disposable = this._register(dom.scheduleAtNextAnimationFrame(() => {
|
||||
disposable.dispose();
|
||||
this._onDidChangeItemHeight.fire({ element, height: newHeight });
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private renderWelcomeMessage(element: IChatWelcomeMessageViewModel, templateData: IChatListItemTemplate) {
|
||||
@@ -381,7 +389,15 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
}
|
||||
}
|
||||
|
||||
element.currentRenderedHeight = templateData.rowContainer.offsetHeight;
|
||||
const newHeight = templateData.rowContainer.offsetHeight;
|
||||
const fireEvent = !element.currentRenderedHeight || element.currentRenderedHeight !== newHeight;
|
||||
element.currentRenderedHeight = newHeight;
|
||||
if (fireEvent) {
|
||||
const disposable = this._register(dom.scheduleAtNextAnimationFrame(() => {
|
||||
disposable.dispose();
|
||||
this._onDidChangeItemHeight.fire({ element, height: newHeight });
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -530,7 +530,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
||||
this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode()));
|
||||
}
|
||||
|
||||
layoutDynamicChatTreeItemMode(allowRecurse = true): void {
|
||||
layoutDynamicChatTreeItemMode(): void {
|
||||
if (!this.viewModel) {
|
||||
return;
|
||||
}
|
||||
@@ -554,10 +554,9 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
||||
this.container.offsetWidth
|
||||
);
|
||||
|
||||
if (needsRerender && allowRecurse) {
|
||||
if (needsRerender) {
|
||||
// TODO: figure out a better place to reveal the last element
|
||||
revealLastElement(this.tree);
|
||||
this.layoutDynamicChatTreeItemMode(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user