From 74442f2764ab0953c2ee89db807c7ae5084c45b1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 18 Jul 2026 10:40:31 +0200 Subject: [PATCH] Force soft top scroll edge effect for banner and video info views iOS 27 changes the default scroll edge effect style to hard, which draws a sharp cutoff line over the channel banner and video info gradient extending under the toolbar. --- .../View+SoftScrollEdgeEffect.swift | 24 +++++++++++++++++++ Yattee/Views/Channel/ChannelView.swift | 2 ++ Yattee/Views/Video/VideoInfoView.swift | 1 + 3 files changed, 27 insertions(+) create mode 100644 Yattee/Extensions/View+SoftScrollEdgeEffect.swift diff --git a/Yattee/Extensions/View+SoftScrollEdgeEffect.swift b/Yattee/Extensions/View+SoftScrollEdgeEffect.swift new file mode 100644 index 00000000..7f4328e0 --- /dev/null +++ b/Yattee/Extensions/View+SoftScrollEdgeEffect.swift @@ -0,0 +1,24 @@ +// +// View+SoftScrollEdgeEffect.swift +// Yattee +// +// iOS 27 changed the default scroll edge effect style from soft to hard, +// which draws a sharp dividing line under the toolbar. Views that extend +// a banner or gradient beneath the toolbar (channel header, video info) +// need the soft style so the artwork stays cleanly visible. +// + +import SwiftUI + +extension View { + /// Forces the soft (blur/fade) scroll edge effect on the top edge + /// for scroll views in this hierarchy. No-op before iOS 26/macOS 26. + @ViewBuilder + func softTopScrollEdgeEffect() -> some View { + if #available(iOS 26, macOS 26, tvOS 26, *) { + scrollEdgeEffectStyle(.soft, for: .top) + } else { + self + } + } +} diff --git a/Yattee/Views/Channel/ChannelView.swift b/Yattee/Views/Channel/ChannelView.swift index c49e13c9..2540c5e1 100644 --- a/Yattee/Views/Channel/ChannelView.swift +++ b/Yattee/Views/Channel/ChannelView.swift @@ -368,6 +368,7 @@ struct ChannelView: View { } .background(viewBackgroundColor) .ignoresSafeArea(edges: .top) + .softTopScrollEdgeEffect() #if os(macOS) .overlay(alignment: .top) { legacyToolbarScrim @@ -533,6 +534,7 @@ struct ChannelView: View { } .background(viewBackgroundColor) .ignoresSafeArea(edges: .top) + .softTopScrollEdgeEffect() #if os(macOS) .overlay(alignment: .top) { legacyToolbarScrim diff --git a/Yattee/Views/Video/VideoInfoView.swift b/Yattee/Views/Video/VideoInfoView.swift index f1a63e80..4ffc1e81 100644 --- a/Yattee/Views/Video/VideoInfoView.swift +++ b/Yattee/Views/Video/VideoInfoView.swift @@ -545,6 +545,7 @@ struct VideoInfoView: View { #if !os(tvOS) .scrollDismissesKeyboard(.interactively) #endif + .softTopScrollEdgeEffect() .modifier(VideoInfoScrollOffsetModifier(scrollOffset: $scrollOffset)) #if os(macOS)