Skip to content

Commit 73f7941

Browse files
authored
more generous minHeight when showing diffs/edits (microsoft#211273)
fixes microsoft/vscode-copilot#5146
1 parent 56b142e commit 73f7941

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,20 @@ export class InlineChatWidget {
383383
}
384384

385385
get minHeight(): number {
386-
// The chat widget is variable height and supports scrolling. It
387-
// should be at least 100px high and at most the content height.
386+
// The chat widget is variable height and supports scrolling. It should be
387+
// at least "maxWidgetHeight" high and at most the content height.
388+
389+
let maxWidgetHeight = 100;
390+
for (const item of this._chatWidget.viewModel?.getItems() ?? []) {
391+
if (isResponseVM(item) && item.response.value.some(r => r.kind === 'textEditGroup' && !r.state?.applied)) {
392+
maxWidgetHeight = 270;
393+
break;
394+
}
395+
}
396+
388397
let value = this.contentHeight;
389398
value -= this._chatWidget.contentHeight;
390-
value += Math.min(100, this._chatWidget.contentHeight);
399+
value += Math.min(maxWidgetHeight, this._chatWidget.contentHeight);
391400
return value;
392401
}
393402

0 commit comments

Comments
 (0)