Repository navigation
Top-align the artwork side by side and keep the player's times on one line - #1645
Conversation
…e line
- PlayerView: side by side, the artwork sits at the top of its column, level with the
title row. Where its width limits it (iPhone Duo closed in landscape) it no longer drops
below the title. Each side also keeps at least 40 pt from the edge (the gap between the
artwork and the controls): the closed Duo has its camera on one side only, which left
the content 22 pt from the other edge. The safe-area insets are read in the same layout
pass (GeometryReader), so a rotation never shows uneven margins.
- ListeningProgressView: the times under the slider never wrap. Each side reserves the
width of the longer time (the other is laid out hidden), so the label between them stays
centered and is the one that gives way, truncating from the start ("...pter 3 of 6").
With hours (a chapter or the whole book over an hour) the time wrapped on the closed
Duo.
✅ Claude PR Review —
|
| Finding | Status |
|---|---|
BookPlayer/Player/Views/ListeningProgressView.swift:53 (warn) ⚠︎ moved |
✅ verified fixed in a5a7d9f |
Model claude-opus-5-5 · run log · 1 new · 0 carried over · 1 verified closed · 0 resolved · advisory (a human should still review). Findings are de-duplicated across pushes; an earlier finding closes only when the verification pass judges it against the current code — fixed, no longer applicable, accepted by a maintainer, or a duplicate of a finding reported on this push.
The times under the slider keep the room they need first, so at regular text sizes they stay on one line as before; only when even they don't fit (the largest text sizes) were they cut off by the one-line limit. Without it they wrap wherever the player has the height for it.
| Text(progressLabel) | ||
| .lineLimit(1) | ||
| /// The end ("3 of 6") is the part worth keeping | ||
| .truncationMode(.head) |
There was a problem hiding this comment.
🔵 INFO — .truncationMode(.head) suits player_chapter_description ("Chapter %d of %d"), but this label also shows player_book_remaining_title ("%@ left", from bookRemainingLabel) and the percentage. With head truncation the book-remaining form loses its number when squeezed ("…m left" or "…left"). Translations that put the numbers first have the same problem. Option 1: pick the mode per form, e.g. .head only when prefersChapterContext is on and the chapter form is showing, .tail otherwise. Option 2: add a small .minimumScaleFactor(0.85) before any truncation, so the label shrinks a little before it's cut.
Problem
The player's side-by-side layout (artwork beside the controls, #1639) looked off on iPhone Duo closed in landscape (678 × 466 pt):
Changes
PlayerView(PlayerContentView): side by side, the artwork sits at the top of its column, level with the title row. On iPhone it already filled the column's height, so nothing moves there. Each side also keeps at least 40 pt from the edge (the same as the gap between the artwork and the controls); where the safe area already gives more (iPhone, the camera side), nothing changes. The insets are read with aGeometryReader, in the same layout pass, so a rotation never shows uneven margins.ListeningProgressView: the times never wrap. Each side reserves the width of the longer time (the other one is laid out hidden), so the label between them stays centered, and it's the one that gives way when the row is short, truncating from the start so the numbers stay ("…pter 3 of 6").Testing
testFreshLaunch,testImportandtestPlaybackpass (player.currentTimestill found by its identifier).Not re-checked: the L pose's top half (the same rules apply there; its side margins were about 24 pt, so they become 40 pt).