make the now playing artist target the whole title block

The artist line is a single bodyMedium line, 20dp, well under the 48dp minimum touch
target. A 48dp artist-only target cannot fit next to the 32dp title inside the 58dp
block without borrowing from the title's bottom edge or from the slider's top padding,
so the block itself becomes the target: 58dp and full width, with no layout change and
nothing to overlap (the slider keeps its own 20dp of top padding before the track).

The trade-off is that tapping the song title now opens the artist too. The test asserts
the measured target is at least 48dp, which fails on a 20dp node.
This commit is contained in:
austinried
2026-10-04 00:30:00 +00:00
parent 7b1696da5e
commit a296443109
2 changed files with 18 additions and 12 deletions
@@ -293,8 +293,13 @@ fun NowPlayingScreen(
verticalArrangement = Arrangement.spacedBy(6.dp),
modifier =
Modifier
.fillMaxWidth()
.padding(top = 12.dp)
.height(titleHeight + 6.dp + subtitleHeight),
.height(titleHeight + 6.dp + subtitleHeight)
.clickable(
enabled = onArtistClick != null,
onClickLabel = "Open artist",
) { onArtistClick?.invoke() },
) {
Box(Modifier.height(titleHeight), contentAlignment = Alignment.Center) {
Text(
@@ -304,17 +309,7 @@ fun NowPlayingScreen(
modifier = Modifier.basicMarquee(),
)
}
Box(
modifier =
Modifier
.fillMaxWidth()
.height(subtitleHeight)
.clickable(
enabled = onArtistClick != null,
onClickLabel = "Open artist",
) { onArtistClick?.invoke() },
contentAlignment = Alignment.Center,
) {
Box(Modifier.height(subtitleHeight), contentAlignment = Alignment.Center) {
Text(
text = state.item?.artist.orEmpty(),
style = subtitleStyle,