Skip to content

Commit 4661aa6

Browse files
authored
inline chat tweaks (microsoft#183520)
* move toggle diff btn into drop down menu * fix a few issues when restoring an IE session
1 parent bd3a8b6 commit 4661aa6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorActions.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ export class DiscardAction extends AbstractInteractiveEditorAction {
306306
},
307307
menu: {
308308
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
309+
group: '0_main',
309310
order: 0
310311
}
311312
});
@@ -330,6 +331,7 @@ export class DiscardToClipboardAction extends AbstractInteractiveEditorAction {
330331
// },
331332
menu: {
332333
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
334+
group: '0_main',
333335
order: 1
334336
}
335337
});
@@ -353,6 +355,7 @@ export class DiscardUndoToNewFileAction extends AbstractInteractiveEditorAction
353355
precondition: ContextKeyExpr.and(CTX_INTERACTIVE_EDITOR_VISIBLE, CTX_INTERACTIVE_EDITOR_DID_EDIT),
354356
menu: {
355357
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
358+
group: '0_main',
356359
order: 2
357360
}
358361
});
@@ -420,12 +423,12 @@ export class ToggleInlineDiff extends AbstractInteractiveEditorAction {
420423
title: localize('toggleDiff', 'Toggle Diff'),
421424
icon: Codicon.diff,
422425
precondition: ContextKeyExpr.and(CTX_INTERACTIVE_EDITOR_VISIBLE, CTX_INTERACTIVE_EDITOR_DID_EDIT),
423-
toggled: CTX_INTERACTIVE_EDITOR_SHOWING_DIFF,
426+
toggled: { condition: CTX_INTERACTIVE_EDITOR_SHOWING_DIFF, title: localize('toggleDiff2', "Show Inline Diff") },
424427
menu: {
425-
id: MENU_INTERACTIVE_EDITOR_WIDGET_STATUS,
428+
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
426429
when: CTX_INTERACTIVE_EDITOR_EDIT_MODE.notEqualsTo(EditMode.Preview),
427-
group: '0_main',
428-
order: 10
430+
group: '1_config',
431+
order: 9
429432
}
430433
});
431434
}

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export class InteractiveEditorController implements IEditorContribution {
257257

258258
this._zone.widget.updateSlashCommands(this._activeSession.session.slashCommands ?? []);
259259
this._zone.widget.placeholder = this._getPlaceholderText();
260+
this._zone.widget.value = this._activeSession.lastInput ?? '';
260261
this._zone.widget.updateInfo(this._activeSession.session.message ?? localize('welcome.1', "AI-generated code may be incorrect"));
261262
this._zone.show(this._activeSession.wholeRange.getEndPosition());
262263

@@ -558,6 +559,7 @@ export class InteractiveEditorController implements IEditorContribution {
558559
try {
559560
this._ignoreModelContentChanged = true;
560561
await this._strategy.renderChanges(response);
562+
this._ctxDidEdit.set(this._activeSession.hasChangedText);
561563
} finally {
562564
this._ignoreModelContentChanged = false;
563565
}

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorWidget.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ export class InteractiveEditorWidget {
424424
this._elements.statusToolbar.classList.toggle('hidden', !show);
425425
this._elements.feedbackToolbar.classList.toggle('hidden', !show);
426426
this._elements.status.classList.toggle('actions', show);
427+
this._elements.infoLabel.classList.toggle('hidden', show);
427428
this._onDidChangeHeight.fire();
428429
}
429430

0 commit comments

Comments
 (0)