Repository navigation
feat(card): put the app on the main button and the rarer tools behind a menu - #1309
Merged
Merged
Conversation
… can't be pressed, and say each is a button Also redraws the store screenshots and site clips with the new card.
…o letting it go doesn't move it
Contributor
|
Mutation testing: 71 of 85 changes caught by a test. Each one is a change to the code no test noticed. Not a blocker: real gaps get their own PR. Full report |
astrovm
marked this pull request as ready for review
November 28, 2026 21:03
4 tasks done
astrovm
added a commit
that referenced
this pull request
Nov 28, 2026
… listen (#1311) A song heard on a radio app that names only its station (VRadio) did not stay on the bar, and took two listens to name after Crosstune came back in sight. A user reported the station shown as the song in 2.26.0. The song is named now; this PR makes it stay. ## Causes and fixes Measured on the Samsung with VRadio playing Mía FM. ### 1. The station's cover was dropped each time its app said it again 1. VRadio says its station again every 30 to 60 seconds: the same name and logo, with a longer length. 2. On each one, `PlaybackCovers.forget` dropped the logo saved for that session. The next read had no cover until the same picture was saved again. 3. What plays went from "station with cover" to "station without cover" and back. `MainViewModel` took each as another station, dropped the song heard and listened again. Fix: `PlaybackCovers` keeps the cover a session had, under the same name, until the new one is saved. A new picture still replaces the old one. This also stops a song's bitmap cover from blinking out when its app resends the same song. ### 2. The first listen after the app is watched anew was thrown away 1. When what plays is watched anew (Crosstune back in sight), the listen by ear started before the app's `follow` said how it plays. 2. The song heard then had nothing to be checked by. When the follow arrived, `checkHeard` saw "nothing" become "something" and dropped the hearing. Naming took two listens, about 10 s in place of 5 s. Fix: `nameByEar` waits up to 1 s (`FOLLOW_SAID_MS`) for the follow of the station it is about to hear. The wait is skipped for apps that report no state, for Radio Garden and when no station plays. It is cleared each time a station is followed anew. ## Other changes 1. `PlaybackCovers.of` is split into `known` and `saveLater` (detekt's complexity limit). 2. The 2.29.0 changelog is rewritten to fit Play's 500 characters (457), with the card redesign of PR #1309 and "A song heard on a radio app stays named." ## Tests 1. `PlaybackTest.aStationSaidAgainKeepsItsCoverSoItStaysTheSameStation`: fails without fix 1. 2. `PlaybackTest.aCoverKeptWhileItsSavedAgainIsOnlyForItsOwnSessionAndName`: the kept cover is never given to another name or session. 3. `MainViewModelTest.aStationWatchedAgainIsNamedByItsFirstListen`: fails without fix 2 ("expected 1 but was 2"). Its last step (station, then a song its app names, then the station again) fails without the reset in `collectLatest` ("expected 4 but was 5"). 4. `comingBackToCrosstuneDropsTheSongHeardThenListensAgainAtOnceOnceTheBarIsInSight`: with the follow held, the listen comes after `FOLLOW_SAID_MS`. ## Done when - [x] `:app:ci` passes locally (7d472e7: BUILD SUCCESSFUL, 16m 38s; the merge of `main` after it touched none of this PR's files) - [x] CI and mutation testing pass (da6d0ae: 20 of 20 checks; 53 of 55 mutants caught, the two left are explained under **Mutants**) - [x] Checked on the Samsung with VRadio, perf build of da6d0ae, screen kept on: named 7 s after opening by the first listen; the song stayed 51 s and 44 s through VRadio's resends, changing only when the station went to its next song; after leaving and coming back, named again within 8 s by one listen. The song card of PR #1309 shows as designed in the same build. No crash in the log. - [x] Agent review ## Mutants Two survived, and neither is a test gap: 1. `MainViewModel.kt:1138`, the reset of `followSaid` in `watchPlayingNow`, removed. The reset at the start of each follow covers the same case in the tests. This one stays as a guard for a listen that could start before the follow does. 2. `MainViewModel.kt:1234`, the value of the wait's block set to null. The value is never read, so the change does nothing. ## Review Three Sonnet reviews. 1. Review 1 (cover fix): no defect. Its suggested tests were added (test 2). 2. Review 2 (wait for the follow): two defects, both fixed. The wait came after the joins of the other listeners, so time could pass between it and the listen. `followSaid` was not cleared when a station was followed anew, so a stale value skipped the wait. 3. Review 3 (those fixes): no defect. Rejected findings: a. "No test fails without the reset": measured, the test fails without it (4 expected, 5 listens). b. "1 s per listen if the follow never says anything": the follow always says a first value on registration; if it said nothing, the cost is 1 s on listens 30 s or more apart, and the hearing is kept. c. "A late write from an old follow job": the old watch is cancelled on the main thread before the new one resets the value, so a cancelled collector cannot write after it. ## Known issues 1. A song heard is not kept across a screen off and on: it costs one listen (about 5 s) on return. Kept as it is on purpose, since the station may have moved to another song meanwhile. 2. When a station's session ends, its follow can end a moment before the station does, which starts one listen that is cancelled at once. `main` does the same.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A song's card had four rows of controls: the app chip, the main button with two icons beside it, and a row of up to six tools. This makes it two.
What changes
Tests
CardButtonsLayoutTestis rewritten for the new button: both ends as tall, the line between, the card's width, the roles, the grey fill, mirrored right to left, the tools under it.CardToolsFitTestchecks, in 16 languages at the largest fonts on a narrow phone, a common one and a TV, that the button spans the card, its word is never smaller than at the default font, each tool and ⋮ is in sight and at least 48 dp, each menu row is shown, and a kept song's fuller row fits.KeepOfflineButtonTestchecks the menu row's text per state, that a kept song has Download in the row, and that it stays there after the song is let go, until another song.TvPlayTest: right from Play lands on the app and left goes back, down goes to the tools, and a tool picked behind ⋮ leaves the remote on ⋮.MainActivityTestandListeningTesthelpers open ⋮ when a tool is behind it. The swipe tests tell the player by its cover, as the card has a ⋮ too.Done when
:app:cipasses locally (all tests, 100% line coverage, lint, detekt): green on the tree of 67ac7cfReview
Fixed from the reviews:
Not changed, and why:
KeepOfflineButtonTestshows another song's card with its row as new.CardToolsFitTestmeasures the room a word has, not its drawn size. Robolectric does not report the drawn size of auto-sized text. The phone check at 2x font covers what it cannot.Known issues