fix(svelte): eliminate t-shadow regressions after merge

cx
This commit is contained in:
vicrodh committed 2026-02-09 13:01:00 -06:00
1 parent c402c75010
commit be5a80a381
5 files changed
+25 -25

No files matched your search

@@ -243,8 +243,8 @@
{ max_pool_size: EXPANDED_POOL }
);
// Merge new tracks, avoiding duplicates
const existingIds = new Set(pool.map(t => t.track_id));
const newTracks = moreResult.tracks.filter(t => !existingIds.has(t.track_id));
const existingIds = new Set(pool.map((track) => track.track_id));
const newTracks = moreResult.tracks.filter((track) => !existingIds.has(track.track_id));
pool = [...pool, ...newTracks];
result = moreResult;
} catch (err) {
@@ -286,8 +286,8 @@
);
// Merge new tracks, avoiding duplicates
const existingIds = new Set(pool.map(t => t.track_id));
const newTracks = moreResult.tracks.filter(t => !existingIds.has(t.track_id));
const existingIds = new Set(pool.map((track) => track.track_id));
const newTracks = moreResult.tracks.filter((track) => !existingIds.has(track.track_id));
pool = [...pool, ...newTracks];
result = moreResult;
completedCycles = 0; // Reset cycle counter
@@ -318,7 +318,7 @@
// After a short delay, remove from pool (triggers exit animation)
setTimeout(() => {
pool = pool.filter(t => t.track_id !== track.track_id);
pool = pool.filter((suggestedTrack) => suggestedTrack.track_id !== track.track_id);
addedTrackIds = new Set([...addedTrackIds].filter(id => id !== track.track_id));
}, 600);
@@ -334,7 +334,7 @@
function handleDismiss(track: SuggestedTrack) {
dismissTrack(playlistId, track.track_id);
// Remove from pool immediately (triggers exit animation)
pool = pool.filter(t => t.track_id !== track.track_id);
pool = pool.filter((suggestedTrack) => suggestedTrack.track_id !== track.track_id);
}
</script>
+1 -1
View File
@@ -294,7 +294,7 @@
</div>
<div class="tracks-list">
{#each filteredTracks as track, index}
{@const originalIndex = upcomingTracks.findIndex(t => t.id === track.id)}
{@const originalIndex = upcomingTracks.findIndex((queueTrack) => queueTrack.id === track.id)}
{@const isUnavailable = track.available === false}
<div
class="queue-track"
@@ -200,12 +200,12 @@
for (let j = 0; j < numCubes; j++) {
const cubeY = baseY - (j + 1) * (cubeHeight + cubeGap);
const t = Math.min(j / 20, 1); // Normalized 0-1
const gradientRatio = Math.min(j / 20, 1); // Normalized 0-1
// Interpolate between primary (bottom) and secondary (top)
const r = Math.floor(colorPrimary.r + t * (colorSecondary.r - colorPrimary.r));
const g = Math.floor(colorPrimary.g + t * (colorSecondary.g - colorPrimary.g));
const b = Math.floor(colorPrimary.b + t * (colorSecondary.b - colorPrimary.b));
const r = Math.floor(colorPrimary.r + gradientRatio * (colorSecondary.r - colorPrimary.r));
const g = Math.floor(colorPrimary.g + gradientRatio * (colorSecondary.g - colorPrimary.g));
const b = Math.floor(colorPrimary.b + gradientRatio * (colorSecondary.b - colorPrimary.b));
ctx.fillStyle = `rgb(${r}, ${g}, ${b})`;
ctx.fillRect(xLeft, cubeY, barWidth, cubeHeight);
@@ -817,26 +817,26 @@
}
function buildTopTracksQueue(tracks: Track[]) {
return tracks.map(t => ({
id: t.id,
title: t.title,
artist: t.performer?.name || artist.name,
album: t.album?.title || '',
duration_secs: t.duration,
artwork_url: t.album?.image?.large || t.album?.image?.thumbnail || '',
hires: t.hires_streamable ?? false,
bit_depth: t.maximum_bit_depth ?? null,
sample_rate: t.maximum_sampling_rate ?? null,
return tracks.map((track) => ({
id: track.id,
title: track.title,
artist: track.performer?.name || artist.name,
album: track.album?.title || '',
duration_secs: track.duration,
artwork_url: track.album?.image?.large || track.album?.image?.thumbnail || '',
hires: track.hires_streamable ?? false,
bit_depth: track.maximum_bit_depth ?? null,
sample_rate: track.maximum_sampling_rate ?? null,
is_local: false,
album_id: t.album?.id || null,
artist_id: t.performer?.id ?? null,
album_id: track.album?.id || null,
artist_id: track.performer?.id ?? null,
}));
}
async function handleTrackPlay(track: Track, trackIndex?: number) {
// Create artist top tracks context
if (topTracks.length > 0) {
const trackIds = topTracks.map(t => t.id);
const trackIds = topTracks.map((track) => track.id);
const index = trackIndex !== undefined ? trackIndex : trackIds.indexOf(track.id);
if (index >= 0) {
@@ -1881,7 +1881,7 @@
try {
const trackSource = track.source === 'plex' ? 'plex' : 'local';
if (selectedAlbum && albumTracks.length > 0) {
const trackIndex = albumTracks.findIndex(t => t.id === track.id);
const trackIndex = albumTracks.findIndex((albumTrack) => albumTrack.id === track.id);
const trackIds = albumTracks.map(track => track.id);
// Set playback context for Local Library album