fix(forge): quitter le plein ecran avant d'ouvrir l'assistant IA (BUG-056)
CI / lint (push) Successful in 1m33s
CI / security (push) Successful in 1m0s
CI / test (push) Successful in 3m7s
CI / build (push) Successful in 57s
CI / e2e (push) Successful in 10m56s

This commit is contained in:
2026-09-17 09:07:00 -04:00
parent 8b09093aca
commit 3758db2861
12 changed files with 54 additions and 16 deletions
+17 -3
View File
@@ -1200,9 +1200,23 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
// iframe, so the AI button simply asks the parent to open it — no duplicated
// panel, and the configured provider/model is shared automatically.
function openAssistant() {
try {
window.parent.postMessage({ type: 'forge-open-ai' }, '*');
} catch (e) { /* not embedded */ }
var notify = function() {
try {
window.parent.postMessage({ type: 'forge-open-ai' }, '*');
} catch (e) { /* not embedded */ }
};
// The shared assistant lives in the parent document, which cannot render
// above a fullscreen Forge iframe: leave fullscreen first so the panel is
// actually visible when it opens.
if (document.fullscreenElement && document.exitFullscreen) {
try {
var p = document.exitFullscreen();
if (p && p.then) p.then(notify, notify);
else notify();
} catch (e) { notify(); }
} else {
notify();
}
}
// ---- Fullscreen (#101) ----