From 5655835398e572c720b2812082364d2ec55ed575 Mon Sep 17 00:00:00 2001 From: librelad Date: Wed, 27 May 2026 14:13:56 +0100 Subject: [PATCH] ui(devmode): persistent banner under topbar + shorter auto-enable toast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small dev-mode UX changes. 1. Banner. When CFG_DEV_MODE is on, a 36px amber-tinted strip sits flush under the topbar with "You are currently running in Developer mode" and a dismiss X. Dismissal is remembered in localStorage and cleared whenever dev mode is toggled back on, so re-enabling the mode brings the banner back. Body picks up `.has-dev-banner` while visible to bump padding-top by the strip's height (also adjusts the mobile drawer's top/height). 2. Toast. The auto-enable message dropped the trailing "Click the LibrePortal logo 10× to disable." — too noisy on every git/local page load; the easter egg is still discoverable. New message is just "Developer mode auto-enabled — you're on a install." Signed-off-by: librelad --- .../libreportal/frontend/css/topbar.css | 62 +++++++++++++++++++ .../libreportal/frontend/html/topbar.html | 14 +++++ .../frontend/js/components/topbar.js | 35 ++++++++++- 3 files changed, 110 insertions(+), 1 deletion(-) diff --git a/containers/libreportal/frontend/css/topbar.css b/containers/libreportal/frontend/css/topbar.css index 8ca8659..0b510b9 100644 --- a/containers/libreportal/frontend/css/topbar.css +++ b/containers/libreportal/frontend/css/topbar.css @@ -2,6 +2,68 @@ /* Topbar layout, nav pills, donate/logout buttons. Extracted from style.css. Theme via var(--*) tokens. */ +/* Developer-mode strip — sits flush under the fixed topbar when CFG_DEV_MODE + is on. Amber-tinted glass so it reads as "non-default state" without + shouting. Body gets .has-dev-banner to bump padding-top by the strip's + height; dismissal is local and remembered in localStorage until dev + mode is toggled off + on again. */ +.dev-banner { + position: fixed; + top: 60px; + left: 0; + right: 0; + z-index: 999; + height: 36px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 24px; + font-size: 0.85rem; + font-weight: 500; + color: var(--text-primary); + background: rgba(var(--status-warning-rgb), 0.14); + border-bottom: 1px solid rgba(var(--status-warning-rgb), 0.35); + backdrop-filter: blur(12px) saturate(140%); + -webkit-backdrop-filter: blur(12px) saturate(140%); +} + +.dev-banner[hidden] { display: none; } + +.dev-banner-label { + display: inline-flex; + align-items: center; + gap: 8px; + color: var(--status-warning); +} + +.dev-banner-close { + display: inline-flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + padding: 0; + background: transparent; + border: none; + border-radius: 6px; + color: var(--text-primary); + opacity: 0.7; + cursor: pointer; + transition: opacity 0.15s ease, background 0.15s ease; +} + +.dev-banner-close:hover { + opacity: 1; + background: rgba(var(--text-rgb), 0.1); +} + +body.has-dev-banner { padding-top: 96px; } + +@media (max-width: 768px) { + .dev-banner { padding: 0 12px; font-size: 0.8rem; } + body.has-dev-banner .mobile-drawer { top: 96px; height: calc(100vh - 96px); } +} + /* Topbar */ .topbar { display: flex; diff --git a/containers/libreportal/frontend/html/topbar.html b/containers/libreportal/frontend/html/topbar.html index a5ef5ae..4911e0b 100755 --- a/containers/libreportal/frontend/html/topbar.html +++ b/containers/libreportal/frontend/html/topbar.html @@ -1,4 +1,18 @@ +