Skip to content

fix(web-radio): hydrate radio in mini-player + show station identity#310

Merged
InstaZDLL merged 3 commits into
mainfrom
fix/radio-miniplayer-and-station-display
Jun 23, 2026
Merged

fix(web-radio): hydrate radio in mini-player + show station identity#310
InstaZDLL merged 3 commits into
mainfrom
fix/radio-miniplayer-and-station-display

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Contexte

Deux choses signalées sur les captures :

  1. Le mini-player ne reflétait plus la radio — il affichait un ancien titre biblio (avec ♥) pendant que la fenêtre principale jouait la radio (avec ★).
  2. La station n'apparaissait nulle part dans la PlayerBar / le Now Playing — seul le morceau ICY était visible.

1. Fix mini-player (regression)

Cause racine dans player_get_state : current_track_id est la sentinelle négative pendant une radio, donc la branche active_id > 0 était fausse et le else renvoyait le dernier titre biblio persisté comme current_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 < 0 qui renvoie current_track = null pour 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 par currentRadioStation, dans la PlayerBar et l'immersive Now Playing. Le morceau reste le titre. HiResBadge renvoie 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_state radio = null est désormais explicite + la ligne station documentée).

Note : 4e PR de la session — si CodeRabbit tarde, c'est le rate-limit per-account.

Summary by CodeRabbit

Notes de version

  • New Features

    • Affichage amélioré des informations de station radio “live” (icône Radio + nom de station, avec artiste si disponible) dans la lecture plein écran, la PlayerBar et le MiniPlayer.
  • Bug Fixes

    • Empêche l’interface d’afficher un ancien morceau de la bibliothèque pendant qu’une station radio est en cours.
  • Documentation

    • Guide UI enrichi sur l’intégration Web Radio et l’hydratation côté webview, incluant le comportement de player_get_state et le placement/synchronisation des éléments liés au like et à l’affichage Now Playing.

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.
@InstaZDLL InstaZDLL added scope: frontend React/Vite frontend (src/) scope: backend Rust/Tauri backend (src-tauri/) scope: docs Docs, README, assets type: fix Bug fix size: s 10-50 lines labels Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0ea1739-9c07-4f21-946f-9265682bc2ba

📥 Commits

Reviewing files that changed from the base of the PR and between 379f523 and 927d57d.

📒 Files selected for processing (1)
  • src/components/views/MiniPlayer.tsx

📝 Walkthrough

Walkthrough

Correction dans player_get_state : lorsque active_id est négatif (session radio live), la fonction retourne désormais current_track = None au lieu de restaurer un morceau bibliothèque obsolète. Trois composants player (PlayerBar, FullscreenNowPlaying, MiniPlayer) affichent l'identité de la station radio active (icône + titre/artiste) quand currentRadioStation est disponible. La documentation CLAUDE.md est mise à jour en conséquence.

Changes

Web Radio : hydratation backend et affichage UI station

Layer / File(s) Summary
Correction player_get_state pour radio live
src-tauri/crates/app/src/commands/player.rs
Nouvelle branche conditionnelle sur active_id < 0 : current_track retourne None, position_ms provient de l'état partagé de l'engine — évite d'exposer un morceau bibliothèque périmé au frontend.
Affichage identité station dans composants player
src/components/player/PlayerBar.tsx, src/components/player/FullscreenNowPlaying.tsx, src/components/views/MiniPlayer.tsx
Import de l'icône Radio (lucide-react) et ajout d'un bloc conditionnel currentRadioStation && (...) dans les trois composants pour afficher le nom/artiste de la station : sous le badge qualité (PlayerBar), sous le bloc titre/album (FullscreenNowPlaying), et sous le titre/playlist (MiniPlayer).
Documentation CLAUDE.md
CLAUDE.md
Section UI enrichie avec le comportement de player_get_state en session radio, l'affichage de l'identité station sous ICY et les règles de like/sync en contexte radio.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • InstaZDLL/WaveFlow#305: Ajoute le parsing ICY et émet les événements player:radio-metadata qui alimentent l'identité station affichée par cette PR.
  • InstaZDLL/WaveFlow#308: Modifie également FullscreenNowPlaying.tsx pour la logique des boutons like (★/♥) en session Web Radio, avec interaction directe sur les composants modifiés ici.

Poem

📻 La radio joue, sans faux morceau perdu,
La station s'affiche, titre et artiste rendus,
active_id négatif ? None est renvoyé,
Plus de bibliothèque obsolète affichée —
Le PlayerBar rayonne, tout est synchronisé ! 🎶

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Le titre suit la convention Conventional Commits et résume clairement les deux changements principaux : correction du mini-player et affichage de l'identité de la station radio.
Description check ✅ Passed La description fournit un contexte détaillé, explique les deux problèmes et leurs solutions, inclut les résultats de validation, mais manque des étapes concrètes de test reproducibles pour un reviewer.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/radio-miniplayer-and-station-display

Comment @coderabbitai help to get the list of available commands.

@InstaZDLL InstaZDLL self-assigned this Jun 23, 2026
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.
@InstaZDLL InstaZDLL added size: m 50-200 lines and removed size: s 10-50 lines labels Jun 23, 2026
@InstaZDLL InstaZDLL merged commit a11437c into main Jun 23, 2026
14 checks passed
@InstaZDLL InstaZDLL deleted the fix/radio-miniplayer-and-station-display branch June 23, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) scope: docs Docs, README, assets scope: frontend React/Vite frontend (src/) size: m 50-200 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant