vc=64: UX polish — chip wrap + RelatedRow metadata
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.
This commit is contained in:
parent
7bd2740055
commit
944fbd4335
3 changed files with 38 additions and 16 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue