mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
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:
@@ -14523,7 +14523,7 @@
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "YouTube Enhancements"
|
||||
"value" : "Integrations"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,11 +98,13 @@ enum DescriptionText {
|
||||
/// fails or the destination isn't a URL the app can handle.
|
||||
@MainActor
|
||||
private func openInSystemBrowser(_ url: URL) {
|
||||
#if canImport(UIKit) && !os(watchOS)
|
||||
#if os(iOS)
|
||||
UIApplication.shared.open(url)
|
||||
#elseif canImport(AppKit)
|
||||
#elseif os(macOS)
|
||||
NSWorkspace.shared.open(url)
|
||||
#endif
|
||||
// tvOS has no system browser and no way to tap description links in the
|
||||
// first place — this path is unreachable there.
|
||||
}
|
||||
|
||||
extension View {
|
||||
|
||||
@@ -96,9 +96,9 @@ struct ResolvedLinkPromptsModifier: ViewModifier {
|
||||
|
||||
@MainActor
|
||||
private func openInSystemBrowser(_ url: URL) {
|
||||
#if canImport(UIKit) && !os(watchOS)
|
||||
#if os(iOS)
|
||||
UIApplication.shared.open(url)
|
||||
#elseif canImport(AppKit)
|
||||
#elseif os(macOS)
|
||||
NSWorkspace.shared.open(url)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -166,8 +166,8 @@ struct SettingsView: View {
|
||||
}
|
||||
|
||||
if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) {
|
||||
NavigationLink { TVSidebarDetailContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: {
|
||||
Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle")
|
||||
NavigationLink { TVSidebarDetailContainer(systemImage: "puzzlepiece.extension", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: {
|
||||
Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "puzzlepiece.extension")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ struct SettingsView: View {
|
||||
NavigationLink {
|
||||
YouTubeEnhancementsSettingsView()
|
||||
} 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 .downloads: return "arrow.down.circle"
|
||||
case .privacy: return "hand.raised"
|
||||
case .youtubeEnhancements: return "play.rectangle"
|
||||
case .youtubeEnhancements: return "puzzlepiece.extension"
|
||||
case .advanced: return "gearshape.2"
|
||||
case .about: return "info.circle"
|
||||
}
|
||||
|
||||
@@ -16,7 +16,11 @@ struct YouTubeEnhancementsSettingsView: View {
|
||||
SponsorBlockSection(settings: settings)
|
||||
ReturnYouTubeDislikeSection(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)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
|
||||
Reference in New Issue
Block a user