edit chat view: start editing session when created (#229975)

This commit is contained in:
Martin Aeschlimann 2024-09-27 17:19:10 +02:00 committed by GitHub
parent ec1125c2d1
commit 6be9a301e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -539,7 +539,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
const toolbarsContainer = elements.inputToolbars;
this.chatEditingSessionWidgetContainer = elements.chatEditingSessionWidgetContainer;
this.initAttachedContext(this.attachedContextContainer);
this.renderChatEditingSessionState(null, this.location === ChatAgentLocation.EditingSession);
this.renderChatEditingSessionState(null);
const inputScopedContextKeyService = this._register(this.contextKeyService.createScoped(inputContainer));
CONTEXT_IN_CHAT_INPUT.bindTo(inputScopedContextKeyService).set(true);

View file

@ -808,6 +808,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
}
}));
if (this._location.location === ChatAgentLocation.EditingSession) {
const currentSession = this.chatEditingService.currentEditingSession;
if (currentSession && (currentSession.chatSessionId !== model.sessionId)) {
currentSession?.stop();
}
this.chatEditingService.startOrContinueEditingSession(model.sessionId);
}
if (this.tree) {
this.onDidChangeItems();
revealLastElement(this.tree);