From 34dfd691d358f6410b542016a32cb1449ec90559 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 8 Jul 2026 18:18:17 +0000 Subject: [PATCH] refactor(nip29): render group-card description only when present Drop the reserved two-line description block: description-less groups now stay compact instead of showing two blank lines. The about still fills in when the metadata loads (a small one-time grow), which is the better trade for the common case where a group has no description. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01B5MLY4hq5LXJ2D5WeLRyXj --- .../amethyst/ui/components/RelayGroupCard.kt | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RelayGroupCard.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RelayGroupCard.kt index 4828b077f3..b0c6a6db30 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RelayGroupCard.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RelayGroupCard.kt @@ -111,9 +111,9 @@ private fun RelayGroupCardContent( relayLabel } - // Description is reserved at a fixed two lines so it fills in when the metadata - // arrives without changing the card's height (empty for groups with no about). - val description = channel.summary()?.takeIf { it.isNotBlank() } ?: "" + // Shown only when the group actually has an about, so description-less groups stay + // compact. It appears (a small one-time grow) once the relay-signed metadata loads. + val description = channel.summary()?.takeIf { it.isNotBlank() } OutlinedCard( onClick = { @@ -177,15 +177,16 @@ private fun RelayGroupCardContent( ) } - Text( - text = description, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - minLines = 2, - maxLines = 2, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.fillMaxWidth().padding(top = 8.dp), - ) + if (description != null) { + Text( + text = description, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 2, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.fillMaxWidth().padding(top = 8.dp), + ) + } } } }