diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift index 075a09464..0ff39e4e4 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift @@ -14,7 +14,6 @@ struct FeedCardNavigationLink: View { let destination = LinkItemDetailView(viewModel: LinkItemDetailViewModel(item: item, homeFeedViewModel: viewModel)) #if os(iOS) let modifiedDestination = destination - .navigationBarHidden(true) .navigationTitle("") #else let modifiedDestination = destination @@ -54,7 +53,6 @@ struct GridCardNavigationLink: View { let destination = LinkItemDetailView(viewModel: LinkItemDetailViewModel(item: item, homeFeedViewModel: viewModel)) #if os(iOS) let modifiedDestination = destination - .navigationBarHidden(true) .navigationTitle("") #else let modifiedDestination = destination diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 6d1098678..62bd31f04 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -27,8 +27,7 @@ private let enableGrid = UIDevice.isIPad || FeatureFlag.enableGridCardsOnPhone loadItems(isRefresh: true) } .searchable( - text: $viewModel.searchTerm, - placement: .navigationBarDrawer + text: $viewModel.searchTerm ) { if viewModel.searchTerm.isEmpty { Text("Inbox").searchCompletion("in:inbox ") diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeView.swift index 1fbbe840b..b025250da 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeView.swift @@ -9,7 +9,7 @@ struct HomeView: View { NavigationView { HomeFeedContainerView(viewModel: viewModel) } - .navigationViewStyle(StackNavigationViewStyle()) + .navigationViewStyle(.stack) .accentColor(.appGrayTextContrast) } else { HomeFeedContainerView(viewModel: viewModel) diff --git a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift index 6230a4cfb..1b5124b36 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift @@ -136,14 +136,27 @@ struct LinkItemDetailView: View { ) } + // We always want this hidden but setting it to false initially + // fixes a bug where SwiftUI searchable will always show the nav bar + // if the search field is active when pushing. + @State var hideNavBar = false + var body: some View { #if os(iOS) if viewModel.item.isPDF { fixedNavBarReader - .task { viewModel.trackReadEvent() } + .navigationBarHidden(hideNavBar) + .task { + hideNavBar = true + viewModel.trackReadEvent() + } } else { WebReaderContainerView(item: viewModel.item, homeFeedViewModel: viewModel.homeFeedViewModel) - .task { viewModel.trackReadEvent() } + .navigationBarHidden(hideNavBar) + .task { + hideNavBar = true + viewModel.trackReadEvent() + } } #else fixedNavBarReader