From f393d2b9cc3efe3d9425c2598ad9b6a9d0fdd0d8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 17 Oct 2026 15:23:00 +0200 Subject: [PATCH] Give the tvOS network share discovery sheet a focusable Cancel The toolbar Cancel is iOS/macOS only, so while scanning with no shares found yet (and when discovery is unavailable) the tvOS sheet had nothing the remote could focus. --- .../Settings/NetworkShareDiscoverySheet.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Yattee/Views/Settings/NetworkShareDiscoverySheet.swift b/Yattee/Views/Settings/NetworkShareDiscoverySheet.swift index 3ec96af4..26b610ff 100644 --- a/Yattee/Views/Settings/NetworkShareDiscoverySheet.swift +++ b/Yattee/Views/Settings/NetworkShareDiscoverySheet.swift @@ -72,6 +72,15 @@ struct NetworkShareDiscoverySheet: View { Text(String(localized: "discovery.scanning")) .foregroundStyle(.secondary) } + + #if os(tvOS) + // The toolbar Cancel is iOS/macOS only. Until a share + // turns up, this is the only thing the remote can focus. + Button(String(localized: "common.cancel")) { + service.stopDiscovery() + dismiss() + } + #endif } } @@ -133,6 +142,12 @@ struct NetworkShareDiscoverySheet: View { Label(String(localized: "discovery.unavailable.title"), systemImage: "exclamationmark.triangle") } description: { Text(String(localized: "discovery.unavailable.description")) + } actions: { + #if os(tvOS) + Button(String(localized: "common.cancel")) { + dismiss() + } + #endif } .frame(maxWidth: .infinity, maxHeight: .infinity) }