Commit d9e3aaf2 authored by Kourser's avatar Kourser
Browse files

fix(ios): pin the episode search field too

The same collision as the sidebar's search bar, on the screen where you
actually look for an episode: iOS 26 floats .searchable at the bottom,
the now-playing bar's safe-area inset takes that strip, and the field
stops being rendered as soon as something plays. I fixed one of the two
and missed this one.

The placement now lives in one named constant with the reasoning attached
rather than being spelled out per call site, so the next .searchable does
not quietly reintroduce it. SearchView is left alone: it is a sheet, with
no now-playing bar to compete with.

Co-Authored-By: default avatarClaude Opus 5 <noreply@anthropic.com>
parent 16ea251e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -61,7 +61,8 @@ adopte le [versionnage sémantique](https://semver.org/lang/fr/).
  champ de recherche en bas de l'écran, exactement là où la barre de lecture
  réserve sa place. Le champ n'était plus affiché du tout dès qu'un épisode
  était chargé. Il est désormais épinglé sous le titre, où les deux ne se
  disputent plus la même zone.
  disputent plus la même zone — dans la barre latérale **comme** dans la page
  d'un podcast, « Rechercher dans les épisodes » ayant le même défaut.
- **« Nouveautés » restait vide sans moyen d'en sortir** : l'écran invitait à
  tirer pour actualiser, mais le geste n'avait aucun effet — l'état vide n'était
  pas défilable. Il l'est maintenant, et la liste se recharge après chaque
+11 −0
Original line number Diff line number Diff line
import SwiftUI

#if os(iOS)
extension SearchFieldPlacement {
    /// Pinned under the title. iOS 26 floats the default placement at the very
    /// bottom of the screen, which is where the now-playing bar reserves space
    /// through a safe-area inset: the two compete for the same strip and the
    /// field stops being rendered entirely as soon as an episode is loaded.
    /// Every screen that sits behind that bar uses this placement instead.
    static let underTitle = SearchFieldPlacement.navigationBarDrawer(displayMode: .always)
}
#endif

extension View {
    /// Text-field tuning for URL entry. The autocapitalization/keyboard
    /// modifiers are iOS-only, so they are compiled out on macOS.
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ struct PodcastDetailView: View {
                .background(.bar)
        }
        #else
        .searchable(text: $episodeSearch, prompt: "Rechercher dans les épisodes")
        .searchable(text: $episodeSearch, placement: .underTitle,
                    prompt: "Rechercher dans les épisodes")
        #endif
        .toolbar {
            ToolbarItem(placement: .primaryAction) {
+2 −9
Original line number Diff line number Diff line
@@ -90,16 +90,9 @@ struct RootView: View {
                }
            }
            .navigationTitle("Skingomz")
            // iOS 26 floats the search field at the BOTTOM of the screen, where
            // the now-playing bar's safe-area inset displaces it entirely — the
            // field simply stops being rendered once something is playing. Pin
            // it under the title instead, so the two never compete.
            #if os(iOS)
            .searchable(
                text: $searchText,
                placement: .navigationBarDrawer(displayMode: .always),
                prompt: "Rechercher (podcasts, épisodes)"
            )
            .searchable(text: $searchText, placement: .underTitle,
                        prompt: "Rechercher (podcasts, épisodes)")
            #else
            .searchable(text: $searchText, prompt: "Rechercher (podcasts, épisodes)")
            #endif