Rename TVSettingsContainer to TVSidebarDetailContainer

The container is now used beyond settings (Open URL and Remote Control
tabs), so the name is broadened to reflect its general role as a
tvOS sidebar-decorated detail container.
This commit is contained in:
Arkadiusz Fal
2026-04-16 06:52:28 +02:00
parent 29e8d64c35
commit b8390577cc
3 changed files with 15 additions and 15 deletions

View File

@@ -752,7 +752,7 @@ struct UnifiedTabView: View {
case .openURL: case .openURL:
Tab(value: SidebarItem.openURL) { Tab(value: SidebarItem.openURL) {
NavigationStack(path: $openURLPath) { NavigationStack(path: $openURLPath) {
TVSettingsContainer( TVSidebarDetailContainer(
systemImage: SidebarItem.openURL.systemImage, systemImage: SidebarItem.openURL.systemImage,
title: SidebarItem.openURL.title title: SidebarItem.openURL.title
) { ) {
@@ -767,7 +767,7 @@ struct UnifiedTabView: View {
case .remoteControl: case .remoteControl:
Tab(value: SidebarItem.remoteControl) { Tab(value: SidebarItem.remoteControl) {
NavigationStack(path: $remoteControlPath) { NavigationStack(path: $remoteControlPath) {
TVSettingsContainer( TVSidebarDetailContainer(
systemImage: SidebarItem.remoteControl.systemImage, systemImage: SidebarItem.remoteControl.systemImage,
title: SidebarItem.remoteControl.title title: SidebarItem.remoteControl.title
) { ) {

View File

@@ -93,7 +93,7 @@ struct SettingsView: View {
List { List {
if let appEnvironment { if let appEnvironment {
NavigationLink { NavigationLink {
TVSettingsContainer(systemImage: "server.rack", title: String(localized: "sources.title")) { SourcesListView() } TVSidebarDetailContainer(systemImage: "server.rack", title: String(localized: "sources.title")) { SourcesListView() }
} label: { } label: {
HStack { HStack {
Label(String(localized: "sources.title"), systemImage: "server.rack") Label(String(localized: "sources.title"), systemImage: "server.rack")
@@ -107,7 +107,7 @@ struct SettingsView: View {
.accessibilityIdentifier("settings.row.sources") .accessibilityIdentifier("settings.row.sources")
NavigationLink { NavigationLink {
TVSettingsContainer(systemImage: "icloud", title: String(localized: "settings.icloud.title")) { iCloudSettingsView() } TVSidebarDetailContainer(systemImage: "icloud", title: String(localized: "settings.icloud.title")) { iCloudSettingsView() }
} label: { } label: {
HStack { HStack {
Label(String(localized: "settings.icloud.title"), systemImage: "icloud") Label(String(localized: "settings.icloud.title"), systemImage: "icloud")
@@ -123,33 +123,33 @@ struct SettingsView: View {
} }
} }
NavigationLink { TVSettingsContainer(systemImage: "paintbrush", title: String(localized: "settings.appearance.sectionTitle")) { AppearanceSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "paintbrush", title: String(localized: "settings.appearance.sectionTitle")) { AppearanceSettingsView() } } label: {
Label(String(localized: "settings.appearance.sectionTitle"), systemImage: "paintbrush") Label(String(localized: "settings.appearance.sectionTitle"), systemImage: "paintbrush")
} }
NavigationLink { TVSettingsContainer(systemImage: "hand.tap", title: String(localized: "settings.layoutNavigation.title")) { LayoutNavigationSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "hand.tap", title: String(localized: "settings.layoutNavigation.title")) { LayoutNavigationSettingsView() } } label: {
Label(String(localized: "settings.layoutNavigation.title"), systemImage: "hand.tap") Label(String(localized: "settings.layoutNavigation.title"), systemImage: "hand.tap")
} }
NavigationLink { TVSettingsContainer(systemImage: "play.circle", title: String(localized: "settings.playback.sectionTitle")) { PlaybackSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "play.circle", title: String(localized: "settings.playback.sectionTitle")) { PlaybackSettingsView() } } label: {
Label(String(localized: "settings.playback.sectionTitle"), systemImage: "play.circle") Label(String(localized: "settings.playback.sectionTitle"), systemImage: "play.circle")
} }
NavigationLink { TVSettingsContainer(systemImage: "hand.raised", title: String(localized: "settings.privacy.title")) { PrivacySettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "hand.raised", title: String(localized: "settings.privacy.title")) { PrivacySettingsView() } } label: {
Label(String(localized: "settings.privacy.title"), systemImage: "hand.raised") Label(String(localized: "settings.privacy.title"), systemImage: "hand.raised")
} }
NavigationLink { TVSettingsContainer(systemImage: "gearshape.2", title: String(localized: "settings.advanced.title")) { AdvancedSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "gearshape.2", title: String(localized: "settings.advanced.title")) { AdvancedSettingsView() } } label: {
Label(String(localized: "settings.advanced.title"), systemImage: "gearshape.2") Label(String(localized: "settings.advanced.title"), systemImage: "gearshape.2")
} }
if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) { if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) {
NavigationLink { TVSettingsContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: {
Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle") Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle")
} }
} }
NavigationLink { TVSettingsContainer(systemImage: "info.circle", title: String(localized: "settings.about.title")) { AboutView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "info.circle", title: String(localized: "settings.about.title")) { AboutView() } } label: {
Label(String(localized: "settings.about.title"), systemImage: "info.circle") Label(String(localized: "settings.about.title"), systemImage: "info.circle")
} }
} }
@@ -384,10 +384,10 @@ enum SettingsSection: String, CaseIterable, Identifiable {
} }
} }
// MARK: - tvOS Settings Container // MARK: - tvOS Sidebar Detail Container
#if os(tvOS) #if os(tvOS)
struct TVSettingsContainer<Content: View>: View { struct TVSidebarDetailContainer<Content: View>: View {
let content: Content let content: Content
var systemImage: String? var systemImage: String?
var title: String? var title: String?

View File

@@ -60,7 +60,7 @@ struct SourcesListView: View {
} }
#if os(tvOS) #if os(tvOS)
.navigationDestination(isPresented: $showingAddSheet) { .navigationDestination(isPresented: $showingAddSheet) {
TVSettingsContainer(systemImage: "plus.circle", title: String(localized: "sources.newSource")) { AddSourceView() } TVSidebarDetailContainer(systemImage: "plus.circle", title: String(localized: "sources.newSource")) { AddSourceView() }
} }
#else #else
.sheet(isPresented: $showingAddSheet) { .sheet(isPresented: $showingAddSheet) {
@@ -69,7 +69,7 @@ struct SourcesListView: View {
#endif #endif
#if os(tvOS) #if os(tvOS)
.navigationDestination(item: $sourceToEdit) { source in .navigationDestination(item: $sourceToEdit) { source in
TVSettingsContainer(systemImage: "pencil.circle", title: String(localized: "sources.editSource")) { EditSourceView(source: source) } TVSidebarDetailContainer(systemImage: "pencil.circle", title: String(localized: "sources.editSource")) { EditSourceView(source: source) }
} }
#else #else
.sheet(item: $sourceToEdit) { source in .sheet(item: $sourceToEdit) { source in