feat(player): heart/like button in queue view (web + android) — #1596
The full-screen player's queue ("up next") track rows were the one
track-list surface missing the like heart that TrackRow/PlaylistTrackRow
(web) and playlist/album/artist detail (Android) already carried.
Web: render the shared <LikeButton> in QueueTrackRow between the row body
and the remove button (serves both the /now-playing aside and the mobile
QueueDrawer, same component). LikeButton already stops click propagation
so it won't trigger play-on-click.
Android: PlayerViewModel now exposes likedTrackIds (set-based, the same
idiom as the detail VMs) + toggleLikeTrack; QueueScreen threads
liked/onToggleLike through QueueList → QueueRow, which renders the shared
LikeButton after the duration. Liked state stays sourced from
LikesRepository by track.id — no TrackRef data-model change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import type { TrackRef } from '$lib/api/types';
|
||||
import { playFromQueueIndex, removeFromQueue, moveQueueItem } from '$lib/player/store.svelte';
|
||||
import { offsetToDelta } from './queue-row-math';
|
||||
import LikeButton from './LikeButton.svelte';
|
||||
|
||||
let { track, index, isCurrent } = $props<{
|
||||
track: TrackRef;
|
||||
@@ -80,6 +81,8 @@
|
||||
<div class="text-xs text-text-secondary truncate">{track.artist_name}</div>
|
||||
</button>
|
||||
|
||||
<LikeButton entityType="track" entityId={track.id} />
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={handleRemove}
|
||||
|
||||
Reference in New Issue
Block a user