[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Faster selection UI performance

Kasper (May 27, 2025, 9:39 AM +0200) 6af68162 80a6b765

+14 -3
+14 -3
src/components/TrackList.svelte
··· 425 425 if (i % 2 === 0) { 426 426 row_class += 'odd' 427 427 } 428 - if ($selection.has(track.item_id)) { 429 - row_class += ' selected' 430 - } 431 428 return { 432 429 ...track, 433 430 index: i + 1, 434 431 row_class, 435 432 } 436 433 }) 434 + 435 + $: $selection, apply_selection(selection) 436 + function apply_selection(selection: SvelteSelection<ItemId>) { 437 + const rows = grid.querySelectorAll('.rgRow') 438 + for (const row of rows) { 439 + const row_index = parseInt(row.getAttribute('data-rgrow') ?? '') 440 + if (Number.isInteger(row_index)) { 441 + const is_selected = selection.items.has(tracks_data[row_index].item_id) 442 + row.classList.toggle('selected', is_selected) 443 + } else { 444 + throw new Error(`Row index ${row_index} not integer`) 445 + } 446 + } 447 + } 437 448 438 449 // let col_container: HTMLElement 439 450 // let col_drag_line: HTMLElement