Repository navigation
Lay the player out side by side in landscape - #1639
Conversation
In landscape the player squeezed its portrait layout into a short screen: the artwork shrank to under a third of its size, a book without artwork had its title and author cut, and swipe-to-close needed most of the screen. On a short screen (vertical size class compact, every iPhone in landscape) the artwork now sits on the left, as large as fits above the button row, with the chapter row, progress and playback controls on the right. The button row stays across the bottom, its buttons kept together in the middle. An AnyLayout switches between the two, so rotating moves the views instead of rebuilding them. Swipe-to-close needs half the distance side by side.
| ProgressLabelsSectionView() | ||
| StartupPlayerSectionView() | ||
| VideoPlaybackSectionView() | ||
| // VideoPlaybackSectionView() |
There was a problem hiding this comment.
🟡 WARN — Commenting out VideoPlaybackSectionView() has nothing to do with the landscape layout, and the PR description doesn't mention it. It hides the "Show Video" and "Picture in Picture" toggles. Anyone who already turned them on can't turn them off, and VideoPiPCoordinator.isEnabled still reads videoPictureInPictureEnabled. It looks like leftover debugging. Restore the line, or if hiding video is intended, remove the feature in a separate PR instead of leaving commented-out code.
🔴 Claude PR Review —
|
Problem
In landscape the player kept its portrait layout squeezed into a short screen. On an iPhone 17 Pro the artwork shrank from 330 pt to 92 pt (130 pt on a Pro Max), a book without artwork showed its title and author cut to "Lon…" / "Unk" with the AirPlay button over them, and swipe-to-close needed about two thirds of the screen's height.
Changes
PlayerView: on a short screen (verticalSizeClass == .compact: every iPhone in landscape) the artwork sits on the left and the chapter row, progress and playback controls on the right, starting at the artwork's top. iPad and portrait keep the one-column layout.AnyLayout(HStackLayout/VStackLayout) around the existing artwork and controls, so rotating moves the views instead of rebuilding them.MediaActionRow: an optionalbuttonSpacing. Side by side the five buttons stay together in the middle with 24 pt gaps instead of spreading across the full width. In the right column alone they didn't fit: a running sleep countdown was cut to "5…" at 1×, and gone with 1.25×.ArtworkView: analignmentfor the square when it's narrower than its space (trailing side by side, so it sits next to the controls).NavigationRowView:keepsTitleHeight. Side by side the title no longer gets a fixed 56 pt row (the row is the chevrons' 48 pt), so a one-line title doesn't start further below the artwork's top.PlayerJumpView: the frame is 56 pt tall, the icon's height; at 48 the icon spilled 4 pt past its frame. Portrait doesn't move: the row sits between flexible spaces.Testing
Not covered: iPhone Duo. Its simulator never rotated the closed (outer) display, so the side-by-side layout there is untested; Apple documents the outer display as rotating like any iPhone.
Known and left as is (also on develop): on the iPhone SE, which has no home indicator, the button row sits on the screen's bottom edge.