feat(favorites): virtualize songs tracklist + memoize rows (#805)

* feat(favorites): virtualize songs tracklist + memoize rows

10k+ starred songs no longer mount every row into the DOM. Same fix
shape as playlist virtualization: @tanstack/react-virtual windowing,
memoized FavoriteSongRow with stable callback bundle, scrollMargin
ResizeObserver anchored to .content-body. visibleTracks memoized once
per visibleSongs ref to avoid O(n) songToTrack on every click.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(favorites): review follow-ups for virtualization PR #805

Add maintainer comments for scrollMargin layout coupling and bulk-bar
useLayoutEffect dep. Record PR #805 in CHANGELOG and settings credits.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
‮Artem
2026-05-20 11:00:13 +03:00
committed by GitHub
parent d8a7c5b9e3
commit cb9445eaad
4 changed files with 297 additions and 181 deletions
+8
View File
@@ -349,6 +349,14 @@ Foundational work: faster reviews, narrower diffs, and a safety net under the pa
* Row rendering moved into a memoized `PlaylistRow` with a stable callback bundle so virtualizer scroll updates do not re-render the full list.
* Drag-and-drop reordering is preserved: drop-indicator overlay and edge auto-scroll during drags.
### Favorites — virtualized songs tracklist for large collections
**By [@artplan1](https://github.com/artplan1), PR [#805](https://github.com/Psychotoxical/psysonic/pull/805)**
* Opening Favorites with 10 000+ starred songs no longer mounts every row into the DOM. The songs tracklist is windowed with `@tanstack/react-virtual` on the shared app scroll viewport — same shape as the playlist virtualization fix.
* Row rendering moved into a memoized `FavoriteSongRow` with a stable callback bundle; `visibleTracks` is memoized once per filtered song list.
* Drag-out, preview, orbit, context menu, bulk select, and column picker behaviour are unchanged.
## Changed
### Build — lazy-loaded routes and Vite chunk warnings