Repository navigation
fix(play): keep a song heard on a radio app, and name it by the first listen - #1311
Merged
Merged
Conversation
…song heard in it stays
Contributor
|
Mutation testing: 53 of 55 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 |
6 tasks done
astrovm
added a commit
that referenced
this pull request
Nov 28, 2026
… a menu (#1309) 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 1. **The app is part of the main button.** The app's icon sits at the end of **Play** (or **Open**, **Search**), behind a thin line. A tap there opens the same list of apps the chip opened. The chip above the button is gone. 2. **The other ways in are tools with a word.** **Search** and **Open** were icon-only buttons beside **Play**, which moved under it at big fonts. They are now flat tools in the row under the button, after **Lyrics**, each with its word. 3. **A song's rarer tools are behind ⋮.** **Copy link**, **Share link** and **Download** are rows of a menu, each said whole with its icon. A playlist or album keeps all its tools in the row, as it has fewer ways in. 4. **Download stays in sight once it's used.** While a song is being saved, is kept, or there is no room left, **Download** is in the row and shows its state, as before. After the song is let go, it stays in the row until another song's card, so the button does not jump away under the finger or the remote. 5. **A main button that can't be pressed is grey**, with both of its ends. 6. **Screen readers** hear the app's name and then "Choose app" on the button's end, as before. The main button, its app end and ⋮ are announced as buttons. ## Tests 1. `CardButtonsLayoutTest` is 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. 2. `CardToolsFitTest` checks, 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. 3. `KeepOfflineButtonTest` checks 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. 4. `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 ⋮. 5. `MainActivityTest` and `ListeningTest` helpers open ⋮ when a tool is behind it. The swipe tests tell the player by its cover, as the card has a ⋮ too. ## Done when - [x] `:app:ci` passes locally (all tests, 100% line coverage, lint, detekt): green on the tree of 67ac7cf - [x] CI and mutation testing pass on 67ac7cf - [x] Checked on the Samsung, build of 67ac7cf: song, ⋮ menu, kept, let go, another song, playlist, a link not found, German at 2x font with the menu, light, dark, pure black. 0 crashes - [x] Checked on the TV emulator: focus starts on **Play**, right reaches the app and back returns to it, down reaches ⋮, the menu opens on **Copy link**, focus returns to ⋮ after a pick - [x] Store screenshots and site clips redrawn (754b66d) - [x] Agent review: three reviews, the third found no defect ## Review Fixed from the reviews: 1. A kept song's **Download** state was hidden behind ⋮. It is in the row now while it is saving, kept or out of room. 2. Un-keeping a song on a TV moved the button under the remote. It stays in the row until another song. 3. The main button, its app end and ⋮ had no button role. 4. A main button that can't be pressed looked enabled. 5. Tests: sizes, roles, the menu rows and the kept row were not held. Not changed, and why: 1. *The press animation covers the whole button, also for a press on its app end.* It is one button with two ends, and it reads as one. 2. *Two things are named "More": ⋮ and the last row of the app list.* It is the same word the app uses elsewhere for "the rest", and a second word costs more than it gives. 3. *The ⋮ menu's open state could outlive its card.* The menu closes when the result changes; `KeepOfflineButtonTest` shows another song's card with its row as new. 4. *The floating **Play** does not look disabled.* It was so before this PR: Issue #1310. 5. *When a song's details change right after it is let go, **Download** can go back behind ⋮ early.* Rare, and it costs one tap. 6. *`CardToolsFitTest` measures 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 1. Issue #1310: the floating **Play** button does not look disabled while it can't be pressed. Not from this PR. 2. Found during the phone check, not from this PR: a song heard on a radio app (VRadio) dropped back to the station name every 15 to 30 seconds. The fix is in PR #1311.
… and say the new card in the changelog
…each time it's followed
astrovm
marked this pull request as ready for review
November 28, 2026 22:23
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 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
PlaybackCovers.forgetdropped the logo saved for that session. The next read had no cover until the same picture was saved again.MainViewModeltook each as another station, dropped the song heard and listened again.Fix:
PlaybackCoverskeeps 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
followsaid how it plays.checkHeardsaw "nothing" become "something" and dropped the hearing. Naming took two listens, about 10 s in place of 5 s.Fix:
nameByEarwaits 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
PlaybackCovers.ofis split intoknownandsaveLater(detekt's complexity limit).Tests
PlaybackTest.aStationSaidAgainKeepsItsCoverSoItStaysTheSameStation: fails without fix 1.PlaybackTest.aCoverKeptWhileItsSavedAgainIsOnlyForItsOwnSessionAndName: the kept cover is never given to another name or session.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 incollectLatest("expected 4 but was 5").comingBackToCrosstuneDropsTheSongHeardThenListensAgainAtOnceOnceTheBarIsInSight: with the follow held, the listen comes afterFOLLOW_SAID_MS.Done when
:app:cipasses locally (7d472e7: BUILD SUCCESSFUL, 16m 38s; the merge ofmainafter it touched none of this PR's files)Mutants
Two survived, and neither is a test gap:
MainViewModel.kt:1138, the reset offollowSaidinwatchPlayingNow, 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.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.
followSaidwas not cleared when a station was followed anew, so a stale value skipped the wait.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
maindoes the same.