Show an empty-queue placeholder in the queue panel page

When nothing is queued and the history and now-playing sections are
hidden or empty, show the same placeholder as the queue sheet instead
of a blank list.
This commit is contained in:
Arkadiusz Fal
2026-10-12 21:21:24 +02:00
parent 4a9a92d140
commit 23d6a605a0

View File

@@ -131,7 +131,27 @@ struct QueueListView: View {
private var hasMoreItems: Bool { queueManager?.hasMoreItems() ?? false }
private var listStyle: VideoListStyle { appEnvironment?.settingsManager.listStyle ?? .inset }
/// Nothing to list: no queued videos, and the history and now-playing
/// sections are hidden or have nothing to show.
private var hasNoRows: Bool {
queue.isEmpty
&& (!showHistory || history.isEmpty)
&& (!showNowPlaying || playerState?.currentVideo == nil)
}
var body: some View {
if hasNoRows {
ContentUnavailableView(
String(localized: "queue.sheet.empty"),
systemImage: "list.bullet",
description: Text(String(localized: "queue.sheet.emptyHint"))
)
} else {
list
}
}
private var list: some View {
ScrollViewReader { proxy in
List {
// History section - show previously played videos