The web Songs list and long playlists rendered every row, each with an image and context menu, and re-rendered all of them on every play/pause or song change because they read the whole playback context. PlayerBar also re-rendered on every timeupdate.
Add VirtualList (@tanstack/react-virtual) that virtualizes a list inside an existing ScrollArea viewport, below other page content. Used by Songs (infinite loading kept) and playlists (drag source stays mounted while dragging).
Split playback context: usePlaybackActions() (stable), useCurrentSongId(), useIsPlaying(). Lists, cards and queue actions use the narrow hooks; only the now-playing button reads isPlaying.
Memoize Songs and playlist rows and pass stable callbacks (useStableCallback).
Album view moves to the narrow hooks (not virtualized, albums are short).
Move the seek slider into PlayerSeekBar so progress updates only re-render it.
Right-click on any track row (Songs, playlists, albums, search) or artist list item opens the same menu as its "…" button. MediaMenuItem/MediaMenuSeparator render as dropdown or context-menu items, and MediaContextMenuArea wraps the row.
Songs remembers how many items were loaded this session and requests that many (up to 1000) on remount, so back navigation can restore positions past the first page.
Scroll restoration: the virtualizer scrolls its element to its cached offset on attach, which reset restored positions. initialOffset now reads the viewport's current position and the cache is cleared on detach.
Verified in headless Chrome against the test server: a 2000-song playlist renders about 36 rows; range selection, the row menu, right-click menus (songs, playlist, album, artists), double-click to play, drag reordering in a new playlist (persists after reload) and back-navigation scroll restoration (Songs about 250 rows deep, playlists) all work. Web typecheck and lint pass (one expected React Compiler warning about TanStack Virtual).
Changes made by Claude Opus 5.5 in Claude Code (T3 Code).
The web Songs list and long playlists rendered every row, each with an image and context menu, and re-rendered all of them on every play/pause or song change because they read the whole playback context. `PlayerBar` also re-rendered on every `timeupdate`.
- Add `VirtualList` (`@tanstack/react-virtual`) that virtualizes a list inside an existing `ScrollArea` viewport, below other page content. Used by Songs (infinite loading kept) and playlists (drag source stays mounted while dragging).
- Split playback context: `usePlaybackActions()` (stable), `useCurrentSongId()`, `useIsPlaying()`. Lists, cards and queue actions use the narrow hooks; only the now-playing button reads `isPlaying`.
- Memoize Songs and playlist rows and pass stable callbacks (`useStableCallback`).
- Album view moves to the narrow hooks (not virtualized, albums are short).
- Move the seek slider into `PlayerSeekBar` so progress updates only re-render it.
- Right-click on any track row (Songs, playlists, albums, search) or artist list item opens the same menu as its "…" button. `MediaMenuItem`/`MediaMenuSeparator` render as dropdown or context-menu items, and `MediaContextMenuArea` wraps the row.
- Songs remembers how many items were loaded this session and requests that many (up to 1000) on remount, so back navigation can restore positions past the first page.
- Scroll restoration: the virtualizer scrolls its element to its cached offset on attach, which reset restored positions. `initialOffset` now reads the viewport's current position and the cache is cleared on detach.
Verified in headless Chrome against the test server: a 2000-song playlist renders about 36 rows; range selection, the row menu, right-click menus (songs, playlist, album, artists), double-click to play, drag reordering in a new playlist (persists after reload) and back-navigation scroll restoration (Songs about 250 rows deep, playlists) all work. Web typecheck and lint pass (one expected React Compiler warning about TanStack Virtual).
---
Changes made by Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
joshuafhiggins
changed title from perf(web): virtualize song lists and narrow playback subscriptions to perf(web): virtualize song lists and add row right-click menus2026-11-16 14:37:48 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The web Songs list and long playlists rendered every row, each with an image and context menu, and re-rendered all of them on every play/pause or song change because they read the whole playback context.
PlayerBaralso re-rendered on everytimeupdate.VirtualList(@tanstack/react-virtual) that virtualizes a list inside an existingScrollAreaviewport, below other page content. Used by Songs (infinite loading kept) and playlists (drag source stays mounted while dragging).usePlaybackActions()(stable),useCurrentSongId(),useIsPlaying(). Lists, cards and queue actions use the narrow hooks; only the now-playing button readsisPlaying.useStableCallback).PlayerSeekBarso progress updates only re-render it.MediaMenuItem/MediaMenuSeparatorrender as dropdown or context-menu items, andMediaContextMenuAreawraps the row.initialOffsetnow reads the viewport's current position and the cache is cleared on detach.Verified in headless Chrome against the test server: a 2000-song playlist renders about 36 rows; range selection, the row menu, right-click menus (songs, playlist, album, artists), double-click to play, drag reordering in a new playlist (persists after reload) and back-navigation scroll restoration (Songs about 250 rows deep, playlists) all work. Web typecheck and lint pass (one expected React Compiler warning about TanStack Virtual).
Changes made by Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
perf(web): virtualize song lists and narrow playback subscriptionsto perf(web): virtualize song lists and add row right-click menus