hide inline chat affordance when editor loses focus (#299716)

Fixes #299616
This commit is contained in:
Johannes Rieken
2026-03-06 11:27:46 +01:00
committed by GitHub
parent e528731081
commit 80c418069f

View File

@@ -120,6 +120,13 @@ export class InlineChatAffordance extends Disposable {
selectionData.set(undefined, undefined);
}));
// Hide when the editor loses focus (e.g., switching tabs in notebooks)
this._store.add(autorun(r => {
if (!editorObs.isFocused.read(r)) {
selectionData.set(undefined, undefined);
}
}));
this._store.add(autorun(r => {
const sel = selectionData.read(r);
const mode = affordance.read(r);