From 3d2393e474a9626d86a15c3c7bcfa40d0db40312 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Thu, 12 Feb 2026 15:57:16 +0300 Subject: [PATCH] Fix tab jump on page reload and add config grid spacing Apply saved active tab from localStorage via inline script during HTML parse to prevent visible tab switch after page becomes visible. Co-Authored-By: Claude Opus 4.6 --- server/src/wled_controller/static/app.js | 8 ++++---- server/src/wled_controller/static/index.html | 14 ++++++++++++-- server/src/wled_controller/static/style.css | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/server/src/wled_controller/static/app.js b/server/src/wled_controller/static/app.js index 31b60fa..3cbbe88 100644 --- a/server/src/wled_controller/static/app.js +++ b/server/src/wled_controller/static/app.js @@ -410,15 +410,15 @@ document.addEventListener('DOMContentLoaded', async () => { // Initialize locale first await initLocale(); - // Show content now that translations are loaded - document.body.style.visibility = 'visible'; - // Load API key from localStorage apiKey = localStorage.getItem('wled_api_key'); - // Restore active tab (after API key is loaded) + // Restore active tab before showing content to avoid visible jump initTabs(); + // Show content now that translations are loaded and tabs are set + document.body.style.visibility = 'visible'; + // Setup form handler document.getElementById('add-device-form').addEventListener('submit', handleAddDevice); diff --git a/server/src/wled_controller/static/index.html b/server/src/wled_controller/static/index.html index 023f61f..5797497 100644 --- a/server/src/wled_controller/static/index.html +++ b/server/src/wled_controller/static/index.html @@ -34,11 +34,11 @@
- +
-
+
@@ -50,6 +50,16 @@
+