release stashed session on blur (#227071)

* only show secondary toolbar on hover or when container contains focus

fixes https://github.com/microsoft/vscode/issues/226997

* release stashed session on blur

fixes https://github.com/microsoft/vscode-copilot/issues/7802
pull/199021/merge
Johannes Rieken 2024-08-29 14:59:12 +02:00 committed by GitHub
parent c2bd93fd92
commit 4443613b98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -263,7 +263,7 @@ export class StashedSession {
// keep session for a little bit, only release when user continues to work (type, move cursor, etc.)
this._session = session;
this._ctxHasStashedSession.set(true);
this._listener = Event.once(Event.any(editor.onDidChangeCursorSelection, editor.onDidChangeModelContent, editor.onDidChangeModel))(() => {
this._listener = Event.once(Event.any(editor.onDidChangeCursorSelection, editor.onDidChangeModelContent, editor.onDidChangeModel, editor.onDidBlurEditorWidget))(() => {
this._session = undefined;
this._sessionService.releaseSession(session);
this._ctxHasStashedSession.reset();

View File

@ -96,9 +96,9 @@ export class InlineChatWidget {
h('div.accessibleViewer@accessibleViewer'),
h('div.status@status', [
h('div.label.info.hidden@infoLabel'),
h('div.actions.button-style.hidden@toolbar1'),
h('div.actions.hidden@toolbar1'),
h('div.label.status.hidden@statusLabel'),
h('div.actions.button-style.hidden@toolbar2'),
h('div.actions.secondary.hidden@toolbar2'),
]),
]
);

View File

@ -171,6 +171,16 @@
gap: 4px;
}
.monaco-workbench .inline-chat .status .actions.secondary {
display: none;
}
.monaco-workbench .inline-chat .status:hover .actions.secondary,
.monaco-workbench .inline-chat:focus .status .actions.secondary,
.monaco-workbench .inline-chat .status:focus-within .actions.secondary {
display: inherit;
}
.monaco-workbench .inline-chat-diff-overlay {
.monaco-button {