From 4e67b777149718e5b2fa6ad50a7d4f7af10f45cd Mon Sep 17 00:00:00 2001 From: Smittix Date: Mon, 23 Feb 2026 20:25:05 +0000 Subject: [PATCH] fix: first-load rendering for Waterfall CSS and WebSDR globe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Waterfall: load waterfall.css eagerly in instead of lazily on mode switch; the lazy inject raced with the panel becoming visible, leaving unstyled HTML for up to 20 s on cold cache - WebSDR: await a requestAnimationFrame before calling Globe()(mapEl) so the browser has committed the display:flex layout and clientWidth/ clientHeight are non-zero; previously the globe WebGL renderer was created at 0×0 (especially on warm-cache refreshes) and could not recover via the deferred resize calls - Bump version to 2.22.2 Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 8 ++++++++ config.py | 10 +++++++++- static/js/modes/websdr.js | 11 +++++++++++ templates/index.html | 4 ++-- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da4a874..c018d85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to iNTERCEPT will be documented in this file. +## [2.22.2] - 2026-02-23 + +### Fixed +- Waterfall control panel rendered as unstyled text for up to 20 seconds on first visit — CSS is now loaded eagerly with the rest of the page assets +- WebSDR globe failed to render on first page load — initialization now waits for a layout frame before mounting the WebGL renderer, ensuring the container has non-zero dimensions + +--- + ## [2.22.1] - 2026-02-23 ### Fixed diff --git a/config.py b/config.py index 9396b78..f2ac362 100644 --- a/config.py +++ b/config.py @@ -7,10 +7,18 @@ import os import sys # Application version -VERSION = "2.22.1" +VERSION = "2.22.2" # Changelog - latest release notes (shown on welcome screen) CHANGELOG = [ + { + "version": "2.22.2", + "date": "February 2026", + "highlights": [ + "Waterfall control panel no longer shows as unstyled text on first visit", + "WebSDR globe renders correctly on first page load without requiring a refresh", + ] + }, { "version": "2.22.1", "date": "February 2026", diff --git a/static/js/modes/websdr.js b/static/js/modes/websdr.js index 280dbde..de4bcfe 100644 --- a/static/js/modes/websdr.js +++ b/static/js/modes/websdr.js @@ -51,6 +51,17 @@ async function initWebSDR() { if (!mapEl) return; const globeReady = await ensureWebsdrGlobeLibrary(); + + // Wait for a paint frame so the browser computes layout after the + // display:flex change in switchMode. Without this, Globe()(mapEl) can + // run before clientWidth/clientHeight are non-zero (especially when + // scripts are served from cache and resolve before the first layout pass). + await new Promise(resolve => requestAnimationFrame(resolve)); + + // If the mode was switched away while scripts were loading, abort so + // websdrInitialized stays false and we retry cleanly next time. + if (!mapEl.clientWidth || !mapEl.clientHeight) return; + if (globeReady && initWebsdrGlobe(mapEl)) { websdrMapType = 'globe'; } else if (typeof L !== 'undefined' && await initWebsdrLeaflet(mapEl)) { diff --git a/templates/index.html b/templates/index.html index 0ca2dfc..c09744c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -66,6 +66,7 @@ +