watchparty/client/src
Nicolas e89a81a3f1 Cast a listen party too, and fix a slow/freezing catalog
Three separate reports handled together.

Cast was video-only by design (docs/architecture.md flagged it as
video-parties-only for v1) - asked for directly, and turned out to need
almost nothing new server-side: CastTokenService and the 4 streaming
routes' sessionForStream fallback were already keyed on nothing more
specific than partyId. cast.ts's localDriver only needed its parameter
widened from HTMLVideoElement to HTMLMediaElement - both already share
the same currentTime/paused/duration/play()/pause() surface. MusicBar.ts
gained the same activeDriver indirection Player.ts already has, with one
real difference from the video case: a listen party's queue advances
far more often than a video party changes items, so dropping the cast
on every track (the video path's own choice there) would have made this
worse than not having it - a track change while casting instead calls
startCast() again, reusing the already-connected session (a
cache-busting query param added since the content URL itself never
changes between tracks - the server alone decides what's current).
Falls back to local playback if a re-cast throws, same recovery
instinct loadTrack's own hls.js try/catch already has.

The queue popup: reported separately, a fixed 480px width and a header
that scrolled away with the list - both leftover CSS from before the
row shape was reworked, never revisited since. Width cap dropped;
overflow/max-height moved off the outer .musicBarQueue (which wraps the
header too) down onto #queueList alone.

The catalog: still too slow, the front freezing while it loads.
CatalogService.getLibraryItems was asking Emby for Overview on every
one of up to 300 items and never using it (views/library's tiles only
ever show a poster/name/year) - dropped. getArtists had no Limit at
all, unlike every sibling query. Separately, tiles.ts's shared render
path built one HTML string for a whole batch and inserted it via a
single innerHTML write - fine for a 16-item carousel, a real hitch for
a 300-tile grid. renderTilesInChunks inserts the same tileHtml output
40 at a time across requestAnimationFrame callbacks instead;
wireTileButtons switched to one delegated listener so a tile from a
later chunk is still clickable.

Verified: full typecheck/test/build on both projects (122/122 server
tests). The chunked-render mechanism was verified directly - a
synthetic 300-item list against a real DOM confirms every item lands
and a button in the last chunk still fires through the delegated
listener. Not verified: no real Chromecast or Emby login reachable from
this sandbox, so the actual on-TV re-cast round trip and the
before/after catalog latency against a real large library are both
unconfirmed - same standing gap this project already flags for its
other casting work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 21:32:34 +02:00
..
api Add "Lire à partir d'ici" to playlists 2026-09-15 20:17:08 +02:00
musicBar Cast a listen party too, and fix a slow/freezing catalog 2026-09-15 21:32:34 +02:00
shell Add a spinner to every loading state 2026-09-14 23:30:25 +02:00
styles Add a spinner to every loading state 2026-09-14 23:30:25 +02:00
views Cast a listen party too, and fix a slow/freezing catalog 2026-09-15 21:32:34 +02:00
app.ts Browse Emby playlists and launch one as a pre-queued party 2026-09-14 19:04:31 +02:00
cast.ts Cast a listen party too, and fix a slow/freezing catalog 2026-09-15 21:32:34 +02:00
deviceId.ts Device detection: confirm before disconnecting another device 2026-09-14 17:32:21 +02:00
global.d.ts Replace native <video controls> with custom transport controls 2026-09-15 11:30:50 +02:00
index.html Cast a party's video to a Chromecast 2026-09-15 10:13:12 +02:00
loading.ts Add a spinner to every loading state 2026-09-14 23:30:25 +02:00
router.ts Rewrite server + client in TypeScript, service-oriented server architecture 2026-09-14 09:38:14 +02:00
tiles.css Music bar: refresh vote count on join/leave, progress bar; catalog search 2026-09-14 16:44:23 +02:00
tiles.ts Cast a listen party too, and fix a slow/freezing catalog 2026-09-15 21:32:34 +02:00
types.ts Sync text subtitle choice too, and fix an empty audio option 2026-09-14 20:41:02 +02:00