From 93cf9f1d6e12a6905d10f5be981e1eb6e69c6c10 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Apr 2026 15:40:30 +0000 Subject: [PATCH] refactor(badges): drop OutlinedCard chrome from feed items Each badge was wrapped in its own rounded OutlinedCard, which reads as an out-of-place boxed widget in the feed since every other feed item is a flat row separated by the standard HorizontalDivider drawn by FeedLoaded. Replace the Card with a plain Column + clickable + padding. The feed's own divider handles item separation and the UI now matches Notes, Articles, Pictures, etc. --- .../amethyst/ui/note/types/Badge.kt | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt index 4d3af6878..f73a0930e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt @@ -39,7 +39,6 @@ import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedButton -import androidx.compose.material3.OutlinedCard import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @@ -79,7 +78,6 @@ import com.vitorpamplona.quartz.nip58Badges.award.BadgeAwardEvent import com.vitorpamplona.quartz.nip58Badges.definition.BadgeDefinitionEvent import com.vitorpamplona.quartz.nip58Badges.profile.ProfileBadgesEvent -private val BadgeCardShape = RoundedCornerShape(12.dp) private val BadgeThumbSize = 72.dp @Composable @@ -177,41 +175,38 @@ private fun BadgeCard( onClick: (() -> Unit)? = null, actions: @Composable () -> Unit = {}, ) { - val baseModifier = Modifier.fillMaxWidth().padding(vertical = 6.dp) - OutlinedCard( - modifier = if (onClick != null) baseModifier.clickable(onClick = onClick) else baseModifier, - shape = BadgeCardShape, - ) { - Column(modifier = Modifier.padding(16.dp)) { - Row(verticalAlignment = Alignment.CenterVertically) { - BadgeThumbnail(imageUrl, name) + val baseModifier = Modifier.fillMaxWidth() + val clickableModifier = if (onClick != null) baseModifier.clickable(onClick = onClick) else baseModifier - Spacer(modifier = Modifier.size(14.dp)) + Column(modifier = clickableModifier.padding(horizontal = 16.dp, vertical = 12.dp)) { + Row(verticalAlignment = Alignment.CenterVertically) { + BadgeThumbnail(imageUrl, name) - Column(modifier = Modifier.weight(1f)) { - Text( - text = name?.ifBlank { null } ?: stringRes(R.string.badge_untitled), - style = MaterialTheme.typography.titleMedium, - fontWeight = FontWeight.SemiBold, - maxLines = 2, - overflow = TextOverflow.Ellipsis, - ) - } - } + Spacer(modifier = Modifier.size(14.dp)) - if (!description.isNullOrBlank()) { - Spacer(modifier = Modifier.height(12.dp)) + Column(modifier = Modifier.weight(1f)) { Text( - text = description, - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - maxLines = 4, + text = name?.ifBlank { null } ?: stringRes(R.string.badge_untitled), + style = MaterialTheme.typography.titleMedium, + fontWeight = FontWeight.SemiBold, + maxLines = 2, overflow = TextOverflow.Ellipsis, ) } - - actions() } + + if (!description.isNullOrBlank()) { + Spacer(modifier = Modifier.height(10.dp)) + Text( + text = description, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 4, + overflow = TextOverflow.Ellipsis, + ) + } + + actions() } }