fix(forge): le parent quitte aussi le plein ecran avant l'assistant IA (BUG-056)
This commit is contained in:
+20
-5
@@ -649,11 +649,26 @@ export function init() {
|
||||
// #101 — Forge has no rich AI panel of its own: its AI button asks the
|
||||
// parent to open the shared AI Assistant (same provider/model, skills,
|
||||
// context and history).
|
||||
import('./bookslm.js').then(function(m) {
|
||||
if (m && m.default) m.default.openForCurrentContext();
|
||||
}).catch(function(err) {
|
||||
console.warn('[Forge] Unable to open AI assistant', err);
|
||||
});
|
||||
var openForgeAssistant = function() {
|
||||
import('./bookslm.js').then(function(m) {
|
||||
if (m && m.default) m.default.openForCurrentContext();
|
||||
}).catch(function(err) {
|
||||
console.warn('[Forge] Unable to open AI assistant', err);
|
||||
});
|
||||
};
|
||||
// BUG-056 — the assistant panel is mounted in this document. The native
|
||||
// fullscreen may be owned by the parent (Forge iframe) rather than by the
|
||||
// iframe itself, so the parent must also leave fullscreen before the
|
||||
// panel can be seen.
|
||||
if (document.fullscreenElement && document.exitFullscreen) {
|
||||
try {
|
||||
document.exitFullscreen().catch(function() {}).then(openForgeAssistant, openForgeAssistant);
|
||||
} catch (err) {
|
||||
openForgeAssistant();
|
||||
}
|
||||
} else {
|
||||
openForgeAssistant();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user