fix(packs): show pack name and description in full on library cards
The library cards clipped the two things a card exists to communicate: the name
at maxLines=1 ("Communicati…") and the description at maxLines=2 ("…about
pers…"). Both are now uncapped and cards size to their content, matching the
pack detail page.
Removing the caps alone was not enough. The question-count pill shared the title
row, so it reserved width for the row's full height and squeezed the text into a
narrow column — the name then broke mid-word ("Communicatio/n") and the
description wrapped to a ragged 8 lines. The pill moves down to join the access
pill, which gives the text the card's full width and matches how the detail page
already groups its pills.
Verified live on both fixtures (dark 5554 / light 5556): full names on one line,
full descriptions across the card, pills grouped below. Unit tests green,
0 FATAL.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8aea4730cc
commit
66d38251ea
|
|
@ -247,30 +247,33 @@ private fun QuestionPackCard(
|
|||
modifier = Modifier.weight(1f),
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
// Pack name and description are shown in full — this is what someone picks
|
||||
// a pack by, and clipping it to "Communicati…" / "…about pers…" hid the
|
||||
// very thing the card exists to communicate. Cards size to their content.
|
||||
Text(
|
||||
text = item.category.displayName.ifBlank { item.category.id.displayCategoryName() },
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
Text(
|
||||
text = item.category.description,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
PackPill(item.promptCountLabel(), emphasis = true)
|
||||
}
|
||||
// The count pill sits with the other pills rather than beside the title: in the
|
||||
// title row it reserved width for the row's full height, squeezing the name and
|
||||
// description into a narrow column that broke words mid-word once they were shown
|
||||
// in full. This also matches the pill row on the pack detail page.
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.horizontalScroll(rememberScrollState()),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
PackPill(item.promptCountLabel(), emphasis = true)
|
||||
item.metadataLabels().forEach { label ->
|
||||
PackPill(label, emphasis = label == "Premium")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue