From dba89cc4e40f93d278ac99a9db1fee79f4466b65 Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Mon, 13 Apr 2026 17:52:17 +0200 Subject: [PATCH] fix(offline): replace blocking overlay with slim banner; add server settings link (#170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When offline with no cached content, the full-screen OfflineOverlay blocked all navigation including Settings, making it impossible to fix a broken server config. Replace it with the same slim banner used in offline-cache mode. - OfflineBanner now handles both cases: cache (existing) and no-cache (new) - No-cache banner shows server name and a direct link to Settings → Server tab - OfflineOverlay component is no longer used (import removed from App.tsx) - All 8 locales: added offlineNoCacheBanner and serverSettings keys Fixes #170 Co-Authored-By: Claude Sonnet 4.6 --- src/App.tsx | 12 ++---------- src/components/OfflineBanner.tsx | 22 +++++++++++++++++++--- src/locales/de.ts | 2 ++ src/locales/en.ts | 2 ++ src/locales/es.ts | 2 ++ src/locales/fr.ts | 2 ++ src/locales/nb.ts | 2 ++ src/locales/nl.ts | 2 ++ src/locales/ru.ts | 2 ++ src/locales/zh.ts | 2 ++ 10 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 780ca57e..4e20cb79 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -45,7 +45,6 @@ import { DragDropProvider } from './contexts/DragDropContext'; import TooltipPortal from './components/TooltipPortal'; import ConnectionIndicator from './components/ConnectionIndicator'; import LastfmIndicator from './components/LastfmIndicator'; -import OfflineOverlay from './components/OfflineOverlay'; import OfflineBanner from './components/OfflineBanner'; import OfflineLibrary from './pages/OfflineLibrary'; import Genres from './pages/Genres'; @@ -341,17 +340,10 @@ function AppShell() { {isQueueVisible ? : } - {connStatus === 'disconnected' && hasOfflineContent && ( - + {connStatus === 'disconnected' && ( + )}
- {connStatus === 'disconnected' && !hasOfflineContent && ( - - )} } /> } /> diff --git a/src/components/OfflineBanner.tsx b/src/components/OfflineBanner.tsx index 225d98ce..6f08f559 100644 --- a/src/components/OfflineBanner.tsx +++ b/src/components/OfflineBanner.tsx @@ -1,18 +1,34 @@ import React from 'react'; -import { WifiOff, RefreshCw } from 'lucide-react'; +import { WifiOff, RefreshCw, Settings } from 'lucide-react'; import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; interface Props { onRetry: () => void; isChecking: boolean; + showSettingsLink?: boolean; + serverName?: string; } -export default function OfflineBanner({ onRetry, isChecking }: Props) { +export default function OfflineBanner({ onRetry, isChecking, showSettingsLink, serverName }: Props) { const { t } = useTranslation(); + const navigate = useNavigate(); + const message = showSettingsLink + ? t('connection.offlineNoCacheBanner', { server: serverName }) + : t('connection.offlineModeBanner'); return (
- {t('connection.offlineModeBanner')} + {message} + {showSettingsLink && ( + + )}