Fix iOS menu text disappearing in ChannelVideosView

Applied ZStack overlay fix to the channel menu in ChannelVideosView
where the channel name, avatar, subscriber count, and view count
would disappear when tapping the menu.

Uses the same pattern:
- Visible static label with channel info stays on screen
- Invisible Menu overlay with .opacity(0) handles interactions
- Prevents text/avatar disappearing and resizing animations
This commit is contained in:
Arkadiusz Fal
2025-11-23 14:34:29 +01:00
parent c5137a8af8
commit e43eddc8e7

View File

@@ -259,26 +259,7 @@ struct ChannelVideosView: View {
#if !os(tvOS)
var channelMenu: some View {
Menu {
if let channel = presentedChannel {
contentTypePicker
Section {
subscriptionToggleButton
FavoriteButton(item: FavoriteItem(section: .channel(accounts.app.appType.rawValue, channel.id, channel.name)))
}
if subscriptions.isSubscribing(channel.id) {
toggleWatchedButton
}
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
Section {
HideWatchedButtons()
HideShortsButtons()
}
}
} label: {
ZStack {
HStack(spacing: 12) {
thumbnail
@@ -311,6 +292,61 @@ struct ChannelVideosView: View {
.imageScale(.small)
}
.frame(maxWidth: 320)
Menu {
if let channel = presentedChannel {
contentTypePicker
Section {
subscriptionToggleButton
FavoriteButton(item: FavoriteItem(section: .channel(accounts.app.appType.rawValue, channel.id, channel.name)))
}
if subscriptions.isSubscribing(channel.id) {
toggleWatchedButton
}
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
Section {
HideWatchedButtons()
HideShortsButtons()
}
}
} label: {
HStack(spacing: 12) {
thumbnail
VStack(alignment: .leading) {
Text(presentedChannel?.name ?? "Channel")
.font(.headline)
.foregroundColor(.primary)
.layoutPriority(1)
.frame(minWidth: 160, alignment: .leading)
Group {
HStack(spacing: 12) {
subscriptionsLabel
if presentedChannel?.verified ?? false {
Image(systemName: "checkmark.seal.fill")
.imageScale(.small)
}
viewsLabel
}
.frame(minWidth: 160, alignment: .leading)
}
.font(.caption2.bold())
.foregroundColor(.secondary)
}
Image(systemName: "chevron.down.circle.fill")
.foregroundColor(.accentColor)
.imageScale(.small)
}
.frame(maxWidth: 320)
.opacity(0)
}
}
}
#endif