Skip to content

Commit 4443613

Browse files
authored
release stashed session on blur (microsoft#227071)
* only show secondary toolbar on hover or when container contains focus fixes microsoft#226997 * release stashed session on blur fixes microsoft/vscode-copilot#7802
1 parent c2bd93f commit 4443613

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class StashedSession {
263263
// keep session for a little bit, only release when user continues to work (type, move cursor, etc.)
264264
this._session = session;
265265
this._ctxHasStashedSession.set(true);
266-
this._listener = Event.once(Event.any(editor.onDidChangeCursorSelection, editor.onDidChangeModelContent, editor.onDidChangeModel))(() => {
266+
this._listener = Event.once(Event.any(editor.onDidChangeCursorSelection, editor.onDidChangeModelContent, editor.onDidChangeModel, editor.onDidBlurEditorWidget))(() => {
267267
this._session = undefined;
268268
this._sessionService.releaseSession(session);
269269
this._ctxHasStashedSession.reset();

src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ export class InlineChatWidget {
9696
h('div.accessibleViewer@accessibleViewer'),
9797
h('div.status@status', [
9898
h('div.label.info.hidden@infoLabel'),
99-
h('div.actions.button-style.hidden@toolbar1'),
99+
h('div.actions.hidden@toolbar1'),
100100
h('div.label.status.hidden@statusLabel'),
101-
h('div.actions.button-style.hidden@toolbar2'),
101+
h('div.actions.secondary.hidden@toolbar2'),
102102
]),
103103
]
104104
);

src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@
171171
gap: 4px;
172172
}
173173

174+
.monaco-workbench .inline-chat .status .actions.secondary {
175+
display: none;
176+
}
177+
178+
.monaco-workbench .inline-chat .status:hover .actions.secondary,
179+
.monaco-workbench .inline-chat:focus .status .actions.secondary,
180+
.monaco-workbench .inline-chat .status:focus-within .actions.secondary {
181+
display: inherit;
182+
}
183+
174184
.monaco-workbench .inline-chat-diff-overlay {
175185

176186
.monaco-button {

0 commit comments

Comments
 (0)