From 72728606961f135e947b826f82f67e1f5cd3b579 Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Mon, 29 Dec 2025 10:17:41 -0800 Subject: [PATCH] Improve artist detail navigation and logging Updated artist selection actions to log navigation events and use more direct navigation functions. Navigating to library artist details now uses navigateToArtistDetail, and Spotify artist details use selectArtistForDetail after a short delay, improving consistency and user experience. --- webui/static/script.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/webui/static/script.js b/webui/static/script.js index 03d0271b..013c2461 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -2517,8 +2517,9 @@ function initializeSearchModeToggle() { meta: 'In Your Library', badge: { text: 'Library', class: 'enh-badge-library' }, onClick: () => { + console.log(`🎵 Opening library artist detail: ${artist.name} (ID: ${artist.id})`); hideDropdown(); - navigateToPage('library'); + navigateToArtistDetail(artist.id, artist.name); } }) ); @@ -2535,16 +2536,18 @@ function initializeSearchModeToggle() { name: artist.name, meta: 'Artist', badge: { text: 'Spotify', class: 'enh-badge-spotify' }, - onClick: () => { + onClick: async () => { + console.log(`🎵 Opening Spotify artist detail: ${artist.name} (ID: ${artist.id})`); hideDropdown(); + + // Navigate to Artists page navigateToPage('artists'); - setTimeout(() => { - const input = document.getElementById('artist-search-input'); - if (input) { - input.value = artist.name; - input.dispatchEvent(new Event('input', { bubbles: true })); - } - }, 100); + + // Small delay to let the page load + await new Promise(resolve => setTimeout(resolve, 100)); + + // Load the artist details (same pattern as discover page) + await selectArtistForDetail(artist); } }) );