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.
This commit is contained in:
Arkadiusz Fal
2026-10-10 21:27:26 +02:00
parent 4510a24d9f
commit 8233ac26d7
3 changed files with 13 additions and 10 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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")
}