Skip to content

Commit 149db50

Browse files
authored
Fix disappearing chat response (microsoft#182347)
Weird issue, maybe a browser bug, but the dynamic height calculation in the list sometimes sets the height of an item to 0 when rendering it right after toggling the sidebar to visible.
1 parent 537676c commit 149db50

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ export class InteractiveSessionWidget extends Disposable implements IInteractive
206206
this.renderer.setVisible(visible);
207207

208208
if (visible) {
209-
// Progressive rendering paused while hidden, so start it up again
210-
this.onDidChangeItems();
209+
setTimeout(() => {
210+
// Progressive rendering paused while hidden, so start it up again.
211+
// Do it after a timeout because the container is not visible yet (it should be but offsetHeight returns 0 here)
212+
if (this.visible) {
213+
this.onDidChangeItems();
214+
}
215+
}, 0);
211216
}
212217
}
213218

@@ -340,6 +345,7 @@ export class InteractiveSessionWidget extends Disposable implements IInteractive
340345
throw new Error('Call render() before setModel()');
341346
}
342347

348+
this.container.setAttribute('data-session-id', model.sessionId);
343349
this.viewModel = this.instantiationService.createInstance(InteractiveSessionViewModel, model);
344350
this.viewModelDisposables.add(this.viewModel.onDidChange(() => {
345351
this.slashCommandsPromise = undefined;

0 commit comments

Comments
 (0)