From e905932cfa5d283cd035b8cb43a027a780918969 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 18 Jul 2026 12:54:47 +0200 Subject: [PATCH] Use toolbar search placement on iPad channel view The navigationBarDrawer search field on iPad added a resting scroll position above the banner on iOS 27, letting the view scroll past the banner top with the mirrored banner filling the gap. iPhone keeps the drawer placement since its header reserves space for the search bar. --- Yattee/Views/Channel/ChannelView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Yattee/Views/Channel/ChannelView.swift b/Yattee/Views/Channel/ChannelView.swift index 2540c5e1..7119f3d8 100644 --- a/Yattee/Views/Channel/ChannelView.swift +++ b/Yattee/Views/Channel/ChannelView.swift @@ -208,10 +208,16 @@ struct ChannelView: View { content() #if os(iOS) .if(supportsChannelSearch) { view in + // iPhone: search bar drawer in the navigation area (header reserves + // space for it). iPad: toolbar search button — the drawer would add + // a resting scroll position above the banner, letting the view + // scroll past the banner top. view.searchable( text: $searchText, isPresented: $isSearchActive, - placement: .navigationBarDrawer(displayMode: .automatic), + placement: horizontalSizeClass == .compact + ? .navigationBarDrawer(displayMode: .automatic) + : .toolbar, prompt: Text("channel.search.placeholder") ) }