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:
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Heart } from 'lucide-svelte';
|
||||||
import { useQueryClient } from '@tanstack/svelte-query';
|
import { useQueryClient } from '@tanstack/svelte-query';
|
||||||
import { createLikedIdsQuery, likeEntity, unlikeEntity, type EntityKind } from '#lib/api/likes.js';
|
import { createLikedIdsQuery, likeEntity, unlikeEntity, type EntityKind } from '#lib/api/likes.js';
|
||||||
|
|
||||||
@@ -8,9 +9,11 @@
|
|||||||
size = 'md'
|
size = 'md'
|
||||||
}: { entityType: EntityKind; entityId: string; size?: 'sm' | 'md' | 'lg' } = $props();
|
}: { entityType: EntityKind; entityId: string; size?: 'sm' | 'md' | 'lg' } = $props();
|
||||||
|
|
||||||
const sizeClass = $derived(
|
// Lucide's heart, as on Android (shared/widgets/LikeButton.kt): outlined
|
||||||
size === 'sm' ? 'text-base' : size === 'lg' ? 'text-3xl' : 'text-lg'
|
// 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 = {
|
const SET_KEY = {
|
||||||
track: 'track_ids',
|
track: 'track_ids',
|
||||||
@@ -44,5 +47,9 @@
|
|||||||
aria-label={liked ? 'Unlike' : 'Like'}
|
aria-label={liked ? 'Unlike' : 'Like'}
|
||||||
aria-pressed={liked}
|
aria-pressed={liked}
|
||||||
onclick={onClick}
|
onclick={onClick}
|
||||||
class="rounded p-1 {sizeClass} {liked ? 'text-accent-fg' : 'text-text-secondary hover:text-text-primary'}"
|
class="inline-flex shrink-0 items-center justify-center rounded-full transition-colors {box} {liked
|
||||||
>{liked ? '♥' : '♡'}</button>
|
? '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>
|
||||||
|
|||||||
@@ -290,23 +290,27 @@
|
|||||||
onerror={onCoverError}
|
onerror={onCoverError}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<div class="min-w-0 flex-1">
|
<!-- Sized to the 96px cover beside it: the title reads at body size,
|
||||||
<div class="truncate text-sm font-medium text-text-primary">{current.title}</div>
|
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
|
<a
|
||||||
href={`/artists/${current.artist_id}`}
|
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}
|
{current.artist_name}
|
||||||
</a>
|
</a>
|
||||||
{#if player.queue.length > player.index + 1}
|
{#if player.queue.length > player.index + 1}
|
||||||
{@const nextTrack = player.queue[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}
|
Next · {nextTrack.title} — {nextTrack.artist_name}
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<LikeButton entityType="track" entityId={current.id} />
|
<div class="flex shrink-0 items-center">
|
||||||
<TrackMenu track={current} direction="up" hideQueueActions />
|
<LikeButton entityType="track" entityId={current.id} />
|
||||||
|
<TrackMenu track={current} direction="up" hideQueueActions />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Center: seek row + transport row -->
|
<!-- Center: seek row + transport row -->
|
||||||
|
|||||||
Reference in New Issue
Block a user