From 2c1dfe9a3561ca43f4d268c4196de36f14c60975 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 18 Oct 2026 00:13:17 +0100 Subject: [PATCH] android: restore the shared LabelChip the search-icon replay deleted Replaying b808158 removed ui/components/LabelChip.kt: that commit predates e2147b0, which extracted one shared LabelChip for the chat panes, so the older diff carried the file's deletion. Restored from the commit before the replay; the build and the full unit suite pass again. A cherry-pick's deletions need the same scrutiny as its conflicts. --- .../awan/pipelines/ui/components/LabelChip.kt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt diff --git a/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt b/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt new file mode 100644 index 00000000..1652e6d2 --- /dev/null +++ b/android/app/src/main/java/net/awan/pipelines/ui/components/LabelChip.kt @@ -0,0 +1,31 @@ +package net.awan.pipelines.ui.components + +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.Dp + +/** + * A small rounded tonal chip whose label carries its meaning, so it never relies + * on colour alone. One shape, colour and type across the app; a caller passes + * only the padding its context needs (the search row's type badge is tighter than + * the stage-type chip), so a second copy of the chip never appears. + */ +@Composable +internal fun LabelChip(label: String, horizontalPadding: Dp, verticalPadding: Dp) { + Surface( + shape = RoundedCornerShape(50), + color = MaterialTheme.colorScheme.secondaryContainer, + ) { + Text( + text = label, + style = MaterialTheme.typography.labelMedium, + color = MaterialTheme.colorScheme.onSecondaryContainer, + modifier = Modifier.padding(horizontal = horizontalPadding, vertical = verticalPadding), + ) + } +}