fix(web-radio): hydrate radio in mini-player + show station identity#310
Conversation
player_get_state returned the persisted last *library* track as current_track whenever the engine's current_track_id wasn't a positive library id — including during a radio session (negative sentinel id). A webview that mounted mid-stream (the mini-player) then rendered that stale library track and never took the radio-hydration path (get_current_radio_metadata), so the radio never propagated to it. Add an explicit `active_id < 0` branch that returns current_track = null for radio, so the frontend's "no current_track but state != idle" path hydrates the station instead.
For a live radio the PlayerBar + immersive Now Playing showed only the ICY now-playing song (title + artist); the station was invisible. Add a third line under the song — a Radio glyph + station name (· genre/country when present) — driven by currentRadioStation. Song stays the title; the station rides below. HiResBadge renders null for radio so the PlayerBar reuses its freed third row.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCorrection dans ChangesWeb Radio : hydratation backend et affichage UI station
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Mirror the PlayerBar / immersive treatment in the mini-player: a station line (Radio glyph + name · genre/country) under the now-playing ICY song, driven by currentRadioStation. Keeps the three surfaces consistent.
Contexte
Deux choses signalées sur les captures :
1. Fix mini-player (regression)
Cause racine dans
player_get_state:current_track_idest la sentinelle négative pendant une radio, donc la brancheactive_id > 0était fausse et leelserenvoyait le dernier titre biblio persisté commecurrent_track. Un webview montant en cours de stream (le mini-player) rendait alors ce titre périmé et ne prenait jamais le chemin d'hydratation radio (get_current_radio_metadata).→ Ajout d'une branche explicite
active_id < 0qui renvoiecurrent_track = nullpour la radio. Le frontend prend alors le chemin « pas de current_track mais state != idle » → hydrate la station. La fenêtre principale marchait déjà (elle reçoit l'event live, jamais ré-hydratée).2. Affichage station (feat)
Agencement validé : morceau en titre, station en sous-titre. Une 3e ligne sous le morceau ICY (glyphe
Radio+ nom de station· genre/pays), pilotée parcurrentRadioStation, dans la PlayerBar et l'immersive Now Playing. Le morceau reste le titre.HiResBadgerenvoie null en radio → la PlayerBar réutilise sa 3e ligne libre.Validation
bun run typecheck✅ ·bun run lint✅cargo check -p waveflow✅ ·cargo clippy -p waveflow✅Doc : note mini-player CLAUDE.md corrigée (le
player_get_stateradio = null est désormais explicite + la ligne station documentée).Summary by CodeRabbit
Notes de version
New Features
Bug Fixes
Documentation
player_get_stateet le placement/synchronisation des éléments liés au like et à l’affichage Now Playing.