From 8a2264546dad04eeb64cded38ba3915bd15507d9 Mon Sep 17 00:00:00 2001 From: jelveh Date: Tue, 7 Jul 2026 15:16:59 -0700 Subject: [PATCH] Always use hash for dashboard tabs Previously the dashboard used a clean root URL for the 'apps' tab and hashes for other tabs. This change makes tab links and history entries consistently use a hash (e.g. #apps, #home) by always generating href as `#` and pushing `#
` to history. Simplifies URL handling and ensures the Apps tab also reflects its hash in the address bar. --- src/gui/src/UI/Dashboard/UIDashboard.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/src/UI/Dashboard/UIDashboard.js b/src/gui/src/UI/Dashboard/UIDashboard.js index f01c9bbe2..e3c410603 100644 --- a/src/gui/src/UI/Dashboard/UIDashboard.js +++ b/src/gui/src/UI/Dashboard/UIDashboard.js @@ -104,8 +104,7 @@ async function UIDashboard (options) { continue; } const isActive = tab.id === initialTabId ? ' active' : ''; - const tabHash = tab.id === 'apps' ? '' : `#${tab.id}`; - const tabHref = tabHash || window.location.pathname; + const tabHref = `#${tab.id}`; h += ``; h += tab.icon; h += tab.label; @@ -321,10 +320,9 @@ async function UIDashboard (options) { document.querySelector('.dashboard-content').setAttribute('class', 'dashboard-content'); document.querySelector('.dashboard-content').classList.add(section); - // Update hash to reflect current tab. Apps is the default tab, so it - // uses the clean root URL; every other tab (including home) uses #tab. - const newHash = section === 'apps' ? '' : section; - history.pushState(null, '', newHash ? `#${newHash}` : window.location.pathname); + // Reflect the current tab in the hash. Root (no hash) defaults to Apps, + // but selecting any tab — including Apps — shows its #tab. + history.pushState(null, '', `#${section}`); // Scroll content area to top $el_window.find('.dashboard-content').scrollTop(0);