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 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 15:57:16 +03:00
parent 58df163ded
commit 3d2393e474
3 changed files with 17 additions and 6 deletions

View File

@@ -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);