mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
Inline chat v2 UI work (#274338)
* disable auto-accept for inline chat * hide inline chat via ESC more * inline - render picker below input * remove unneccessary v2 actions * fix `Enter` to only accept from input when there is no new text typed * custom placeholder, use prompt as placeholder while request is on * no min width for inline chat widget
This commit is contained in:
@@ -1324,7 +1324,7 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
enableWorkingSet: 'implicit',
|
||||
enableImplicitContext: false,
|
||||
renderInputOnTop: false,
|
||||
renderStyle: 'compact',
|
||||
renderInputToolbarBelowInput: true,
|
||||
filter: _item => false, // filter ALL items
|
||||
menus: {
|
||||
telemetrySource: 'inlineChatWidget',
|
||||
@@ -1398,8 +1398,8 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
|
||||
this._store.add(autorun(r => {
|
||||
|
||||
// HIDE/SHOW
|
||||
const session = visibleSessionObs.read(r);
|
||||
|
||||
if (!session) {
|
||||
this._zone.rawValue?.hide();
|
||||
_editor.focus();
|
||||
@@ -1413,10 +1413,25 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
}
|
||||
this._zone.value.reveal(this._zone.value.position!);
|
||||
this._zone.value.widget.focus();
|
||||
const entry = session.editingSession.getEntry(session.uri);
|
||||
}
|
||||
}));
|
||||
|
||||
entry?.autoAcceptController.read(undefined)?.cancel();
|
||||
this._store.add(autorun(r => {
|
||||
const session = visibleSessionObs.read(r);
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
const entry = session.editingSession.readEntry(session.uri, r);
|
||||
entry?.enableReviewModeUntilSettled();
|
||||
|
||||
const inProgress = session.chatModel.requestInProgressObs.read(r);
|
||||
this._zone.value.widget.domNode.classList.toggle('request-in-progress', inProgress);
|
||||
if (!inProgress) {
|
||||
this._zone.value.widget.chatWidget.setInputPlaceholder(localize('placeholder', "Edit, refactor, and generate code"));
|
||||
} else {
|
||||
const prompt = session.chatModel.getRequests().at(-1)?.message.text;
|
||||
this._zone.value.widget.chatWidget.setInputPlaceholder(prompt || localize('loading', "Working..."));
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user