Feat: Now-Playing serverseitig syncen + in Topbar verschieben

Backend:
- nowPlaying Map trackt aktuell gespielten Sound pro Guild
- SSE broadcast { type: 'nowplaying' } bei play und stop
- nowplaying im SSE-Snapshot für neue Clients
- playFilePath Helper broadcastet ebenfalls (Party Mode)

Frontend:
- SSE-Handler für nowplaying Events (sync über alle Clients)
- Now-Playing als Pill-Badge in der Topbar (rechts, neben Channel)
- Bottombar komplett entfernt
- Fade-in Animation und accent-farbige Pill
- --accent-rgb CSS Variable für alle Themes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bot 2026-03-01 16:00:22 +01:00
parent 4661c366fb
commit f90401a009
3 changed files with 58 additions and 46 deletions

View file

@ -154,12 +154,20 @@ export default function App() {
const g = selectedRef.current?.split(':')[0];
if (g && typeof vols[g] === 'number') setVolume(vols[g]);
} catch { }
try {
const np = msg?.nowplaying || {};
const g = selectedRef.current?.split(':')[0];
if (g && typeof np[g] === 'string') setLastPlayed(np[g]);
} catch { }
} else if (msg?.type === 'channel') {
const g = selectedRef.current?.split(':')[0];
if (msg.guildId === g) setSelected(`${msg.guildId}:${msg.channelId}`);
} else if (msg?.type === 'volume') {
const g = selectedRef.current?.split(':')[0];
if (msg.guildId === g && typeof msg.volume === 'number') setVolume(msg.volume);
} else if (msg?.type === 'nowplaying') {
const g = selectedRef.current?.split(':')[0];
if (msg.guildId === g) setLastPlayed(msg.name || '');
}
});
return () => { try { unsub(); } catch { } };
@ -362,6 +370,15 @@ export default function App() {
</div>
<div className="topbar-right">
{lastPlayed && (
<div className="now-playing">
<div className="np-waves active">
<div className="np-wave-bar" /><div className="np-wave-bar" />
<div className="np-wave-bar" /><div className="np-wave-bar" />
</div>
<span className="np-name">{lastPlayed}</span>
</div>
)}
{selected && (
<div className="connection">
<span className="conn-dot" />
@ -594,18 +611,6 @@ export default function App() {
)}
</main>
{/* ═══ BOTTOM BAR ═══ */}
<div className="bottombar">
<div className="now-playing">
<div className={`np-waves ${lastPlayed ? 'active' : ''}`}>
<div className="np-wave-bar" /><div className="np-wave-bar" />
<div className="np-wave-bar" /><div className="np-wave-bar" />
</div>
<span className="np-label">Spielt:</span>
<span className="np-name">{lastPlayed || '—'}</span>
</div>
</div>
{/* ═══ CONTEXT MENU ═══ */}
{ctxMenu && (
<div