From c8de39acb967726c3dc0c1b0cd9a7661d86c00ad Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:01:47 +0000 Subject: [PATCH] ui: give the collapsed artist bio room from its actions The three-line collapsed bio let its More control sit under the star and overflow buttons, and the collapsed state had no bottom gap before the Albums header. Move the actions up, reserve their width on all three collapsed lines, and add the same bottom gap the expanded state uses. --- .../ui/library/ArtistDetailScreen.kt | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/subtracks/ui/library/ArtistDetailScreen.kt b/app/src/main/kotlin/com/subtracks/ui/library/ArtistDetailScreen.kt index 4c3e9522..54d6fdba 100644 --- a/app/src/main/kotlin/com/subtracks/ui/library/ArtistDetailScreen.kt +++ b/app/src/main/kotlin/com/subtracks/ui/library/ArtistDetailScreen.kt @@ -147,8 +147,9 @@ private val SHUFFLE_RESERVE = 86.dp private val SHUFFLE_HANG = SHUFFLE_HEIGHT / 2 private val BIO_ACTION_RESERVE = 104.dp private val BIO_ACTION_HEIGHT = 48.dp -private val BIO_ACTION_OFFSET = 8.dp +private val BIO_ACTION_OFFSET = 16.dp private val BIO_TOP_GAP = 8.dp +private val BIO_BOTTOM_GAP = 8.dp internal fun estimateScrollPx( index: Int, @@ -484,7 +485,7 @@ fun ArtistDetailScreen( onCollapse = onCollapseBio, modifier = Modifier.padding( - bottom = if (hasBio && !bioCollapsed) 8.dp else 0.dp, + bottom = if (hasBio) BIO_BOTTOM_GAP else 0.dp, ), ) } @@ -568,8 +569,8 @@ fun ArtistDetailScreen( } } -// The expanded layout narrows only the lines that overlap the action buttons; later lines use the -// full width. +// The collapsed layout narrows all three lines so the More control stays clear of the action +// buttons. Expanded lines only reserve the rows the buttons actually overlap. @Composable private fun ArtistBio( text: String, @@ -600,11 +601,31 @@ private fun ArtistBio( ceil(with(density) { (BIO_ACTION_HEIGHT - BIO_ACTION_OFFSET).toPx() } / lineHeightPx) .toInt() .coerceAtLeast(1) + val collapsedReserveLines = maxOf(reserveLines, 3) val bioLines = - remember(text, fullWidth, reserve, reserveLines, collapsed, expanded, moreText, lessText) { + remember( + text, + fullWidth, + reserve, + reserveLines, + collapsedReserveLines, + collapsed, + expanded, + moreText, + lessText, + ) { when { collapsed -> { - splitBioCollapsed(measurer, text, style, fullWidth, reserve, reserveLines, moreText, maxLines = 3) + splitBioCollapsed( + measurer, + text, + style, + fullWidth, + reserve, + collapsedReserveLines, + moreText, + maxLines = 3, + ) } expanded -> {