Rename YouTube Enhancements settings to Integrations

Also swap the icon to puzzlepiece.extension, which better conveys that
this section houses third-party service hookups (SponsorBlock, Return
YouTube Dislike, DeArrow, short-link resolution) rather than being
YouTube-specific.

Hide the Resolve Short Links toggle on tvOS — there's no way to tap
inline description links or reach a system browser there — and tighten
the openInSystemBrowser platform guards so the iOS-only UIApplication
path isn't compiled on tvOS.
This commit is contained in:
Arkadiusz Fal
2026-04-23 07:34:31 +02:00
parent 5a839da1bd
commit f804cc1521
5 changed files with 15 additions and 9 deletions

View File

@@ -14523,7 +14523,7 @@
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "YouTube Enhancements" "value" : "Integrations"
} }
} }
} }

View File

@@ -98,11 +98,13 @@ enum DescriptionText {
/// fails or the destination isn't a URL the app can handle. /// fails or the destination isn't a URL the app can handle.
@MainActor @MainActor
private func openInSystemBrowser(_ url: URL) { private func openInSystemBrowser(_ url: URL) {
#if canImport(UIKit) && !os(watchOS) #if os(iOS)
UIApplication.shared.open(url) UIApplication.shared.open(url)
#elseif canImport(AppKit) #elseif os(macOS)
NSWorkspace.shared.open(url) NSWorkspace.shared.open(url)
#endif #endif
// tvOS has no system browser and no way to tap description links in the
// first place this path is unreachable there.
} }
extension View { extension View {

View File

@@ -96,9 +96,9 @@ struct ResolvedLinkPromptsModifier: ViewModifier {
@MainActor @MainActor
private func openInSystemBrowser(_ url: URL) { private func openInSystemBrowser(_ url: URL) {
#if canImport(UIKit) && !os(watchOS) #if os(iOS)
UIApplication.shared.open(url) UIApplication.shared.open(url)
#elseif canImport(AppKit) #elseif os(macOS)
NSWorkspace.shared.open(url) NSWorkspace.shared.open(url)
#endif #endif
} }

View File

@@ -166,8 +166,8 @@ struct SettingsView: View {
} }
if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) { if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) {
NavigationLink { TVSidebarDetailContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: { NavigationLink { TVSidebarDetailContainer(systemImage: "puzzlepiece.extension", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: {
Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle") Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "puzzlepiece.extension")
} }
} }
@@ -302,7 +302,7 @@ struct SettingsView: View {
NavigationLink { NavigationLink {
YouTubeEnhancementsSettingsView() YouTubeEnhancementsSettingsView()
} label: { } label: {
Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle") Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "puzzlepiece.extension")
} }
} }
} }
@@ -402,7 +402,7 @@ enum SettingsSection: String, CaseIterable, Identifiable {
case .notifications: return "bell.badge" case .notifications: return "bell.badge"
case .downloads: return "arrow.down.circle" case .downloads: return "arrow.down.circle"
case .privacy: return "hand.raised" case .privacy: return "hand.raised"
case .youtubeEnhancements: return "play.rectangle" case .youtubeEnhancements: return "puzzlepiece.extension"
case .advanced: return "gearshape.2" case .advanced: return "gearshape.2"
case .about: return "info.circle" case .about: return "info.circle"
} }

View File

@@ -16,7 +16,11 @@ struct YouTubeEnhancementsSettingsView: View {
SponsorBlockSection(settings: settings) SponsorBlockSection(settings: settings)
ReturnYouTubeDislikeSection(settings: settings) ReturnYouTubeDislikeSection(settings: settings)
DeArrowSection(settings: settings) DeArrowSection(settings: settings)
#if !os(tvOS)
// tvOS has no in-description link tapping or system browser,
// so short-link resolution would have nothing to act on.
ResolveShortLinksSection(settings: settings) ResolveShortLinksSection(settings: settings)
#endif
} }
} }
#if !os(tvOS) #if !os(tvOS)