Skip to content

Commit b299fed

Browse files
authored
show error details of failed requests in v2 UI (#279959)
re #278065
1 parent a1fc464 commit b299fed

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,21 +1443,29 @@ export class InlineChatController2 implements IEditorContribution {
14431443
this._store.add(autorun(r => {
14441444
const response = lastResponseObs.read(r);
14451445

1446+
this._zone.value.widget.updateInfo('');
1447+
14461448
if (!response?.isInProgress.read(r)) {
1449+
1450+
if (response?.result?.errorDetails) {
1451+
// ERROR case
1452+
this._zone.value.widget.updateInfo(`$(error) ${response.result.errorDetails.message}`);
1453+
alert(response.result.errorDetails.message);
1454+
}
1455+
14471456
// no response or not in progress
14481457
this._zone.value.widget.domNode.classList.toggle('request-in-progress', false);
14491458
this._zone.value.widget.chatWidget.setInputPlaceholder(localize('placeholder', "Edit, refactor, and generate code"));
1450-
return;
1451-
}
1452-
1453-
this._zone.value.widget.domNode.classList.toggle('request-in-progress', true);
1454-
let placeholder = response.request?.message.text;
14551459

1456-
const lastProgress = lastResponseProgressObs.read(r);
1457-
if (lastProgress) {
1458-
placeholder = renderAsPlaintext(lastProgress.content);
1460+
} else {
1461+
this._zone.value.widget.domNode.classList.toggle('request-in-progress', true);
1462+
let placeholder = response.request?.message.text;
1463+
const lastProgress = lastResponseProgressObs.read(r);
1464+
if (lastProgress) {
1465+
placeholder = renderAsPlaintext(lastProgress.content);
1466+
}
1467+
this._zone.value.widget.chatWidget.setInputPlaceholder(placeholder || localize('loading', "Working..."));
14591468
}
1460-
this._zone.value.widget.chatWidget.setInputPlaceholder(placeholder || localize('loading', "Working..."));
14611469

14621470
}));
14631471

src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
.monaco-workbench .inline-chat > .status {
192192
.label,
193193
.actions {
194-
padding-top: 8px;
194+
padding: 4px 0;
195195
}
196196
}
197197

@@ -202,14 +202,13 @@
202202
.monaco-workbench .inline-chat .status .label {
203203
overflow: hidden;
204204
color: var(--vscode-descriptionForeground);
205-
font-size: 11px;
205+
font-size: 12px;
206206
display: flex;
207207
white-space: nowrap;
208208
}
209209

210210
.monaco-workbench .inline-chat .status .label.info {
211211
margin-right: auto;
212-
padding-left: 2px;
213212
}
214213

215214
.monaco-workbench .inline-chat .status .label.status {

0 commit comments

Comments
 (0)