Make the player pill an on/off setting on iPad, drop the dead wide-layout pill overlay

On iPad both orientations show the video next to a panel, the corner
layout hosts the portrait panel in landscape, and Split View windows make
"portrait" mean "narrow", so the portrait/landscape visibility split never
matched what the user saw. PillVisibility now treats any mode except Never
as visible on iPad, and the pill editor shows a Show pill toggle there
(writes Both/Never, reads synced orientation modes as on). iPhone keeps
the four-way picker.

ExpandedPlayerSheet's bottomPillsOverlay was unreferenced; the floating
panel renders its own pill row.
This commit is contained in:
Arkadiusz Fal
2026-09-27 16:36:42 +02:00
parent 61786ec6f7
commit 7f74b50e94
4 changed files with 54 additions and 209 deletions

View File

@@ -31,10 +31,26 @@ enum PillVisibility: String, Codable, Hashable, Sendable, CaseIterable {
}
}
/// iPad treats the pill as on/off: both orientations show the video next
/// to a panel, the corner layout hosts the portrait panel in landscape,
/// and Split View windows make "portrait" mean "narrow" — so an
/// orientation split never matches what the user sees.
static var isOrientationAgnostic: Bool {
#if os(iOS)
return UIDevice.current.userInterfaceIdiom == .pad
#else
return false
#endif
}
/// Whether the pill is enabled at all (any mode except `.never`).
var isEnabled: Bool { self != .never }
/// Returns whether the pill should be visible for the given layout context.
/// - Parameter isWideLayout: True if in wide/landscape layout, false for portrait.
/// - Returns: Whether the pill should be shown.
func isVisible(isWideLayout: Bool) -> Bool {
if Self.isOrientationAgnostic { return isEnabled }
switch self {
case .portraitOnly:
return !isWideLayout