From 944fbd4335be6d6dbbd296811e1d31af6b412381 Mon Sep 17 00:00:00 2001 From: Kayos Date: Tue, 26 May 2026 13:06:57 -0700 Subject: [PATCH] =?UTF-8?q?vc=3D64:=20UX=20polish=20=E2=80=94=20chip=20wra?= =?UTF-8?q?p=20+=20RelatedRow=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues Cobb caught on the vc=63 walkthrough: (1) Subscription chip names wrapped to two lines mid-word at 80dp chip width: 'NoCopyrightS / ounds', 'DEFCONConfe / rence', 'Practica / Engineer...'. Switched to maxLines=1 + ellipsis + center-align. 'NoCopyrigh…' reads cleaner than the broken wrap. (2) Related + More-from-channel rows showed an empty metadata line under the title because the buildString started with item.uploader (empty for channelInfo-sourced rows — channel pages omit the uploader name from each card since it's implicit). Switched to a leading-separator pattern that gracefully composes whatever pieces are populated: 'uploader · views · date', 'views · date', 'date', etc., and hides the line entirely when nothing's available. Date was also never rendered before — channelInfo gives it but RelatedRow ignored it. Now visible everywhere. --- buildSrc/src/main/kotlin/ProjectConfig.kt | 4 +- .../main/kotlin/com/sulkta/straw/StrawHome.kt | 9 +++- .../straw/feature/detail/VideoDetailScreen.kt | 41 +++++++++++++------ 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/kotlin/ProjectConfig.kt b/buildSrc/src/main/kotlin/ProjectConfig.kt index 409599050..df9a9cfd5 100644 --- a/buildSrc/src/main/kotlin/ProjectConfig.kt +++ b/buildSrc/src/main/kotlin/ProjectConfig.kt @@ -55,6 +55,6 @@ const val NEWPIPE_APPLICATION_ID_NEW = "net.newpipe.app" // vc=19 / 0.1.0-AE — rust pipeline cutover. Extraction via // strawcore-core (Sulkta-Coop/strawcore) via the UniFFI wrapper; no // NewPipeExtractor in the runtime path. -const val STRAW_VERSION_CODE = 63 -const val STRAW_VERSION_NAME = "0.1.0-BW" +const val STRAW_VERSION_CODE = 64 +const val STRAW_VERSION_NAME = "0.1.0-BX" const val STRAW_APPLICATION_ID = "com.sulkta.straw" diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/StrawHome.kt b/strawApp/src/main/kotlin/com/sulkta/straw/StrawHome.kt index 322b7bd4f..06acdf2cb 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/StrawHome.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/StrawHome.kt @@ -587,11 +587,18 @@ private fun SubChip( ) } Spacer(modifier = Modifier.height(4.dp)) + // Single line + ellipsis instead of maxLines=2. The 80dp chip + // width breaks the prior 2-line wrap mid-word ("NoCopyrightS + // / ounds", "DEFCONConfe / rence") — uglier than a clean + // "NoCopyrigh…". Centered text alignment so the ellipsis + // sits over the chip's icon column. vc=64. Text( text = ch.name, style = MaterialTheme.typography.labelSmall, - maxLines = 2, + maxLines = 1, overflow = TextOverflow.Ellipsis, + textAlign = androidx.compose.ui.text.style.TextAlign.Center, + modifier = Modifier.fillMaxWidth(), ) } } diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt index 4d4e67411..87f9e2b3e 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt @@ -709,19 +709,34 @@ private fun RelatedRow( overflow = TextOverflow.Ellipsis, ) Spacer(modifier = Modifier.height(2.dp)) - Text( - text = buildString { - append(item.uploader) - if (item.viewCount > 0) { - append(" · ") - append(formatViews(item.viewCount)) - } - }, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) + // Build the metadata line from whatever's available. + // channelInfo-sourced items (More from channel) come back + // with uploader="" because the channel page doesn't repeat + // the uploader name on each row — it's implicit. Skip + // empty pieces with the leading-separator dance so we + // never end up with " · viewCount" or trailing dots. + // vc=64 — Cobb caught the empty metadata line on + // More-from-channel rows. + val meta = buildString { + if (item.uploader.isNotBlank()) append(item.uploader) + if (item.viewCount > 0) { + if (isNotEmpty()) append(" · ") + append(formatViews(item.viewCount)) + } + if (item.uploadDateRelative.isNotBlank()) { + if (isNotEmpty()) append(" · ") + append(item.uploadDateRelative) + } + } + if (meta.isNotEmpty()) { + Text( + text = meta, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } } } }