Open queue sheet from tvOS player controls

Turn the tvOS bottom-row queue count indicator into a focusable button
that opens QueueManagementSheet in a fullScreenCover with an
ultraThinMaterial backdrop, matching the Settings sheet pattern. Hide
the sheet's close toolbar button on tvOS (Menu button dismisses) and
replace the unusable Menu-based queue mode picker with an icon-only
tap-to-cycle button.
This commit is contained in:
Arkadiusz Fal
2026-04-15 03:56:38 +02:00
parent 9aeb329b64
commit 29782035f7
3 changed files with 50 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ enum TVPlayerFocusTarget: Hashable {
case debugButton
case playNext
case closeButton
case queueButton
}
/// Main tvOS fullscreen player view.
@@ -45,6 +46,9 @@ struct TVPlayerView: View {
/// Whether the quality sheet is shown.
@State private var showingQualitySheet = false
/// Whether the queue sheet is shown.
@State private var showingQueueSheet = false
/// Whether the debug overlay is shown.
@State private var isDebugOverlayVisible = false
@@ -109,6 +113,14 @@ struct TVPlayerView: View {
.fullScreenCover(isPresented: $showingQualitySheet) {
qualitySheetContent
}
.fullScreenCover(isPresented: $showingQueueSheet) {
ZStack {
Rectangle()
.fill(.ultraThinMaterial)
.ignoresSafeArea()
QueueManagementSheet()
}
}
}
// MARK: - Quality Sheet Content
@@ -195,6 +207,7 @@ struct TVPlayerView: View {
playerService: playerService,
focusedControl: $focusedControl,
onShowSettings: { showQualitySheet() },
onShowQueue: { showQueueSheet() },
onShowDetails: { showDetailsPanel(tab: .info) },
onShowComments: { showDetailsPanel(tab: .comments) },
onShowDebug: { showDebugOverlay() },
@@ -419,6 +432,11 @@ struct TVPlayerView: View {
showingQualitySheet = true
}
private func showQueueSheet() {
stopControlsTimer()
showingQueueSheet = true
}
private func switchToStream(_ stream: Stream, audioStream: Stream? = nil) {
guard let video = playerState?.currentVideo else { return }