fix: play button toggle works after pause on playlist/album pages (#668)

the play button on playlist and album pages wasn't resuming playback
after pausing. the issue was in the `isPlaylistPlaying` derived state
which included `!player.paused` - when paused, this became false,
causing the button to call `playNow()` instead of `togglePlayPause()`.

since the queue already had the same track at index 0, `setQueue` did
nothing and playback didn't resume.

fix: separate "is this playlist/album active" (track is from here) from
"is it playing" (active AND not paused). button now uses `isActive` to
decide toggle vs start fresh, while `isPlaying` controls the visual state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

authored by zzstoatzz.io Claude Opus 4.5 and committed by GitHub a3063381 7447422b

Changed files
+12 -8
frontend
src
routes
playlist
u
[handle]
album
[slug]
+6 -4
frontend/src/routes/playlist/[id]/+page.svelte
··· 608 608 // check if user owns this playlist 609 609 const isOwner = $derived(auth.user?.did === playlist.owner_did); 610 610 611 - // check if this playlist is currently playing 612 - const isPlaylistPlaying = $derived( 611 + // check if current track is from this playlist (active, regardless of paused state) 612 + const isPlaylistActive = $derived( 613 613 player.currentTrack !== null && 614 - !player.paused && 615 614 tracks.some(t => t.id === player.currentTrack?.id) 616 615 ); 616 + 617 + // check if actively playing (not paused) 618 + const isPlaylistPlaying = $derived(isPlaylistActive && !player.paused); 617 619 </script> 618 620 619 621 <svelte:window on:keydown={handleKeydown} /> ··· 875 877 <button 876 878 class="play-button" 877 879 class:is-playing={isPlaylistPlaying} 878 - onclick={() => isPlaylistPlaying ? player.togglePlayPause() : playNow()} 880 + onclick={() => isPlaylistActive ? player.togglePlayPause() : playNow()} 879 881 > 880 882 {#if isPlaylistPlaying} 881 883 <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
+6 -4
frontend/src/routes/u/[handle]/album/[slug]/+page.svelte
··· 35 35 // can only reorder if owner and album has an ATProto list 36 36 const canReorder = $derived(isOwner && !!albumMetadata.list_uri); 37 37 38 - // check if this album is currently playing 39 - const isAlbumPlaying = $derived( 38 + // check if current track is from this album (active, regardless of paused state) 39 + const isAlbumActive = $derived( 40 40 player.currentTrack !== null && 41 - !player.paused && 42 41 tracks.some(t => t.id === player.currentTrack?.id) 43 42 ); 43 + 44 + // check if actively playing (not paused) 45 + const isAlbumPlaying = $derived(isAlbumActive && !player.paused); 44 46 45 47 // edit mode state 46 48 let isEditMode = $state(false); ··· 555 557 <button 556 558 class="play-button" 557 559 class:is-playing={isAlbumPlaying} 558 - onclick={() => isAlbumPlaying ? player.togglePlayPause() : playNow()} 560 + onclick={() => isAlbumActive ? player.togglePlayPause() : playNow()} 559 561 > 560 562 {#if isAlbumPlaying} 561 563 <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">