From 7317bd7c55daffbcc1d373db358f84ba01291dd7 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Thu, 16 Apr 2026 13:47:42 -0700 Subject: [PATCH] Live sidebar badges for Watchlist/Wishlist, update Wishlist icon to star MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar nav badges now update from HTTP polling (every 10s), WebSocket pushes, and page init — counts stay current regardless of which page the user is on. Wishlist icon changed from music note to star in both sidebar and page title to distinguish from Artists page. --- webui/index.html | 4 ++-- webui/static/script.js | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/webui/index.html b/webui/index.html index cf246e44..d911dba0 100644 --- a/webui/index.html +++ b/webui/index.html @@ -218,7 +218,7 @@ @@ -6734,7 +6734,7 @@

- 🎵 + Wishlist

diff --git a/webui/static/script.js b/webui/static/script.js index 804297bd..ce5062ab 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -434,6 +434,12 @@ function _updateHeroBtnCount(buttonId, badgeId, count) { function handleWatchlistCountUpdate(data) { if (data.success) { _updateHeroBtnCount('watchlist-button', 'watchlist-badge', data.count); + // Update sidebar nav badge + const wlNavBadge = document.getElementById('watchlist-nav-badge'); + if (wlNavBadge) { + wlNavBadge.textContent = data.count; + wlNavBadge.classList.toggle('hidden', data.count === 0); + } const watchlistButton = document.getElementById('watchlist-button'); if (watchlistButton) { const countdownText = data.next_run_in_seconds ? formatCountdownTime(data.next_run_in_seconds) : ''; @@ -520,6 +526,12 @@ function handleDashboardDbStats(stats) { function handleDashboardWishlistCount(data) { const count = data.count || 0; _updateHeroBtnCount('wishlist-button', 'wishlist-badge', count); + // Update sidebar nav badge + const wlNavBadge = document.getElementById('wishlist-nav-badge'); + if (wlNavBadge) { + wlNavBadge.textContent = count; + wlNavBadge.classList.toggle('hidden', count === 0); + } const wishlistButton = document.getElementById('wishlist-button'); if (wishlistButton) { if (count === 0) { @@ -25730,6 +25742,12 @@ async function updateWishlistCount() { const count = data.count || 0; _updateHeroBtnCount('wishlist-button', 'wishlist-badge', count); + // Update sidebar nav badge + const wlNavBadge = document.getElementById('wishlist-nav-badge'); + if (wlNavBadge) { + wlNavBadge.textContent = count; + wlNavBadge.classList.toggle('hidden', count === 0); + } const wishlistButton = document.getElementById('wishlist-button'); if (wishlistButton) { if (count === 0) { @@ -40228,6 +40246,12 @@ async function updateWatchlistButtonCount() { if (data.success) { _updateHeroBtnCount('watchlist-button', 'watchlist-badge', data.count); + // Update sidebar nav badge + const wlNavBadge = document.getElementById('watchlist-nav-badge'); + if (wlNavBadge) { + wlNavBadge.textContent = data.count; + wlNavBadge.classList.toggle('hidden', data.count === 0); + } const watchlistButton = document.getElementById('watchlist-button'); if (watchlistButton) { const countdownText = data.next_run_in_seconds ? formatCountdownTime(data.next_run_in_seconds) : '';