From 55be01ac8468d46fbf0149067233325669fbe9c9 Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Sun, 4 Feb 2024 13:31:22 -0500 Subject: [PATCH 1/5] Minor Fix for Search View and Poster Button Text Fixes the Search View by adding padding to the results. Before the search "keyboard' would overlap the results but now the results will appear below the keyboard. I also added padding to the poster buttons text/title. When you would hover an item it would slightly cover the text/title. Now it should always be completely visible. --- Swiftfin tvOS/Components/PosterButton.swift | 1 + Swiftfin tvOS/Views/SearchView.swift | 37 +++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Swiftfin tvOS/Components/PosterButton.swift b/Swiftfin tvOS/Components/PosterButton.swift index bdca8f290..e44166955 100644 --- a/Swiftfin tvOS/Components/PosterButton.swift +++ b/Swiftfin tvOS/Components/PosterButton.swift @@ -149,6 +149,7 @@ extension PosterButton { .font(.footnote) .fontWeight(.regular) .foregroundColor(.primary) + .padding(.top, 1) .lineLimit(2) } diff --git a/Swiftfin tvOS/Views/SearchView.swift b/Swiftfin tvOS/Views/SearchView.swift index 33847f8e1..a48948edf 100644 --- a/Swiftfin tvOS/Views/SearchView.swift +++ b/Swiftfin tvOS/Views/SearchView.swift @@ -22,30 +22,33 @@ struct SearchView: View { @ViewBuilder private var resultsView: some View { - ScrollView(showsIndicators: false) { - VStack(spacing: 20) { - if !viewModel.movies.isEmpty { - itemsSection(title: L10n.movies, keyPath: \.movies) - } + GeometryReader { geo in + ScrollView(showsIndicators: false) { + VStack(spacing: 20) { + if !viewModel.movies.isEmpty { + itemsSection(title: L10n.movies, keyPath: \.movies) + } - if !viewModel.collections.isEmpty { - itemsSection(title: L10n.collections, keyPath: \.collections) - } + if !viewModel.collections.isEmpty { + itemsSection(title: L10n.collections, keyPath: \.collections) + } - if !viewModel.series.isEmpty { - itemsSection(title: L10n.tvShows, keyPath: \.series) - } + if !viewModel.series.isEmpty { + itemsSection(title: L10n.tvShows, keyPath: \.series) + } - if !viewModel.episodes.isEmpty { - itemsSection(title: L10n.episodes, keyPath: \.episodes) - } + if !viewModel.episodes.isEmpty { + itemsSection(title: L10n.episodes, keyPath: \.episodes) + } - if !viewModel.people.isEmpty { - itemsSection(title: L10n.people, keyPath: \.people) + if !viewModel.people.isEmpty { + itemsSection(title: L10n.people, keyPath: \.people) + } } } + .padding(.top, geo.size.height * 0.65) + .ignoresSafeArea() } - .ignoresSafeArea() } private func baseItemOnSelect(_ item: BaseItemDto) { From 30277fc4fabcffe7897a48104d049700e08b51bc Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Sun, 4 Feb 2024 21:18:34 -0500 Subject: [PATCH 2/5] Update SearchView.swift After looking at the code once more and looking up what .ignoresSafeArea() does. I removed it from the code and it does what I was trying to do from the begginning. So I removed my code changes there and just removed the ignoresSafeArea call. Maybe it was placed there by mistake. --- Swiftfin tvOS/Views/SearchView.swift | 36 +++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Swiftfin tvOS/Views/SearchView.swift b/Swiftfin tvOS/Views/SearchView.swift index a48948edf..4411449b0 100644 --- a/Swiftfin tvOS/Views/SearchView.swift +++ b/Swiftfin tvOS/Views/SearchView.swift @@ -22,32 +22,28 @@ struct SearchView: View { @ViewBuilder private var resultsView: some View { - GeometryReader { geo in - ScrollView(showsIndicators: false) { - VStack(spacing: 20) { - if !viewModel.movies.isEmpty { - itemsSection(title: L10n.movies, keyPath: \.movies) - } + ScrollView(showsIndicators: false) { + VStack(spacing: 20) { + if !viewModel.movies.isEmpty { + itemsSection(title: L10n.movies, keyPath: \.movies) + } - if !viewModel.collections.isEmpty { - itemsSection(title: L10n.collections, keyPath: \.collections) - } + if !viewModel.collections.isEmpty { + itemsSection(title: L10n.collections, keyPath: \.collections) + } - if !viewModel.series.isEmpty { - itemsSection(title: L10n.tvShows, keyPath: \.series) - } + if !viewModel.series.isEmpty { + itemsSection(title: L10n.tvShows, keyPath: \.series) + } - if !viewModel.episodes.isEmpty { - itemsSection(title: L10n.episodes, keyPath: \.episodes) - } + if !viewModel.episodes.isEmpty { + itemsSection(title: L10n.episodes, keyPath: \.episodes) + } - if !viewModel.people.isEmpty { - itemsSection(title: L10n.people, keyPath: \.people) - } + if !viewModel.people.isEmpty { + itemsSection(title: L10n.people, keyPath: \.people) } } - .padding(.top, geo.size.height * 0.65) - .ignoresSafeArea() } } From 5c93c804cbb5b8ed4d782d6c4fed051b59849b10 Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Thu, 8 Feb 2024 23:11:17 -0500 Subject: [PATCH 3/5] Update SearchView.swift Add back in .ignoreSafeArea upon request but only for the bottom and sides. Should still fix the overlap issue with the keyboard. --- Swiftfin tvOS/Views/SearchView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Swiftfin tvOS/Views/SearchView.swift b/Swiftfin tvOS/Views/SearchView.swift index 4411449b0..87188cc19 100644 --- a/Swiftfin tvOS/Views/SearchView.swift +++ b/Swiftfin tvOS/Views/SearchView.swift @@ -43,7 +43,7 @@ struct SearchView: View { if !viewModel.people.isEmpty { itemsSection(title: L10n.people, keyPath: \.people) } - } + }.ignoresSafeArea(edges: [.bottom, .horizontal]) } } From d69658bbdaa87ac818e895b533c10b8d98f5cd84 Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Fri, 9 Feb 2024 18:57:23 -0500 Subject: [PATCH 4/5] Update PosterButton.swift --- Swiftfin tvOS/Components/PosterButton.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Swiftfin tvOS/Components/PosterButton.swift b/Swiftfin tvOS/Components/PosterButton.swift index e44166955..bdca8f290 100644 --- a/Swiftfin tvOS/Components/PosterButton.swift +++ b/Swiftfin tvOS/Components/PosterButton.swift @@ -149,7 +149,6 @@ extension PosterButton { .font(.footnote) .fontWeight(.regular) .foregroundColor(.primary) - .padding(.top, 1) .lineLimit(2) } From 5dcb9066db6f75d11ce7f01bc2f544b84bdbd47d Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Wed, 14 Feb 2024 19:39:29 -0500 Subject: [PATCH 5/5] Update SearchView.swift --- Swiftfin tvOS/Views/SearchView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Swiftfin tvOS/Views/SearchView.swift b/Swiftfin tvOS/Views/SearchView.swift index 87188cc19..2706ec811 100644 --- a/Swiftfin tvOS/Views/SearchView.swift +++ b/Swiftfin tvOS/Views/SearchView.swift @@ -43,8 +43,8 @@ struct SearchView: View { if !viewModel.people.isEmpty { itemsSection(title: L10n.people, keyPath: \.people) } - }.ignoresSafeArea(edges: [.bottom, .horizontal]) - } + } + }.ignoresSafeArea(edges: [.bottom, .horizontal]) } private func baseItemOnSelect(_ item: BaseItemDto) {