Skip to content

Commit 02cbb7a

Browse files
authored
Merge pull request microsoft#218417 from microsoft/tyriar/216624
Fix terminalChatFocus behavior
2 parents 18981d2 + c6e312a commit 02cbb7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,14 @@ export class TerminalChatWidget extends Disposable {
9696
this._container.appendChild(this._inlineChatWidget.domNode);
9797

9898
this._focusTracker = this._register(trackFocus(this._container));
99+
this._register(this._focusTracker.onDidFocus(() => this._focusedContextKey.set(true)));
99100
this._register(this._focusTracker.onDidBlur(() => {
101+
this._focusedContextKey.set(false);
100102
if (!this.inlineChatWidget.responseContent) {
101103
this.hide();
102104
}
103105
}));
106+
104107
this.hide();
105108
}
106109

@@ -150,7 +153,6 @@ export class TerminalChatWidget extends Disposable {
150153
reveal(): void {
151154
this._doLayout(this._inlineChatWidget.contentHeight);
152155
this._container.classList.remove('hide');
153-
this._focusedContextKey.set(true);
154156
this._visibleContextKey.set(true);
155157
this._inlineChatWidget.focus();
156158
this._instance.scrollToBottom();
@@ -199,7 +201,6 @@ export class TerminalChatWidget extends Disposable {
199201
this._inlineChatWidget.updateChatMessage(undefined);
200202
this._inlineChatWidget.updateProgress(false);
201203
this._inlineChatWidget.updateToolbar(false);
202-
this._focusedContextKey.set(false);
203204
this._visibleContextKey.set(false);
204205
this._inlineChatWidget.value = '';
205206
this._instance.focus();

0 commit comments

Comments
 (0)