feat(sports): A source for every game, a game page with every channel, and Search when none #15

Merged
namillis merged 2 commits from feat/sports-sources into main 2026-11-11 15:51:26 +00:00
Owner

Phase 2 of the iPhone Sports handoff: a source for every game, the game page (layout C in design/phase10-sports-sources-mockups.html), and Search when nothing carries a game. Based on main after #14.

What changed

  • Channel matching (LiveWire/Sports/ChannelMatcher.swift). LiveWireTV's ChannelMatcher.kt is ported as is: the guide confirms the game (250), a channel named after both teams (200), the exact network (100), the network plus extra words (60 − 3 per word, +5 when the network comes first, +15 for a channel number, −40 for a spin-off word like News or Deportes), and squashed names (10). A network match whose guide shows something else during the game loses 50, and a shared guide id confirms only the network's own channel. Results are deduped by stream, then by name.
  • Matching runs off the main thread (SportsStore.match). The index is built once per channel list and guide and reused for every game. Score updates only re-match. On tv3: building the index over 24,000 channels takes 0.22–0.26 s, and matching 30–41 games takes 0.8–1.3 s.
  • Source pill on each row. A filled "Live Now" for the pool's channel, an outlined channel name for the best match, or a faint "Finding…" or "No stream found". Finished games have none (SportsList.source, ported from SportsList.kt).
  • Taps. Live Now or a channel plays it and switches to Watch. "No stream found" opens Search with the away team's nickname. "Finding…" opens the game page, which says it's still matching. Search's launch query moved from the search.launch default to AppModel.pendingSearch, taken once.
  • Game page (LiveWire/Sports/GameDetailSheet.swift). It opens from the ⋯ button after the pill, or from the long-press menu (Watch on …, Other channels, Search for "…"). The page shows a big scoreboard that updates with the 30 s refresh, league and networks, a Watch button for the best source with its reason, and the other channels best first with why each matched. For the pool's channel it also lists Pool sources (pool_sources): Auto, then each provider to pin, as Watch's Sources sheet does. With no channel it shows "No channel found for " and "Search my channels for """.
  • Tests.
    • The TV app's 22 SportsMatchTest cases are ported to ChannelMatcherTests, along with its source, options, reason and search-query tests. There are 61 unit tests in all.
    • New LiveWireUITests cover three paths: ⋯ opens the page and Watch plays, a row tap plays without opening the page, and a long-press offers Search and fills in the team. They're skipped unless the login is passed as TEST_RUNNER_LW_* environment variables, so no login is in the source.
  • README.md: Sports, the UI tests, and the -sportsDetail / -sportsNoChannels launch arguments.

Intent: every game ESPN lists gets a way to watch, or a way to look for one. Not a goal: followed teams, pool event descriptions, Watch from start, or the score bar (Phase 3).

Testing

iPhone 18 Pro Simulator, Debug build, tv3, Tuesday 10 November, 8:10–10:30 PM ET:

  • At 10:25 PM all 30 unfinished games had a source (the SPORTS unmatched: log line was empty). Most were Live Now. Illinois @ Texas Tech matched "PEACOCK 05 : ILLINOIS…" earlier in the evening.
  • Clippers @ Suns' page listed Live Now first, then 4 channels named after the game and Arizona's Family (KTVK/KPHO), matched as "Arizona's Family 3TV". The pool returned 15 sources.
  • The empty state was checked with -sportsNoChannels, because no real game lacked a channel tonight.
  • xcodebuild test with the tv3 login: 61 unit tests and 3 UI tests pass.

For the backend agent: pool_sources looks wrong for Live Sports channels

For stream 1061248727 ("LA Clippers @ Phoenix Suns"), pool_sources returned 15 sources. Only 2 were the game (NovaTV and GNDK "NBA GAME 03 : PHOENIX SUNS @ LA CLIPPERS"). The rest were unrelated channels: Horror by ALTER, Laff More, Ebony TV, Design Network and Arirang TV. Pinning one of those would play the wrong channel. The page shows what the pool sends, so this needs a server fix, not an app one.

Screenshots

