Fix iOS menu text disappearing in navigation headers

Extended the ZStack overlay fix to all iOS navigation header menus
where text labels would disappear when tapping the menu:

- HomeView: "Home" title menu
- PopularView: "Popular" title with icon menu
- TrendingView: Country/flag title menu
- PlaylistsView: Playlist title with thumbnail menu
- ChannelPlaylistView: Playlist title with thumbnail menu
- OpenVideosView: Playback mode picker menu

All menus now use the same pattern as PlaybackSettings:
- Visible static label layer in ZStack
- Invisible Menu overlay with .opacity(0)
- Prevents text disappearing and resizing animations
This commit is contained in:
Arkadiusz Fal
2025-11-23 14:16:21 +01:00
parent 65e86d30ec
commit 9177abb0ec
6 changed files with 189 additions and 99 deletions

View File

@@ -190,40 +190,7 @@ struct PlaylistsView: View {
#if os(iOS)
var playlistsMenu: some View {
let title = currentPlaylist?.title ?? "Playlists"
return Menu {
Menu {
selectPlaylistButton
} label: {
Label(title, systemImage: "list.and.film")
}
Section {
if let currentPlaylist {
playButtons
editPlaylistButton
if let account = accounts.current {
FavoriteButton(item: FavoriteItem(section: .playlist(account.id, currentPlaylist.id)))
.id(currentPlaylist.id)
}
}
}
if accounts.signedIn {
newPlaylistButton
}
ListingStyleButtons(listingStyle: $playlistListingStyle)
Section {
HideWatchedButtons()
HideShortsButtons()
}
Section {
SettingsButtons()
}
} label: {
return ZStack {
HStack(spacing: 12) {
HStack(spacing: 6) {
Image(systemName: "list.and.film")
@@ -239,9 +206,61 @@ struct PlaylistsView: View {
.imageScale(.small)
.lineLimit(1)
.frame(maxWidth: 320)
.transaction { t in t.animation = nil }
Menu {
Menu {
selectPlaylistButton
} label: {
Label(title, systemImage: "list.and.film")
}
Section {
if let currentPlaylist {
playButtons
editPlaylistButton
if let account = accounts.current {
FavoriteButton(item: FavoriteItem(section: .playlist(account.id, currentPlaylist.id)))
.id(currentPlaylist.id)
}
}
}
if accounts.signedIn {
newPlaylistButton
}
ListingStyleButtons(listingStyle: $playlistListingStyle)
Section {
HideWatchedButtons()
HideShortsButtons()
}
Section {
SettingsButtons()
}
} label: {
HStack(spacing: 12) {
HStack(spacing: 6) {
Image(systemName: "list.and.film")
Text(title)
.font(.headline)
}
.foregroundColor(.primary)
Image(systemName: "chevron.down.circle.fill")
.foregroundColor(.accentColor)
}
.imageScale(.small)
.lineLimit(1)
.frame(maxWidth: 320)
.opacity(0)
}
.disabled(!accounts.signedIn)
}
.disabled(!accounts.signedIn)
.transaction { t in t.animation = nil }
}
#endif