From b613b8dbc8b10bb9f502f5f68f5c3b23ac183860 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 17 Oct 2026 20:22:32 +0200 Subject: [PATCH] Keep the tvOS media browser header visible while loading The Refresh and View Options header was hidden until the first listing arrived, leaving only a spinner; an SMB or WebDAV connection can hang for a long time with nothing the remote could focus. Refresh ignores presses while a load is in flight. --- .../Views/MediaBrowser/MediaBrowserView.swift | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Yattee/Views/MediaBrowser/MediaBrowserView.swift b/Yattee/Views/MediaBrowser/MediaBrowserView.swift index f96fbb70..5afc17e9 100644 --- a/Yattee/Views/MediaBrowser/MediaBrowserView.swift +++ b/Yattee/Views/MediaBrowser/MediaBrowserView.swift @@ -152,30 +152,32 @@ struct MediaBrowserView: View { title: navigationTitle ) { VStack(spacing: 0) { - if !(isLoading && files.isEmpty) { - HStack(spacing: 24) { - Button { - Task { await loadFiles() } - } label: { - Label(String(localized: "common.refresh"), systemImage: "arrow.clockwise") - } - Button { - showViewOptions = true - } label: { - Label( - String(localized: "viewOptions.title"), - systemImage: showOnlyPlayable - ? "line.3.horizontal.decrease.circle.fill" - : "line.3.horizontal.decrease.circle" - ) - } - Spacer() + // Shown while the first listing loads too: an SMB or WebDAV + // connection can hang for a long time, and the spinner alone + // gives the remote nothing to focus. + HStack(spacing: 24) { + Button { + guard !isLoading else { return } + Task { await loadFiles() } + } label: { + Label(String(localized: "common.refresh"), systemImage: "arrow.clockwise") } - .padding(.horizontal, 24) - .padding(.top, 16) - .padding(.bottom, 8) - .focusSection() + Button { + showViewOptions = true + } label: { + Label( + String(localized: "viewOptions.title"), + systemImage: showOnlyPlayable + ? "line.3.horizontal.decrease.circle.fill" + : "line.3.horizontal.decrease.circle" + ) + } + Spacer() } + .padding(.horizontal, 24) + .padding(.top, 16) + .padding(.bottom, 8) + .focusSection() inner .focusSection() }