feat(deck): бейдж числа комментариев на карточке (P1 diff — CardBadges веба)
parseCard читает commentsCount (модель Card отдаёт), DeckCardRow показывает «💬 N».
Green compile; detekt модуля 103=103 к HEAD (без новых замечаний).
This commit is contained in:
@@ -100,6 +100,7 @@ class DeckRepository {
|
|||||||
labels = parseLabels(card.optJSONArray("labels")),
|
labels = parseLabels(card.optJSONArray("labels")),
|
||||||
assignees = parseAssignees(card.optJSONArray("assignedUsers")),
|
assignees = parseAssignees(card.optJSONArray("assignedUsers")),
|
||||||
assigneeUids = parseAssigneeUids(card.optJSONArray("assignedUsers")),
|
assigneeUids = parseAssigneeUids(card.optJSONArray("assignedUsers")),
|
||||||
|
commentsCount = card.optInt("commentsCount", 0),
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun parseLabels(array: JSONArray?): List<DeckLabel> {
|
private fun parseLabels(array: JSONArray?): List<DeckLabel> {
|
||||||
@@ -287,6 +288,7 @@ data class DeckCard(
|
|||||||
val labels: List<DeckLabel> = emptyList(),
|
val labels: List<DeckLabel> = emptyList(),
|
||||||
val assignees: List<String> = emptyList(),
|
val assignees: List<String> = emptyList(),
|
||||||
val assigneeUids: List<String> = emptyList(),
|
val assigneeUids: List<String> = emptyList(),
|
||||||
|
val commentsCount: Int = 0,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class DeckBoardDetail(
|
data class DeckBoardDetail(
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ private fun DeckCardRow(card: DeckCard, onClick: () -> Unit, onToggleDone: () ->
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
val due = card.duedate?.let { formatDeckDue(it) }
|
val due = card.duedate?.let { formatDeckDue(it) }
|
||||||
if (due != null || card.assignees.isNotEmpty()) {
|
if (due != null || card.assignees.isNotEmpty() || card.commentsCount > 0) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
@@ -301,6 +301,10 @@ private fun DeckCardRow(card: DeckCard, onClick: () -> Unit, onToggleDone: () ->
|
|||||||
if (due != null) {
|
if (due != null) {
|
||||||
Text("🗓 $due", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary)
|
Text("🗓 $due", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary)
|
||||||
}
|
}
|
||||||
|
if (card.commentsCount > 0) {
|
||||||
|
val comments = "💬 ${card.commentsCount}"
|
||||||
|
Text(comments, style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary)
|
||||||
|
}
|
||||||
if (card.assignees.isNotEmpty()) {
|
if (card.assignees.isNotEmpty()) {
|
||||||
Text("👤 ${card.assignees.joinToString(", ")}", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
Text("👤 ${card.assignees.joinToString(", ")}", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user