From 8233ac26d7fa832b06d596c8ad277acec51e2df0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 10 Oct 2026 21:27:26 +0200 Subject: [PATCH] Collapse the player for Video Info / Go to Channel from rows inside it Related and queue rows in the player use the default menu context, so the pushed screen landed underneath the still-expanded player. Collapse on player state instead of the .player context. Recommendations without an authorId no longer offer Go to Channel, which opened an empty channel. --- Yattee/Services/API/InvidiousAPI.swift | 4 +++- Yattee/Services/API/YatteeServerAPI.swift | 4 +++- Yattee/Views/Components/VideoContextMenu.swift | 15 +++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Yattee/Services/API/InvidiousAPI.swift b/Yattee/Services/API/InvidiousAPI.swift index 29eb04b4..f8252648 100644 --- a/Yattee/Services/API/InvidiousAPI.swift +++ b/Yattee/Services/API/InvidiousAPI.swift @@ -1432,7 +1432,9 @@ private struct InvidiousRecommendedVideo: Decodable, Sendable { id: .global(videoId), title: title, description: nil, - author: Author(id: authorId, name: author), + // An empty authorId (unlinked recommendation author) can't open a + // channel, so it hides Go to Channel instead of failing to load. + author: Author(id: authorId, name: author, hasRealChannelInfo: !authorId.isEmpty), duration: TimeInterval(lengthSeconds), publishedAt: nil, publishedText: nil, diff --git a/Yattee/Services/API/YatteeServerAPI.swift b/Yattee/Services/API/YatteeServerAPI.swift index debef250..76a13401 100644 --- a/Yattee/Services/API/YatteeServerAPI.swift +++ b/Yattee/Services/API/YatteeServerAPI.swift @@ -807,7 +807,9 @@ private struct YatteeRecommendedVideo: Decodable, Sendable { id: .global(videoId), title: title, description: nil, - author: Author(id: authorId, name: author), + // An empty authorId (unlinked recommendation author) can't open a + // channel, so it hides Go to Channel instead of failing to load. + author: Author(id: authorId, name: author, hasRealChannelInfo: !authorId.isEmpty), duration: TimeInterval(lengthSeconds), publishedAt: nil, publishedText: nil, diff --git a/Yattee/Views/Components/VideoContextMenu.swift b/Yattee/Views/Components/VideoContextMenu.swift index 2454465c..ca05c0cd 100644 --- a/Yattee/Views/Components/VideoContextMenu.swift +++ b/Yattee/Views/Components/VideoContextMenu.swift @@ -370,13 +370,9 @@ struct VideoContextMenuContent: View { // Video Info Button { - // Dismiss player if in player context - if context == .player { - // Set collapsing first so mini player shows video immediately - appEnvironment?.navigationCoordinator.isPlayerCollapsing = true - appEnvironment?.navigationCoordinator.isPlayerExpanded = false - } - appEnvironment?.navigationCoordinator.navigate(to: .video(.loaded(video))) + // Collapses the expanded player (also for related/queue rows + // shown inside it) so the pushed screen isn't left underneath. + appEnvironment?.navigationCoordinator.navigateToOpenedLink(.video(.loaded(video))) } label: { Label(String(localized: "video.context.info"), systemImage: "info.circle") } @@ -384,7 +380,10 @@ struct VideoContextMenuContent: View { // Go to channel (hidden for media browser, or when no real channel info) if showGoToChannel && video.author.hasRealChannelInfo { Button { - appEnvironment?.navigationCoordinator.navigateToChannel(for: video, collapsePlayer: context == .player) + appEnvironment?.navigationCoordinator.navigateToChannel( + for: video, + collapsePlayer: appEnvironment?.navigationCoordinator.isPlayerExpanded == true + ) } label: { Label(String(localized: "video.context.goToChannel"), systemImage: "person.circle") }