refactor(ui): update albums interaction to double click for consistency

This commit is contained in:
2025-10-05 01:40:50 -04:00
parent 3118d969c6
commit 456f854863

View File

@@ -124,8 +124,11 @@
selectedArtistIndex = index; selectedArtistIndex = index;
} }
function handleAlbumClick(album: Album, index: number) { function handleAlbumClick(index: number) {
selectedAlbumIndex = index; selectedAlbumIndex = index;
}
function handleAlbumDoubleClick(album: Album) {
const artistEncoded = encodeURIComponent(album.artist); const artistEncoded = encodeURIComponent(album.artist);
const albumEncoded = encodeURIComponent(album.title); const albumEncoded = encodeURIComponent(album.title);
goto(`/albums/${artistEncoded}/${albumEncoded}`); goto(`/albums/${artistEncoded}/${albumEncoded}`);
@@ -238,7 +241,8 @@
{#each albums as album, i} {#each albums as album, i}
<tr <tr
class:highlighted={selectedAlbumIndex === i} class:highlighted={selectedAlbumIndex === i}
onclick={() => handleAlbumClick(album, i)} onclick={() => handleAlbumClick(i)}
ondblclick={() => handleAlbumDoubleClick(album)}
> >
<td class="cover-cell"> <td class="cover-cell">
{#if album.coverArtPath} {#if album.coverArtPath}