From 1e278ea373c72b1a2ed31093287ff81b6b9e8bab Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 10 Aug 2026 21:56:03 +0000
Subject: [PATCH] Fix banner persistence across view switches and modal scroll
on open
Co-authored-by: ChrisChrome <28414320+ChrisChrome@users.noreply.github.com>
---
frontend/css/main.css | 1 +
frontend/index.html | 2 ++
frontend/js/app.js | 12 ++++++------
frontend/js/components/type-to-confirm-modal.js | 2 +-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/frontend/css/main.css b/frontend/css/main.css
index 5956950..80fe9b7 100644
--- a/frontend/css/main.css
+++ b/frontend/css/main.css
@@ -1505,6 +1505,7 @@ body {
.sidebar-backdrop.open { display: block; }
.nav-link { min-height: 44px; padding: 10px 14px; }
.content { margin-left: 0; padding: 16px; padding-top: 68px; }
+ #banners { margin-left: 0; }
.page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
.device-grid { grid-template-columns: 1fr; }
.content-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
diff --git a/frontend/index.html b/frontend/index.html
index d8bf22c..ec99fdb 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -174,6 +174,8 @@
+
+
diff --git a/frontend/js/app.js b/frontend/js/app.js
index 6b2da45..d013459 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -609,8 +609,8 @@ function updateVerifyBanner(user) {
const unverified = user && user.email_verified === 0 && user.auth_provider === 'local';
if (!unverified) { if (existing) existing.remove(); return; }
if (existing) return;
- const appEl = document.getElementById('app');
- if (!appEl || !appEl.parentNode) return;
+ const bannersEl = document.getElementById('banners');
+ if (!bannersEl) return;
const b = document.createElement('div');
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';
@@ -624,7 +624,7 @@ function updateVerifyBanner(user) {
catch { showToast(t('auth.verify_resend_failed'), 'error'); }
});
b.appendChild(btn);
- appEl.prepend(b);
+ bannersEl.appendChild(b);
}
function updateWidgetSandboxWarningBanner(user) {
@@ -632,8 +632,8 @@ function updateWidgetSandboxWarningBanner(user) {
const disabled = !!user?.current_organization?.widget_sandbox_isolation_disabled;
if (!disabled) { if (existing) existing.remove(); return; }
if (existing) return;
- const appEl = document.getElementById('app');
- if (!appEl || !appEl.parentNode) return;
+ const bannersEl = document.getElementById('banners');
+ if (!bannersEl) return;
const b = document.createElement('div');
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';
@@ -646,7 +646,7 @@ function updateWidgetSandboxWarningBanner(user) {
link.style.cssText = 'color:#fff;text-decoration:underline;font-weight:700';
b.appendChild(text);
b.appendChild(link);
- appEl.prepend(b);
+ bannersEl.appendChild(b);
}
// Initialize
diff --git a/frontend/js/components/type-to-confirm-modal.js b/frontend/js/components/type-to-confirm-modal.js
index 94bc9f5..cfeaf61 100644
--- a/frontend/js/components/type-to-confirm-modal.js
+++ b/frontend/js/components/type-to-confirm-modal.js
@@ -38,7 +38,7 @@ export function openTypeToConfirmModal(opts = {}) {
const input = overlay.querySelector('#ttcInput');
const confirmBtn = overlay.querySelector('#ttcConfirm');
const errorEl = overlay.querySelector('#ttcError');
- input.focus();
+ input.focus({ preventScroll: true });
const matches = () => input.value.trim() === String(expected);
input.addEventListener('input', () => { confirmBtn.disabled = !matches(); });