From 6514cb426e62aafcc34f60f3ad7a7529433866ba Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 16 Jul 2026 21:35:47 +0200 Subject: [PATCH] Keep macOS channel search bar pinned right during search The content type picker in the center .principal toolbar slot is what constrains the .searchable field to the trailing edge. Dropping the picker when a search was submitted let the toolbar reflow and the search field re-center. Keep the picker in place and disable it while searching instead. --- 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 d4c6f8e9..c49e13c9 100644 --- a/Yattee/Views/Channel/ChannelView.swift +++ b/Yattee/Views/Channel/ChannelView.swift @@ -380,10 +380,16 @@ struct ChannelView: View { )) .toolbar { #if os(macOS) - if supportsChannelTabs && !(isSearchActive && hasSearched) { + // Keep the content picker in the center `.principal` slot even while + // searching. Its presence is what pins the trailing `.searchable` + // field to the right edge — dropping it (or making it zero-width) + // lets the search field re-center. During search it's disabled so the + // user can't switch tabs while the content area shows search results. + if supportsChannelTabs { ToolbarItem(placement: .principal) { contentTypePicker .fixedSize() + .disabled(isSearchActive && hasSearched) } } #else