Fix iOS comments scrolling issue in video details view

Comments at the bottom of the comments view were not accessible on iOS
without entering fullscreen mode. The issue was caused by the VideoDetails
view being offset by the player height when not in fullscreen, but the
ScrollView padding didn't account for this offset.

Changes:
- Add SafeAreaModel observer for iOS platform
- Update bottom padding to dynamically account for player height offset
  and safe area insets based on fullscreen state
- When not in fullscreen: padding = player height + safe area bottom + 20
- When in fullscreen: padding = max(60, safe area bottom + 20)

This ensures all comments and video details content are fully scrollable
and visible regardless of fullscreen state.
This commit is contained in:
Arkadiusz Fal
2025-11-22 19:54:36 +01:00
parent b0dfd2f9d2
commit 73295e726a

View File

@@ -189,6 +189,7 @@ struct VideoDetails: View {
@Environment(\.navigationStyle) private var navigationStyle
#if os(iOS)
@Environment(\.verticalSizeClass) private var verticalSizeClass
@ObservedObject private var safeAreaModel = SafeAreaModel.shared
#endif
@Environment(\.colorScheme) private var colorScheme
@@ -397,7 +398,11 @@ struct VideoDetails: View {
}
}
}
#if os(iOS)
.padding(.bottom, fullScreen ? max(60, safeAreaModel.safeArea.bottom + 20) : player.playerSize.height + safeAreaModel.safeArea.bottom + 20)
#else
.padding(.bottom, 60)
#endif
}
#if os(iOS)
.onAppear {