From 1aedc2ddcffda67ac99932fdafb14db19ed571d8 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 22 Apr 2026 22:25:06 -0700 Subject: [PATCH] Don't highlight sidebar Library when on /artist-detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cin: arriving at artist-detail from Search/Discover/Watchlist highlighted the Library sidebar entry, which is misleading — the user didn't navigate via Library. The hardcoded mapping was a holdover from when artist-detail was reached only from the (now retired) Artists page. Drop the special case so artist-detail behaves like playlist-explorer: no [data-page] match in the sidebar, no highlight. The user's actual origin page is already preserved on the back button. The deep-link fallback in _getPageFromPath (artist-detail → library) is left intact: if someone pastes /artist-detail in the URL bar with no state to render, library is still the most sensible landing page, and sidebar-highlighting Library in that scenario is correct because they're literally on Library. --- webui/static/init.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webui/static/init.js b/webui/static/init.js index 4b8ec35c..4d0f97bc 100644 --- a/webui/static/init.js +++ b/webui/static/init.js @@ -2131,14 +2131,14 @@ function navigateToPage(pageId, options = {}) { return; } - // Update navigation buttons (only if there's a nav button for this page) + // Update navigation buttons (only if there's a nav button for this page). + // Pages reachable from many surfaces (artist-detail, playlist-explorer) + // intentionally have no [data-page] match here — the sidebar shouldn't + // imply a section the user didn't actually navigate via. document.querySelectorAll('.nav-button').forEach(btn => { btn.classList.remove('active'); }); - - // Handle artist-detail page specially - it should highlight the 'library' nav button - const navPageId = pageId === 'artist-detail' ? 'library' : pageId; - const navButton = document.querySelector(`[data-page="${navPageId}"]`); + const navButton = document.querySelector(`[data-page="${pageId}"]`); if (navButton) { navButton.classList.add('active'); }