diff --git a/src/lib/components/views/LocalLibraryView.svelte b/src/lib/components/views/LocalLibraryView.svelte index ff2934a0f..a1a0524d9 100644 --- a/src/lib/components/views/LocalLibraryView.svelte +++ b/src/lib/components/views/LocalLibraryView.svelte @@ -2215,8 +2215,27 @@ function handleLocalArtistClick(name?: string) { if (!name) return; if (normalizeArtistName(name) === 'various artists') return; + + // Close album detail view if open and navigate to library + if (selectedAlbum) { + clearLocalAlbum(); + navigateTo('library'); // This adds to history so back button works + } + + // Switch to artists tab + activeTab = 'artists'; + // Select artist to show their albums in the right column selectedArtistName = name; + + // Scroll to the artist card after DOM updates + tick().then(() => { + const artistId = `local-artist-${normalizeArtistName(name)}`; + const artistCard = document.getElementById(artistId); + if (artistCard) { + artistCard.scrollIntoView({ behavior: 'smooth', block: 'center' }); + } + }); } /** @@ -2568,7 +2587,7 @@