fix(desktop): remove ID footer/divider, whole-card hover on NoteCard
- Dropped the "ID: <hex>…" 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
This commit is contained in:
+27
-34
@@ -24,6 +24,7 @@ import androidx.compose.foundation.clickable
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
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.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material3.Card
|
import androidx.compose.material3.Card
|
||||||
import androidx.compose.material3.CardDefaults
|
import androidx.compose.material3.CardDefaults
|
||||||
import androidx.compose.material3.HorizontalDivider
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -156,27 +156,16 @@ fun NoteCard(
|
|||||||
400.dp
|
400.dp
|
||||||
}
|
}
|
||||||
|
|
||||||
Card(
|
// Whole-card hover/ripple: pass onClick to M3 Card so the click-surface is
|
||||||
modifier = modifier.fillMaxWidth(),
|
// the entire card (M3 handles shape clipping for us). Action buttons inside
|
||||||
colors =
|
// the NoteActionsRow have their own clickables that consume the click before
|
||||||
CardDefaults.cardColors(
|
// it reaches the Card's handler, so tapping an action still fires only that
|
||||||
containerColor = MaterialTheme.colorScheme.surface,
|
// action.
|
||||||
),
|
val cardColors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = 1.dp),
|
val cardElevation = CardDefaults.cardElevation(defaultElevation = 1.dp)
|
||||||
) {
|
val cardBody: @Composable ColumnScope.() -> Unit = {
|
||||||
Column(modifier = Modifier.padding(12.dp)) {
|
Column(modifier = Modifier.padding(12.dp)) {
|
||||||
// Header + text area — clickable to navigate to thread. Clip BEFORE
|
Column {
|
||||||
// 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
|
|
||||||
},
|
|
||||||
) {
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
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,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user