Fix banners: prepend inside #app instead of inserting before it as sibling

Co-authored-by: ChrisChrome <28414320+ChrisChrome@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-08-10 21:45:44 +00:00 committed by GitHub
parent 9f83832f7d
commit 4fe2552971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -613,7 +613,7 @@ function updateVerifyBanner(user) {
if (!appEl || !appEl.parentNode) return; if (!appEl || !appEl.parentNode) return;
const b = document.createElement('div'); const b = document.createElement('div');
b.id = 'verifyBanner'; b.id = 'verifyBanner';
b.style.cssText = 'background:var(--warning,#f59e0b);color:#1a1200;padding:9px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-left:var(--sidebar-width,220px)'; b.style.cssText = 'background:var(--warning,#f59e0b);color:#1a1200;padding:9px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap';
b.innerHTML = `<span>✉️ ${t('auth.verify_banner')}</span>`; b.innerHTML = `<span>✉️ ${t('auth.verify_banner')}</span>`;
const btn = document.createElement('button'); const btn = document.createElement('button');
btn.className = 'btn btn-sm'; btn.className = 'btn btn-sm';
@ -624,7 +624,7 @@ function updateVerifyBanner(user) {
catch { showToast(t('auth.verify_resend_failed'), 'error'); } catch { showToast(t('auth.verify_resend_failed'), 'error'); }
}); });
b.appendChild(btn); b.appendChild(btn);
appEl.parentNode.insertBefore(b, appEl); appEl.prepend(b);
} }
function updateWidgetSandboxWarningBanner(user) { function updateWidgetSandboxWarningBanner(user) {
@ -636,7 +636,7 @@ function updateWidgetSandboxWarningBanner(user) {
if (!appEl || !appEl.parentNode) return; if (!appEl || !appEl.parentNode) return;
const b = document.createElement('div'); const b = document.createElement('div');
b.id = 'widgetSandboxWarningBanner'; b.id = 'widgetSandboxWarningBanner';
b.style.cssText = 'background:var(--danger,#dc2626);color:#fff;padding:10px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;font-weight:600;margin-left:var(--sidebar-width,220px)'; b.style.cssText = 'background:var(--danger,#dc2626);color:#fff;padding:10px 16px;font-size:13px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;font-weight:600';
const text = document.createElement('span'); const text = document.createElement('span');
text.style.whiteSpace = 'pre-line'; text.style.whiteSpace = 'pre-line';
text.textContent = 'Widget sandbox isolation is DISABLED. Widget code in this organization runs\nwith full access to user sessions. Re-enable in Settings > Security.'; text.textContent = 'Widget sandbox isolation is DISABLED. Widget code in this organization runs\nwith full access to user sessions. Re-enable in Settings > Security.';
@ -646,7 +646,7 @@ function updateWidgetSandboxWarningBanner(user) {
link.style.cssText = 'color:#fff;text-decoration:underline;font-weight:700'; link.style.cssText = 'color:#fff;text-decoration:underline;font-weight:700';
b.appendChild(text); b.appendChild(text);
b.appendChild(link); b.appendChild(link);
appEl.parentNode.insertBefore(b, appEl); appEl.prepend(b);
} }
// Initialize // Initialize