From 056024d753fc5f82b700b0a8ff20d3047da6a957 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Mar 2026 23:04:49 +0100 Subject: [PATCH] fix: preserve Radio tab play state across tab switches All tab components are now always mounted and hidden via CSS (display: none/contents) instead of conditionally rendered. This prevents React state from being destroyed on tab switch, so nowPlaying, SSE handlers, and stop buttons keep working. Co-Authored-By: Claude Opus 4.6 --- web/src/App.tsx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index b810ca4..be710fa 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -74,7 +74,6 @@ export default function App() { return () => { es?.close(); clearTimeout(retryTimer); }; }, []); - const TabComponent = activeTab ? tabComponents[activeTab] : null; const version = (import.meta as any).env?.VITE_APP_VERSION ?? '1.0.0'; // Tab icon mapping @@ -123,14 +122,21 @@ export default function App() {

Keine Plugins geladen

Plugins werden im Server konfiguriert.

- ) : TabComponent ? ( - ) : ( -
- {tabIcons[activeTab] ?? '\u{1F4E6}'} -

{activeTab}

-

Plugin-UI wird geladen...

-
+ /* Render ALL tabs, hide inactive ones with CSS to preserve state */ + plugins.map(p => { + const Comp = tabComponents[p.name]; + if (!Comp) return null; + return ( +
+ +
+ ); + }) )}