From 84db5d0c42437447e51d59292898454088bce7ff Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 13 Apr 2026 21:42:07 +0200 Subject: [PATCH] Use List instead of Form for View Options on tvOS Form inside a sheet causes clipped rows and invisible text on focused items due to white-on-white rendering. Use a plain List on tvOS which handles the focus styling correctly. --- .../Views/Components/ViewOptionsSheet.swift | 51 +++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/Yattee/Views/Components/ViewOptionsSheet.swift b/Yattee/Views/Components/ViewOptionsSheet.swift index c45f11a6..4de46cee 100644 --- a/Yattee/Views/Components/ViewOptionsSheet.swift +++ b/Yattee/Views/Components/ViewOptionsSheet.swift @@ -33,15 +33,58 @@ struct ViewOptionsSheet: View { var body: some View { #if os(tvOS) - NavigationStack { - formContent - } - .padding(.horizontal, 40) + tvOSContent #else formContent #endif } + #if os(tvOS) + private var tvOSContent: some View { + List { + Section { + Picker(selection: $layout) { + ForEach(VideoListLayout.allCases, id: \.self) { option in + Label(option.displayName, systemImage: option.systemImage) + .tag(option) + } + } label: { + Text("viewOptions.layout") + } + .pickerStyle(.segmented) + + if layout == .list { + Picker("viewOptions.rowSize", selection: $rowStyle) { + Text("viewOptions.rowSize.compact").tag(VideoRowStyle.compact) + Text("viewOptions.rowSize.regular").tag(VideoRowStyle.regular) + Text("viewOptions.rowSize.large").tag(VideoRowStyle.large) + } + } + + if layout == .grid { + Picker("viewOptions.columns.header", selection: $gridColumns) { + ForEach(1...maxGridColumns, id: \.self) { count in + Text("\(count)").tag(count) + } + } + } + + if let hideWatched = hideWatched { + Toggle("viewOptions.hideWatched", isOn: hideWatched) + } + + if let channelStripSize = channelStripSize { + Picker("viewOptions.channelStrip", selection: channelStripSize) { + ForEach(ChannelStripSize.allCases, id: \.self) { size in + Text(size.displayName).tag(size) + } + } + } + } + } + } + #endif + private var formContent: some View { Form { // Single section with all options