From fc9eb833ac1681ee81bb98d0926834fd8f0ff18e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 16:06:08 +0000 Subject: [PATCH] fix(desktop): remove ID footer/divider, whole-card hover on NoteCard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dropped the "ID: …" debug footer and the HorizontalDivider that sat above it. Cards read as finished content now, not dev output. - The previous design had an inner header+text Column carrying the clickable modifier, which meant the hover ring only covered part of the card (a rectangle inside). Switched to Material3 Card(onClick = onClick, …) so the whole card is the click-surface and the ripple is clipped to the card's rounded shape by M3 itself. - Content moved into a `cardBody` lambda reused by both branches of the `if (onClick != null)` check — non-clickable fallback exists for in-thread quoted note wrappers. - Action buttons inside NoteActionsRow have their own clickables that consume taps before they reach the Card's handler, so tapping reply / repost / zap still fires only that action, not the Card. https://claude.ai/code/session_01NufduPfZvYQVYwLkbCjCUo --- .../amethyst/desktop/ui/note/NoteCard.kt | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/NoteCard.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/NoteCard.kt index 8a966f695..879ae5ca2 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/NoteCard.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/NoteCard.kt @@ -24,6 +24,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth @@ -34,7 +35,6 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults -import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -156,27 +156,16 @@ fun NoteCard( 400.dp } - Card( - modifier = modifier.fillMaxWidth(), - colors = - CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surface, - ), - elevation = CardDefaults.cardElevation(defaultElevation = 1.dp), - ) { + // Whole-card hover/ripple: pass onClick to M3 Card so the click-surface is + // the entire card (M3 handles shape clipping for us). Action buttons inside + // the NoteActionsRow have their own clickables that consume the click before + // it reaches the Card's handler, so tapping an action still fires only that + // action. + val cardColors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface) + val cardElevation = CardDefaults.cardElevation(defaultElevation = 1.dp) + val cardBody: @Composable ColumnScope.() -> Unit = { Column(modifier = Modifier.padding(12.dp)) { - // Header + text area — clickable to navigate to thread. Clip BEFORE - // clickable so the ripple/hover fill is rounded, not a hard rectangle. - Column( - modifier = - if (onClick != null) { - Modifier - .clip(RoundedCornerShape(8.dp)) - .clickable { onClick() } - } else { - Modifier - }, - ) { + Column { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, @@ -312,21 +301,25 @@ fun NoteCard( } } } - - Spacer(Modifier.height(8.dp)) - - HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.3f)) - - Spacer(Modifier.height(4.dp)) - - // Event ID (truncated) - Text( - text = "ID: ${note.id.take(12)}...", - style = MaterialTheme.typography.labelSmall, - color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f), - ) } } + + if (onClick != null) { + Card( + onClick = onClick, + modifier = modifier.fillMaxWidth(), + colors = cardColors, + elevation = cardElevation, + content = cardBody, + ) + } else { + Card( + modifier = modifier.fillMaxWidth(), + colors = cardColors, + elevation = cardElevation, + content = cardBody, + ) + } } /**