Replace search content type segmented picker with Menu on tvOS

Unifies the filter strip on tvOS so all filters (sort, date, duration,
content type) use the same inline Menu style instead of mixing menus
with a segmented picker.
This commit is contained in:
Arkadiusz Fal
2026-04-13 21:04:59 +02:00
parent 831773a609
commit 3c7581de1a
2 changed files with 26 additions and 2 deletions

View File

@@ -553,7 +553,18 @@ struct InstanceBrowseView: View {
} }
#endif #endif
// Content type segmented picker // Content type picker
#if os(tvOS)
filterMenu(
title: String(localized: "search.filters.type"),
selection: Binding(
get: { searchViewModel?.filters.type ?? .video },
set: { searchViewModel?.filters.type = $0 }
),
options: SearchContentType.allCases,
labelForOption: { $0.title }
)
#else
Picker("", selection: Binding( Picker("", selection: Binding(
get: { searchViewModel?.filters.type ?? .video }, get: { searchViewModel?.filters.type ?? .video },
set: { searchViewModel?.filters.type = $0 } set: { searchViewModel?.filters.type = $0 }
@@ -563,6 +574,7 @@ struct InstanceBrowseView: View {
} }
} }
.pickerStyle(.segmented) .pickerStyle(.segmented)
#endif
} }
.padding(.horizontal) .padding(.horizontal)
.padding(.vertical, 8) .padding(.vertical, 8)

View File

@@ -425,7 +425,18 @@ struct SearchView: View {
} }
#endif #endif
// Content type segmented picker // Content type picker
#if os(tvOS)
filterMenu(
title: String(localized: "search.filters.type"),
selection: Binding(
get: { searchViewModel?.filters.type ?? .video },
set: { searchViewModel?.filters.type = $0 }
),
options: SearchContentType.allCases,
labelForOption: { $0.title }
)
#else
Picker("", selection: Binding( Picker("", selection: Binding(
get: { searchViewModel?.filters.type ?? .video }, get: { searchViewModel?.filters.type ?? .video },
set: { searchViewModel?.filters.type = $0 } set: { searchViewModel?.filters.type = $0 }
@@ -435,6 +446,7 @@ struct SearchView: View {
} }
} }
.pickerStyle(.segmented) .pickerStyle(.segmented)
#endif
} }
.padding(.horizontal) .padding(.horizontal)
.padding(.vertical, 8) .padding(.vertical, 8)