mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 02:17:46 +00:00
Add Playlists entry to sidebar main navigation
Adds a toggleable "Playlists" item that opens PlaylistsListView, mirroring the Channels → ManageChannelsView pattern.
This commit is contained in:
@@ -14212,6 +14212,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"sidebar.mainItem.playlists" : {
|
||||||
|
"comment" : "Sidebar main navigation item for playlists",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Playlists"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"sidebar.mainItem.downloads" : {
|
"sidebar.mainItem.downloads" : {
|
||||||
"comment" : "Sidebar main navigation item for downloads",
|
"comment" : "Sidebar main navigation item for downloads",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ enum SidebarItem: Hashable, Identifiable {
|
|||||||
case downloads
|
case downloads
|
||||||
case subscriptionsFeed
|
case subscriptionsFeed
|
||||||
case manageChannels
|
case manageChannels
|
||||||
|
case playlistsList
|
||||||
|
|
||||||
// MARK: - Identifiable
|
// MARK: - Identifiable
|
||||||
|
|
||||||
@@ -73,6 +74,8 @@ enum SidebarItem: Hashable, Identifiable {
|
|||||||
return "subscriptions-feed"
|
return "subscriptions-feed"
|
||||||
case .manageChannels:
|
case .manageChannels:
|
||||||
return "manage-channels"
|
return "manage-channels"
|
||||||
|
case .playlistsList:
|
||||||
|
return "playlists-list"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,6 +115,8 @@ enum SidebarItem: Hashable, Identifiable {
|
|||||||
return String(localized: "home.subscriptions.title")
|
return String(localized: "home.subscriptions.title")
|
||||||
case .manageChannels:
|
case .manageChannels:
|
||||||
return String(localized: "sidebar.manageChannels")
|
return String(localized: "sidebar.manageChannels")
|
||||||
|
case .playlistsList:
|
||||||
|
return String(localized: "home.playlists.title")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +154,8 @@ enum SidebarItem: Hashable, Identifiable {
|
|||||||
return "play.square.stack.fill"
|
return "play.square.stack.fill"
|
||||||
case .manageChannels:
|
case .manageChannels:
|
||||||
return "person.2"
|
return "person.2"
|
||||||
|
case .playlistsList:
|
||||||
|
return "list.bullet.rectangle"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,6 +187,8 @@ enum SidebarItem: Hashable, Identifiable {
|
|||||||
return .subscriptionsFeed
|
return .subscriptionsFeed
|
||||||
case .manageChannels:
|
case .manageChannels:
|
||||||
return .manageChannels
|
return .manageChannels
|
||||||
|
case .playlistsList:
|
||||||
|
return .playlists
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case history
|
case history
|
||||||
case downloads
|
case downloads
|
||||||
case channels
|
case channels
|
||||||
|
case playlists
|
||||||
case sources
|
case sources
|
||||||
case settings
|
case settings
|
||||||
case openURL
|
case openURL
|
||||||
@@ -25,7 +26,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
|
|
||||||
/// Default order for sidebar main items.
|
/// Default order for sidebar main items.
|
||||||
static var defaultOrder: [SidebarMainItem] {
|
static var defaultOrder: [SidebarMainItem] {
|
||||||
[.search, .home, .subscriptions, .bookmarks, .history, .channels, .sources, .openURL, .remoteControl, .downloads, .settings]
|
[.search, .home, .subscriptions, .bookmarks, .history, .channels, .playlists, .sources, .openURL, .remoteControl, .downloads, .settings]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Default visibility (all visible except subscriptions and channels).
|
/// Default visibility (all visible except subscriptions and channels).
|
||||||
@@ -39,6 +40,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
.history: false,
|
.history: false,
|
||||||
.downloads: true,
|
.downloads: true,
|
||||||
.channels: false,
|
.channels: false,
|
||||||
|
.playlists: false,
|
||||||
.sources: true,
|
.sources: true,
|
||||||
.settings: true,
|
.settings: true,
|
||||||
.openURL: false,
|
.openURL: false,
|
||||||
@@ -53,6 +55,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
.history: false,
|
.history: false,
|
||||||
.downloads: true,
|
.downloads: true,
|
||||||
.channels: false,
|
.channels: false,
|
||||||
|
.playlists: false,
|
||||||
.sources: true,
|
.sources: true,
|
||||||
.settings: true,
|
.settings: true,
|
||||||
.openURL: false,
|
.openURL: false,
|
||||||
@@ -71,6 +74,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case .history: "clock"
|
case .history: "clock"
|
||||||
case .downloads: "arrow.down.circle"
|
case .downloads: "arrow.down.circle"
|
||||||
case .channels: "person.2"
|
case .channels: "person.2"
|
||||||
|
case .playlists: "list.bullet.rectangle"
|
||||||
case .sources: "server.rack"
|
case .sources: "server.rack"
|
||||||
case .settings: "gear"
|
case .settings: "gear"
|
||||||
case .openURL: "link"
|
case .openURL: "link"
|
||||||
@@ -88,6 +92,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case .history: String(localized: "sidebar.mainItem.history")
|
case .history: String(localized: "sidebar.mainItem.history")
|
||||||
case .downloads: String(localized: "sidebar.mainItem.downloads")
|
case .downloads: String(localized: "sidebar.mainItem.downloads")
|
||||||
case .channels: String(localized: "sidebar.mainItem.channels")
|
case .channels: String(localized: "sidebar.mainItem.channels")
|
||||||
|
case .playlists: String(localized: "sidebar.mainItem.playlists")
|
||||||
case .sources: String(localized: "sidebar.mainItem.sources")
|
case .sources: String(localized: "sidebar.mainItem.sources")
|
||||||
case .settings: String(localized: "sidebar.mainItem.settings")
|
case .settings: String(localized: "sidebar.mainItem.settings")
|
||||||
case .openURL: String(localized: "sidebar.mainItem.openURL")
|
case .openURL: String(localized: "sidebar.mainItem.openURL")
|
||||||
@@ -132,6 +137,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case .history: return TabBarItem.history.rawValue
|
case .history: return TabBarItem.history.rawValue
|
||||||
case .downloads: return TabBarItem.downloads.rawValue
|
case .downloads: return TabBarItem.downloads.rawValue
|
||||||
case .channels: return TabBarItem.channels.rawValue
|
case .channels: return TabBarItem.channels.rawValue
|
||||||
|
case .playlists: return TabBarItem.playlists.rawValue
|
||||||
case .sources: return TabBarItem.sources.rawValue
|
case .sources: return TabBarItem.sources.rawValue
|
||||||
case .settings: return TabBarItem.settings.rawValue
|
case .settings: return TabBarItem.settings.rawValue
|
||||||
case .openURL: return "open-url"
|
case .openURL: return "open-url"
|
||||||
@@ -149,6 +155,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case .history: return .history
|
case .history: return .history
|
||||||
case .downloads: return .downloads
|
case .downloads: return .downloads
|
||||||
case .channels: return .manageChannels
|
case .channels: return .manageChannels
|
||||||
|
case .playlists: return .playlistsList
|
||||||
case .sources: return .sources
|
case .sources: return .sources
|
||||||
case .settings: return .settings
|
case .settings: return .settings
|
||||||
case .openURL: return .openURL
|
case .openURL: return .openURL
|
||||||
@@ -162,7 +169,7 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
case .subscriptions: self = .subscriptions
|
case .subscriptions: self = .subscriptions
|
||||||
case .channels: self = .channels
|
case .channels: self = .channels
|
||||||
case .bookmarks: self = .bookmarks
|
case .bookmarks: self = .bookmarks
|
||||||
case .playlists: return nil // No direct mapping - playlists isn't a SidebarMainItem
|
case .playlists: self = .playlists
|
||||||
case .history: self = .history
|
case .history: self = .history
|
||||||
case .downloads: self = .downloads
|
case .downloads: self = .downloads
|
||||||
case .sources: self = .sources
|
case .sources: self = .sources
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ struct UnifiedTabView: View {
|
|||||||
@State private var downloadsPath = NavigationPath()
|
@State private var downloadsPath = NavigationPath()
|
||||||
@State private var subscriptionsFeedPath = NavigationPath()
|
@State private var subscriptionsFeedPath = NavigationPath()
|
||||||
@State private var manageChannelsPath = NavigationPath()
|
@State private var manageChannelsPath = NavigationPath()
|
||||||
|
@State private var playlistsListPath = NavigationPath()
|
||||||
@State private var sourcesPath = NavigationPath()
|
@State private var sourcesPath = NavigationPath()
|
||||||
@State private var settingsPath = NavigationPath()
|
@State private var settingsPath = NavigationPath()
|
||||||
@State private var openURLPath = NavigationPath()
|
@State private var openURLPath = NavigationPath()
|
||||||
@@ -182,6 +183,16 @@ struct UnifiedTabView: View {
|
|||||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case .playlists:
|
||||||
|
Tab(value: SidebarItem.playlistsList) {
|
||||||
|
NavigationStack(path: $playlistsListPath) {
|
||||||
|
PlaylistsListView()
|
||||||
|
.withNavigationDestinations()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||||
|
}
|
||||||
|
|
||||||
case .sources:
|
case .sources:
|
||||||
Tab(value: SidebarItem.sources) {
|
Tab(value: SidebarItem.sources) {
|
||||||
NavigationStack(path: $sourcesPath) {
|
NavigationStack(path: $sourcesPath) {
|
||||||
@@ -340,6 +351,7 @@ struct UnifiedTabView: View {
|
|||||||
@State private var downloadsPath = NavigationPath()
|
@State private var downloadsPath = NavigationPath()
|
||||||
@State private var subscriptionsFeedPath = NavigationPath()
|
@State private var subscriptionsFeedPath = NavigationPath()
|
||||||
@State private var manageChannelsPath = NavigationPath()
|
@State private var manageChannelsPath = NavigationPath()
|
||||||
|
@State private var playlistsListPath = NavigationPath()
|
||||||
@State private var sourcesPath = NavigationPath()
|
@State private var sourcesPath = NavigationPath()
|
||||||
@State private var settingsPath = NavigationPath()
|
@State private var settingsPath = NavigationPath()
|
||||||
@State private var openURLPath = NavigationPath()
|
@State private var openURLPath = NavigationPath()
|
||||||
@@ -471,6 +483,15 @@ struct UnifiedTabView: View {
|
|||||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case .playlists:
|
||||||
|
Tab(value: SidebarItem.playlistsList) {
|
||||||
|
NavigationStack(path: $playlistsListPath) {
|
||||||
|
PlaylistsListView().withNavigationDestinations()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||||
|
}
|
||||||
|
|
||||||
case .sources:
|
case .sources:
|
||||||
Tab(value: SidebarItem.sources) {
|
Tab(value: SidebarItem.sources) {
|
||||||
NavigationStack(path: $sourcesPath) {
|
NavigationStack(path: $sourcesPath) {
|
||||||
@@ -582,6 +603,7 @@ struct UnifiedTabView: View {
|
|||||||
@State private var historyPath = NavigationPath()
|
@State private var historyPath = NavigationPath()
|
||||||
@State private var subscriptionsFeedPath = NavigationPath()
|
@State private var subscriptionsFeedPath = NavigationPath()
|
||||||
@State private var manageChannelsPath = NavigationPath()
|
@State private var manageChannelsPath = NavigationPath()
|
||||||
|
@State private var playlistsListPath = NavigationPath()
|
||||||
@State private var sourcesPath = NavigationPath()
|
@State private var sourcesPath = NavigationPath()
|
||||||
@State private var settingsPath = NavigationPath()
|
@State private var settingsPath = NavigationPath()
|
||||||
@State private var openURLPath = NavigationPath()
|
@State private var openURLPath = NavigationPath()
|
||||||
@@ -730,6 +752,16 @@ struct UnifiedTabView: View {
|
|||||||
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
Label(SidebarItem.manageChannels.title, systemImage: SidebarItem.manageChannels.systemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case .playlists:
|
||||||
|
Tab(value: SidebarItem.playlistsList) {
|
||||||
|
NavigationStack(path: $playlistsListPath) {
|
||||||
|
PlaylistsListView()
|
||||||
|
.withNavigationDestinations()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
Label(SidebarItem.playlistsList.title, systemImage: SidebarItem.playlistsList.systemImage)
|
||||||
|
}
|
||||||
|
|
||||||
case .sources:
|
case .sources:
|
||||||
Tab(value: SidebarItem.sources) {
|
Tab(value: SidebarItem.sources) {
|
||||||
NavigationStack(path: $sourcesPath) {
|
NavigationStack(path: $sourcesPath) {
|
||||||
@@ -886,6 +918,8 @@ extension UnifiedTabView {
|
|||||||
subscriptionsFeedPath.append(destination)
|
subscriptionsFeedPath.append(destination)
|
||||||
case .manageChannels:
|
case .manageChannels:
|
||||||
manageChannelsPath.append(destination)
|
manageChannelsPath.append(destination)
|
||||||
|
case .playlistsList:
|
||||||
|
playlistsListPath.append(destination)
|
||||||
case .sources:
|
case .sources:
|
||||||
sourcesPath.append(destination)
|
sourcesPath.append(destination)
|
||||||
case .settings:
|
case .settings:
|
||||||
|
|||||||
Reference in New Issue
Block a user