From c84d3426a7c71d6e9a320ae62841ade65b02f38b Mon Sep 17 00:00:00 2001 From: Kyle Bolen Date: Tue, 28 Jul 2026 06:39:19 +0000 Subject: [PATCH] Dense date labels: rule + label above column, row alignment Bottom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date label cells show 'Jul 28 ────' above the thumbnail. Cells without a label have no spacer — they sit tightly against the row above. Row uses Alignment.Bottom so all thumbnails in a row align at the bottom edge even when some cells have a label header pushing them down. --- .../bolenpad/photophetch/ui/DensePhotoGrid.kt | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt index c6b07b9..123c4e6 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt @@ -119,6 +119,7 @@ fun DensePhotoGrid( Row( modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp), horizontalArrangement = Arrangement.spacedBy(2.dp), + verticalAlignment = Alignment.Bottom, ) { row.photos.forEach { labeled -> DenseThumb( @@ -171,18 +172,29 @@ private fun DenseThumb( } Column(modifier = modifier) { - // Date label or invisible spacer — keeps all thumbnails in the row aligned if (dateLabel != null) { - Text( - dateLabel, - fontSize = 10.sp, - fontWeight = FontWeight.Medium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - modifier = Modifier.height(16.dp).padding(start = 1.dp), - ) - } else { - Spacer(Modifier.height(16.dp)) + // Date label with trailing rule — sits above this specific column + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + modifier = Modifier.fillMaxWidth().padding(top = 6.dp, bottom = 2.dp), + ) { + Text( + dateLabel, + fontSize = 10.sp, + fontWeight = FontWeight.Medium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + HorizontalDivider( + modifier = Modifier.weight(1f), + thickness = 0.5.dp, + color = MaterialTheme.colorScheme.outlineVariant, + ) + } } + // No spacer for cells without a label — rows collapse tightly. + // Alignment within a row is handled by the Row using Alignment.Bottom + // so thumbnails sit flush even when some cells have a label header. Box( modifier = Modifier