feat: home hero+genres, fix Android queue desync via song ID verification

Home view:
- Add hero card (random pick from recent+frequent combined pool)
- Add genre browser chips (sorted by song count, tap = shuffle-play)

Android sync fix:
- Add currentId to getState() snapshot so JS can verify song identity
- onReady: reset stale localStorage queue when native song ID mismatches
- onTrackChanged: reject stale old-queue callbacks by ID verification
- onPlaybackStateChanged safety net: ID-guard prevents wrong-queue index corruption
- connectToService: call updateStateSnapshot() before onReady so getState() is never empty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-21 09:06:47 +02:00
1 parent 377a6954e3
commit d3a1bf6a82
5 files changed
+142 -20

No files matched your search

+4 -1
View File
@@ -133,7 +133,10 @@
<!-- HOME -->
<div class="page active" id="page-home">
<div id="home-greeting" class="home-greeting"></div>
<div class="section-header" style="margin-top:8px"><span class="section-title">Zuletzt gespielt</span></div>
<div id="home-hero" class="home-hero"></div>
<div class="section-header" style="margin-top:20px"><span class="section-title">Genres</span></div>
<div id="home-genres" class="genre-chips"></div>
<div class="section-header" style="margin-top:20px"><span class="section-title">Zuletzt gespielt</span></div>
<div class="scroll-row" id="home-recent"></div>
<div class="section-header"><span class="section-title">Zufällig</span><span class="section-more" onclick="navigate('random')">Mehr</span></div>
<div class="scroll-row" id="home-random"></div>