mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
inline chat tweaks (#183520)
* move toggle diff btn into drop down menu * fix a few issues when restoring an IE session
This commit is contained in:
parent
bd3a8b6eb5
commit
4661aa6e09
|
@ -306,6 +306,7 @@ export class DiscardAction extends AbstractInteractiveEditorAction {
|
|||
},
|
||||
menu: {
|
||||
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
|
||||
group: '0_main',
|
||||
order: 0
|
||||
}
|
||||
});
|
||||
|
@ -330,6 +331,7 @@ export class DiscardToClipboardAction extends AbstractInteractiveEditorAction {
|
|||
// },
|
||||
menu: {
|
||||
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
|
||||
group: '0_main',
|
||||
order: 1
|
||||
}
|
||||
});
|
||||
|
@ -353,6 +355,7 @@ export class DiscardUndoToNewFileAction extends AbstractInteractiveEditorAction
|
|||
precondition: ContextKeyExpr.and(CTX_INTERACTIVE_EDITOR_VISIBLE, CTX_INTERACTIVE_EDITOR_DID_EDIT),
|
||||
menu: {
|
||||
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
|
||||
group: '0_main',
|
||||
order: 2
|
||||
}
|
||||
});
|
||||
|
@ -420,12 +423,12 @@ export class ToggleInlineDiff extends AbstractInteractiveEditorAction {
|
|||
title: localize('toggleDiff', 'Toggle Diff'),
|
||||
icon: Codicon.diff,
|
||||
precondition: ContextKeyExpr.and(CTX_INTERACTIVE_EDITOR_VISIBLE, CTX_INTERACTIVE_EDITOR_DID_EDIT),
|
||||
toggled: CTX_INTERACTIVE_EDITOR_SHOWING_DIFF,
|
||||
toggled: { condition: CTX_INTERACTIVE_EDITOR_SHOWING_DIFF, title: localize('toggleDiff2', "Show Inline Diff") },
|
||||
menu: {
|
||||
id: MENU_INTERACTIVE_EDITOR_WIDGET_STATUS,
|
||||
id: MENU_INTERACTIVE_EDITOR_WIDGET_DISCARD,
|
||||
when: CTX_INTERACTIVE_EDITOR_EDIT_MODE.notEqualsTo(EditMode.Preview),
|
||||
group: '0_main',
|
||||
order: 10
|
||||
group: '1_config',
|
||||
order: 9
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -257,6 +257,7 @@ export class InteractiveEditorController implements IEditorContribution {
|
|||
|
||||
this._zone.widget.updateSlashCommands(this._activeSession.session.slashCommands ?? []);
|
||||
this._zone.widget.placeholder = this._getPlaceholderText();
|
||||
this._zone.widget.value = this._activeSession.lastInput ?? '';
|
||||
this._zone.widget.updateInfo(this._activeSession.session.message ?? localize('welcome.1', "AI-generated code may be incorrect"));
|
||||
this._zone.show(this._activeSession.wholeRange.getEndPosition());
|
||||
|
||||
|
@ -558,6 +559,7 @@ export class InteractiveEditorController implements IEditorContribution {
|
|||
try {
|
||||
this._ignoreModelContentChanged = true;
|
||||
await this._strategy.renderChanges(response);
|
||||
this._ctxDidEdit.set(this._activeSession.hasChangedText);
|
||||
} finally {
|
||||
this._ignoreModelContentChanged = false;
|
||||
}
|
||||
|
|
|
@ -424,6 +424,7 @@ export class InteractiveEditorWidget {
|
|||
this._elements.statusToolbar.classList.toggle('hidden', !show);
|
||||
this._elements.feedbackToolbar.classList.toggle('hidden', !show);
|
||||
this._elements.status.classList.toggle('actions', show);
|
||||
this._elements.infoLabel.classList.toggle('hidden', show);
|
||||
this._onDidChangeHeight.fire();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue