From fbd4c0c4fee807865729cc1b6519e171d6ce758d Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:58:52 +0000 Subject: [PATCH] ui: separate info labels from their values --- .../kotlin/com/subtracks/ui/components/LibraryInfoDialog.kt | 5 ++++- .../com/subtracks/ui/components/LibraryInfoDialogTest.kt | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/subtracks/ui/components/LibraryInfoDialog.kt b/app/src/main/kotlin/com/subtracks/ui/components/LibraryInfoDialog.kt index 42d6524b..511c6720 100644 --- a/app/src/main/kotlin/com/subtracks/ui/components/LibraryInfoDialog.kt +++ b/app/src/main/kotlin/com/subtracks/ui/components/LibraryInfoDialog.kt @@ -5,6 +5,7 @@ import android.text.format.DateUtils import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width @@ -101,6 +102,7 @@ internal fun InfoRow( color = MaterialTheme.colorScheme.primary, modifier = Modifier.width(INFO_LABEL_WIDTH), ) + Spacer(Modifier.width(INFO_LABEL_GAP)) Text( text = value, style = MaterialTheme.typography.bodyMedium, @@ -126,4 +128,5 @@ private fun formatDate( DateUtils.FORMAT_SHOW_DATE or DateUtils.FORMAT_SHOW_YEAR, ) -private val INFO_LABEL_WIDTH = 96.dp +private val INFO_LABEL_WIDTH = 100.dp +private val INFO_LABEL_GAP = 12.dp diff --git a/app/src/test/kotlin/com/subtracks/ui/components/LibraryInfoDialogTest.kt b/app/src/test/kotlin/com/subtracks/ui/components/LibraryInfoDialogTest.kt index e23f1371..0577b9e2 100644 --- a/app/src/test/kotlin/com/subtracks/ui/components/LibraryInfoDialogTest.kt +++ b/app/src/test/kotlin/com/subtracks/ui/components/LibraryInfoDialogTest.kt @@ -9,6 +9,7 @@ import com.subtracks.data.model.Album import com.subtracks.data.model.Artist import com.subtracks.data.model.ArtistRef import com.subtracks.ui.theme.SubtracksTheme +import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -52,6 +53,10 @@ class LibraryInfoDialogTest { composeRule.onNodeWithText("Album, The").assertIsDisplayed() composeRule.onNodeWithText("A, The").assertIsDisplayed() composeRule.onNodeWithText("1999").assertIsDisplayed() + + val label = composeRule.onNodeWithText("Album artist sort").fetchSemanticsNode().boundsInRoot + val value = composeRule.onNodeWithText("A, The").fetchSemanticsNode().boundsInRoot + assertTrue("the value must be separated from its label", value.left > label.right) } @Test