Add feature flag to disable hide shorts functionality

The hide shorts feature is no longer working due to API changes that prevent reliable detection of short videos. This commit introduces a feature flag system to disable the functionality while preserving the ability to easily restore it if the API issue is resolved.

Changes:
- Add FeatureFlags.swift with hideShortsEnabled flag (currently disabled)
- Hide all HideShortsButtons UI elements when flag is disabled
- Disable shorts filtering logic in ContentItemView, FavoriteItemView, and FeedModel
- Preserve hideShorts user preference for future restoration
This commit is contained in:
Arkadiusz Fal
2025-11-20 13:05:12 +01:00
parent 680ac9a8a0
commit bb2bd86c07
6 changed files with 55 additions and 25 deletions

View File

@@ -54,7 +54,7 @@ struct ContentItemView: View {
return false
}
guard hideShorts, item.contentType == .video, let video = item.video else {
guard FeatureFlags.hideShortsEnabled, hideShorts, item.contentType == .video, let video = item.video else {
return true
}

View File

@@ -5,22 +5,24 @@ struct HideShortsButtons: View {
@Default(.hideShorts) private var hideShorts
var body: some View {
Button {
hideShorts.toggle()
} label: {
Group {
if hideShorts {
Label("Short videos: hidden", systemImage: "bolt.slash.fill")
.help("Short videos: hidden")
} else {
Label("Short videos: visible", systemImage: "bolt.fill")
.help("Short videos: visible")
if FeatureFlags.hideShortsEnabled {
Button {
hideShorts.toggle()
} label: {
Group {
if hideShorts {
Label("Short videos: hidden", systemImage: "bolt.slash.fill")
.help("Short videos: hidden")
} else {
Label("Short videos: visible", systemImage: "bolt.fill")
.help("Short videos: visible")
}
}
#if os(tvOS)
.font(.caption)
.imageScale(.small)
#endif
}
#if os(tvOS)
.font(.caption)
.imageScale(.small)
#endif
}
}
}