From 2de99a12e9c88f544edbe62fdc408eb6f4be5af1 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Tue, 9 Jun 2026 11:43:42 -0500 Subject: [PATCH] fix(branding): no ScreenTinker default flash on load/switch (#38) The logo/title/theme/favicon are static 'ScreenTinker' in index.html, and applyBranding() only overrode them AFTER an async /api/white-label fetch - that network delay was the flash, on every load and on switch (which reloads). Now applyBranding caches the resolved white-label per workspace (keyed by the JWT's current_workspace_id), and a tiny same-origin brand-prime.js loads render-blocking right after the logo - so it applies the cached colors/name/ title/favicon/custom-css BEFORE first paint. CSP-safe (external 'self' script, not inline). applyBranding still runs to refresh + re-cache. First-ever visit to an uncached branded workspace still shows the default once; every load after is flash-free. --- frontend/index.html | 4 +++- frontend/js/brand-prime.js | 44 ++++++++++++++++++++++++++++++++++++++ frontend/js/branding.js | 14 +++++++++++- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 frontend/js/brand-prime.js diff --git a/frontend/index.html b/frontend/index.html index 0f81392..cec2974 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -29,8 +29,10 @@ - ScreenTinker + ScreenTinker + +