@@ -258,10 +258,11 @@ class SearchViewController: ThemeableViewController, WMFNavigationBarConfiguring
258258
259259 private func configureNavigationBar( ) {
260260
261- let title = customTitle ?? CommonStrings . searchTitle
261+ var title = customTitle ?? CommonStrings . searchTitle
262262
263263 // check if it comes from article vc
264264 let isPushed = ( navigationController? . viewControllers. first !== self )
265+
265266 var alignment : WMFNavigationBarTitleConfig . Alignment = ( needsCenteredTitle || isPushed) ? . centerCompact : . leadingCompact
266267 extendedLayoutIncludesOpaqueBars = false
267268 if #available( iOS 18 , * ) {
@@ -270,21 +271,18 @@ class SearchViewController: ThemeableViewController, WMFNavigationBarConfiguring
270271 extendedLayoutIncludesOpaqueBars = true
271272 }
272273 }
273- let wButton = UIButton ( type: . custom)
274- wButton. setImage ( UIImage ( named: " W " ) , for: . normal)
275274
276275 var titleConfig : WMFNavigationBarTitleConfig
277276 titleConfig = WMFNavigationBarTitleConfig ( title: title, customView: nil , alignment: alignment)
278277
279-
280278 if #available( iOS 18 , * ) {
281279 if UIDevice . current. userInterfaceIdiom == . pad && traitCollection. horizontalSizeClass == . regular {
282280 titleConfig = WMFNavigationBarTitleConfig ( title: CommonStrings . searchTitle, customView: nil , alignment: . leadingLarge)
283281 }
284282 }
285283
286- let profileButtonConfig : WMFNavigationBarProfileButtonConfig ?
287- let tabsButtonConfig : WMFNavigationBarTabsButtonConfig ?
284+ var profileButtonConfig : WMFNavigationBarProfileButtonConfig ?
285+ var tabsButtonConfig : WMFNavigationBarTabsButtonConfig ?
288286 if let dataStore {
289287 profileButtonConfig = self . profileButtonConfig ( target: self , action: #selector( userDidTapProfile) , dataStore: dataStore, yirDataController: yirDataController, leadingBarButtonItem: nil )
290288 let leadingItem : UIBarButtonItem ? = ( currentEmbeddedViewController === historyViewController) ? deleteButton : nil
@@ -294,9 +292,21 @@ class SearchViewController: ThemeableViewController, WMFNavigationBarConfiguring
294292 tabsButtonConfig = nil
295293 }
296294
295+ // If in article view, except in iPad, we only keep the clear button
296+ var isPushedWithoutTabsAndProfile = false
297+ if isPushed && !( UIDevice . current. userInterfaceIdiom == . pad && traitCollection. horizontalSizeClass == . regular) {
298+ profileButtonConfig = nil
299+ tabsButtonConfig = nil
300+ isPushedWithoutTabsAndProfile = true
301+ }
302+
297303 let searchBarConfig = WMFNavigationBarSearchConfig ( searchResultsController: nil , searchControllerDelegate: self , searchResultsUpdater: self , searchBarDelegate: self , searchBarPlaceholder: CommonStrings . searchBarPlaceholder, showsScopeBar: false , scopeButtonTitles: nil )
298304
299305 configureNavigationBar ( titleConfig: titleConfig, backButtonConfig: nil , closeButtonConfig: nil , profileButtonConfig: profileButtonConfig, tabsButtonConfig: tabsButtonConfig, searchBarConfig: searchBarConfig, hideNavigationBarOnScroll: !presentingSearchResults)
306+
307+ if isPushedWithoutTabsAndProfile && currentEmbeddedViewController === historyViewController {
308+ navigationItem. rightBarButtonItems = [ deleteButton]
309+ }
300310 }
301311
302312 @MainActor
0 commit comments