fix: the player bar's heart is Lucide's, outlined then filled as on Android, and its title and artist read at the size of the rest of the page (#5580)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 22:12:29 -04:00
co-authored by Claude Opus 5.5
parent 358849de77
commit 10be068dcc
2 changed files with 22 additions and 11 deletions
+12 -5
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Heart } from 'lucide-svelte';
import { useQueryClient } from '@tanstack/svelte-query';
import { createLikedIdsQuery, likeEntity, unlikeEntity, type EntityKind } from '#lib/api/likes.js';
@@ -8,9 +9,11 @@
size = 'md'
}: { entityType: EntityKind; entityId: string; size?: 'sm' | 'md' | 'lg' } = $props();
const sizeClass = $derived(
size === 'sm' ? 'text-base' : size === 'lg' ? 'text-3xl' : 'text-lg'
);
// Lucide's heart, as on Android (shared/widgets/LikeButton.kt): outlined
// when not liked, the same heart filled in the accent when liked, so the
// toggle reads as a fill change rather than a glyph swap.
const box = $derived(size === 'sm' ? 'h-7 w-7' : size === 'lg' ? 'h-10 w-10' : 'h-8 w-8');
const px = $derived(size === 'sm' ? 16 : size === 'lg' ? 26 : 18);
const SET_KEY = {
track: 'track_ids',
@@ -44,5 +47,9 @@
aria-label={liked ? 'Unlike' : 'Like'}
aria-pressed={liked}
onclick={onClick}
class="rounded p-1 {sizeClass} {liked ? 'text-accent-fg' : 'text-text-secondary hover:text-text-primary'}"
>{liked ? '♥' : '♡'}</button>
class="inline-flex shrink-0 items-center justify-center rounded-full transition-colors {box} {liked
? 'text-accent-fg'
: 'text-text-secondary hover:bg-surface-hover hover:text-text-primary'}"
>
<Heart size={px} strokeWidth={1.75} fill={liked ? 'currentColor' : 'none'} aria-hidden="true" />
</button>
+10 -6
View File
@@ -290,23 +290,27 @@
onerror={onCoverError}
/>
</a>
<div class="min-w-0 flex-1">
<div class="truncate text-sm font-medium text-text-primary">{current.title}</div>
<!-- Sized to the 96px cover beside it: the title reads at body size,
as Android's mini player gives it title weight. -->
<div class="min-w-0 flex-1 space-y-0.5">
<div class="truncate text-base font-medium text-text-primary">{current.title}</div>
<a
href={`/artists/${current.artist_id}`}
class="block truncate text-xs text-text-secondary hover:text-text-primary"
class="block truncate text-sm text-text-secondary hover:text-text-primary"
>
{current.artist_name}
</a>
{#if player.queue.length > player.index + 1}
{@const nextTrack = player.queue[player.index + 1]}
<span class="block truncate text-xs text-text-secondary">
<span class="block truncate pt-1 text-xs text-text-muted">
Next · {nextTrack.title} — {nextTrack.artist_name}
</span>
{/if}
</div>
<LikeButton entityType="track" entityId={current.id} />
<TrackMenu track={current} direction="up" hideQueueActions />
<div class="flex shrink-0 items-center">
<LikeButton entityType="track" entityId={current.id} />
<TrackMenu track={current} direction="up" hideQueueActions />
</div>
</div>
<!-- Center: seek row + transport row -->