Pills and ⋯ Game page No channel
Pills Game page No channel
Phase 2 of the iPhone Sports handoff: a source for every game, the game page (layout C in `design/phase10-sports-sources-mockups.html`), and Search when nothing carries a game. Based on `main` after #14. ## What changed - **Channel matching** (`LiveWire/Sports/ChannelMatcher.swift`). LiveWireTV's `ChannelMatcher.kt` is ported as is: the guide confirms the game (250), a channel named after both teams (200), the exact network (100), the network plus extra words (60 − 3 per word, +5 when the network comes first, +15 for a channel number, −40 for a spin-off word like News or Deportes), and squashed names (10). A network match whose guide shows something else during the game loses 50, and a shared guide id confirms only the network's own channel. Results are deduped by stream, then by name. - **Matching runs off the main thread** (`SportsStore.match`). The index is built once per channel list and guide and reused for every game. Score updates only re-match. On tv3: building the index over 24,000 channels takes 0.22–0.26 s, and matching 30–41 games takes 0.8–1.3 s. - **Source pill on each row.** A filled "Live Now" for the pool's channel, an outlined channel name for the best match, or a faint "Finding…" or "No stream found". Finished games have none (`SportsList.source`, ported from `SportsList.kt`). - **Taps.** Live Now or a channel plays it and switches to Watch. "No stream found" opens Search with the away team's nickname. "Finding…" opens the game page, which says it's still matching. Search's launch query moved from the `search.launch` default to `AppModel.pendingSearch`, taken once. - **Game page** (`LiveWire/Sports/GameDetailSheet.swift`). It opens from the ⋯ button after the pill, or from the long-press menu (Watch on …, Other channels, Search for "…"). The page shows a big scoreboard that updates with the 30 s refresh, league and networks, a Watch button for the best source with its reason, and the other channels best first with why each matched. For the pool's channel it also lists Pool sources (`pool_sources`): Auto, then each provider to pin, as Watch's Sources sheet does. With no channel it shows "No channel found for <network>" and "Search my channels for "<team>"". - **Tests.** - The TV app's 22 `SportsMatchTest` cases are ported to `ChannelMatcherTests`, along with its source, options, reason and search-query tests. There are 61 unit tests in all. - New `LiveWireUITests` cover three paths: ⋯ opens the page and Watch plays, a row tap plays without opening the page, and a long-press offers Search and fills in the team. They're skipped unless the login is passed as `TEST_RUNNER_LW_*` environment variables, so no login is in the source. - `README.md`: Sports, the UI tests, and the `-sportsDetail` / `-sportsNoChannels` launch arguments. Intent: every game ESPN lists gets a way to watch, or a way to look for one. Not a goal: followed teams, pool event descriptions, Watch from start, or the score bar (Phase 3). ## Testing iPhone 18 Pro Simulator, Debug build, tv3, Tuesday 10 November, 8:10–10:30 PM ET: - At 10:25 PM all 30 unfinished games had a source (the `SPORTS unmatched:` log line was empty). Most were Live Now. Illinois @ Texas Tech matched "PEACOCK 05 : ILLINOIS…" earlier in the evening. - Clippers @ Suns' page listed Live Now first, then 4 channels named after the game and Arizona's Family (KTVK/KPHO), matched as "Arizona's Family 3TV". The pool returned 15 sources. - The empty state was checked with `-sportsNoChannels`, because no real game lacked a channel tonight. - `xcodebuild test` with the tv3 login: 61 unit tests and 3 UI tests pass. ## For the backend agent: pool_sources looks wrong for Live Sports channels For stream 1061248727 ("LA Clippers @ Phoenix Suns"), `pool_sources` returned 15 sources. Only 2 were the game (NovaTV and GNDK "NBA GAME 03 : PHOENIX SUNS @ LA CLIPPERS"). The rest were unrelated channels: Horror by ALTER, Laff More, Ebony TV, Design Network and Arirang TV. Pinning one of those would play the wrong channel. The page shows what the pool sends, so this needs a server fix, not an app one. ## Screenshots | Pills and ⋯ | Game page | No channel | |---|---|---| | ![Pills](https://git.namillis.me/namillis/LiveWireiOS/raw/branch/feat/sports-sources/design/pr-shots/sports-sources/1-pills.jpg) | ![Game page](https://git.namillis.me/namillis/LiveWireiOS/raw/branch/feat/sports-sources/design/pr-shots/sports-sources/2-game-page.jpg) | ![No channel](https://git.namillis.me/namillis/LiveWireiOS/raw/branch/feat/sports-sources/design/pr-shots/sports-sources/3-no-channel.jpg) |
Ports LiveWireTV's ChannelMatcher and its tests. The Other channels sheet waits on a mockup pick (design/phase10-sports-sources-mockups.html).
Layout C in design/phase10-sports-sources-mockups.html. Opens from the row's ⋯ button, a long-press, or a tap while still matching. Adds LiveWireUITests, skipped unless a login is passed in the environment.
namillis deleted branch feat/sports-sources 2026-11-11 15:51:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
namillis/LiveWireiOS!15
No description provided.