A native player bar, and the Glass look it sits in (#2)

The first native surface, and the one that settles how the rest will look.

Glass.swift is not a port of the stylesheet. ipx's Glass is already an
approximation of what UIKit gives away -- panels are a 70% colour under
blur(24px) saturate(180%) with an inset top highlight, which is a material,
and the palette names Apple's own colours in its own comments. So where the
CSS had to write #409cff in dark and #0055aa in light, because no single
blue clears AA over the wash, this asks for the system blue and gets both.
Only the wash keeps its hex values: there the colour is the design and
there is no system equivalent to ask for.

PlayerBarView draws what Playback knows, and Playback is the same object
the lock screen and the remote commands drive, so all of them agree without
anything being kept in step by hand. Back 15 and forward 30 match the page
and the lock screen, so every way of skipping moves by the same amount.
Seeking waits for the finger to lift rather than sending a stream of seeks
at a player still answering the last one.

The page's own bar is hidden rather than left to sit under ours. Its play
buttons still work -- they post to the host either way -- but two bars for
one player would be two sets of buttons disagreeing about what is playing,
and only one of them is what CarPlay will be driving.

One test had to be rewritten rather than the code: it asserted that one of
the fixture's two episodes had a file, which stops being true the moment
the event test asks the daemon to scan. The daemon is shared and keeps what
earlier tests did to it, so the assertion now asks what the downloaded
filter means instead of how many things match it today. Thirteen pass,
twice over the same accumulated state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 09:19:13 -04:00
parent f88ae657f3
commit cacf992b7d
6 changed files with 325 additions and 3 deletions

View File

@@ -69,9 +69,15 @@ final class APITests: XCTestCase {
XCTAssertFalse(enclosure.isPlayable, "a downloaded JPEG is not something to play")
}
/// Note that the daemon is shared and keeps what earlier tests did to it: the event test
/// asks it to scan, which downloads another episode. So this asks what the filter means
/// rather than how many things happen to match it today.
func testFilterAndSortAreTheServersWork() async throws {
let all = try await api.entries(feed: "test-show", filter: .all)
let downloaded = try await api.entries(feed: "test-show", filter: .downloaded)
XCTAssertEqual(downloaded.total, 1, "one of the two episodes has a file")
XCTAssertLessThanOrEqual(downloaded.total, all.total)
XCTAssertTrue(downloaded.entries.allSatisfy { $0.enclosures.contains(where: \.isDownloaded) },
"the downloaded filter returned an item with no file")
let asc = try await api.entries(feed: "test-show", sort: .title, direction: .asc)
let desc = try await api.entries(feed: "test-show", sort: .title, direction: .desc)