From 1c7314f74a4999e6e77fa41b08bb68b8a87c95cb Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 4 Oct 2026 22:56:05 +0200 Subject: [PATCH] Present deep-link download options through the shared sheet host The download deep link kept the video, streams and captions in separate states next to a presented flag, and the sheet was declared only at the app root, so it opened behind an expanded player. It is now a global request for the download options AppSheet. --- Yattee/YatteeApp.swift | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/Yattee/YatteeApp.swift b/Yattee/YatteeApp.swift index 75f2defa..ea9c81b9 100644 --- a/Yattee/YatteeApp.swift +++ b/Yattee/YatteeApp.swift @@ -37,14 +37,6 @@ struct YatteeApp: App { @State private var lastCheckedClipboardURL: URL? @Environment(\.scenePhase) private var scenePhase - // Deep link handling state - #if !os(tvOS) - @State private var deepLinkVideo: Video? - @State private var deepLinkStreams: [Stream] = [] - @State private var deepLinkCaptions: [Caption] = [] - @State private var showingDeepLinkDownloadSheet = false - #endif - // First-launch state @State private var showingICloudAlert = false @State private var showingICloudProgress = false @@ -117,18 +109,6 @@ struct YatteeApp: App { Text(String(localized: "alert.openVideo.message \(url.host ?? "clipboard")")) } } - #if !os(tvOS) - .sheet(isPresented: $showingDeepLinkDownloadSheet) { - if let video = deepLinkVideo { - DownloadQualitySheet( - video: video, - streams: deepLinkStreams, - captions: deepLinkCaptions - ) - .appEnvironment(appEnvironment) - } - } - #endif #endif // First-launch iCloud sync prompt .alert( @@ -702,10 +682,7 @@ struct YatteeApp: App { ) await MainActor.run { - deepLinkVideo = video - deepLinkStreams = streams - deepLinkCaptions = captions - showingDeepLinkDownloadSheet = true + appEnvironment.navigationCoordinator.presenter.present(.downloadOptions(video, streams: streams, captions: captions)) } } catch { // Fall back to open on error @@ -720,10 +697,7 @@ struct YatteeApp: App { let video = DirectMediaHelper.createVideo(from: url, probe: probe) let stream = DirectMediaHelper.createStream(from: url, probe: probe) await MainActor.run { - deepLinkVideo = video - deepLinkStreams = [stream] - deepLinkCaptions = [] - showingDeepLinkDownloadSheet = true + appEnvironment.navigationCoordinator.presenter.present(.downloadOptions(video, streams: [stream], captions: [])) } return } @@ -739,10 +713,7 @@ struct YatteeApp: App { .extractURL(url, instance: instance) await MainActor.run { - deepLinkVideo = video - deepLinkStreams = streams - deepLinkCaptions = captions - showingDeepLinkDownloadSheet = true + appEnvironment.navigationCoordinator.presenter.present(.downloadOptions(video, streams: streams, captions: captions)) } } catch { // Fall back to open on error