Skip to content

Commit

Permalink
edit chat view: start editing session when created (#229975)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored Sep 27, 2024
1 parent ec1125c commit 6be9a30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/vs/workbench/contrib/chat/browser/chatWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6be9a30

Please sign in to comment.