detail: always show the subtasks group so add is reachable
All checks were successful
CI / ci (push) Successful in 8m38s

Render the subtasks group on every task, not just ones that already
have children, so the inline add field is available from the start.
Hide the done/total count until there's at least one subtask.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-23 11:03:12 +02:00
parent 11f9649dd7
commit 3db553da85

View File

@@ -266,18 +266,17 @@ private fun DetailBody(
} }
// Subtasks — a genuine group: a connected grouped run whose first // Subtasks — a genuine group: a connected grouped run whose first
// segment is the expand/collapse toggle. // segment is the expand/collapse toggle. Always shown (even with no
if (detail.subtasks.isNotEmpty()) { // subtasks yet) so the add field is reachable on any task.
add { add {
SubtasksGroup( SubtasksGroup(
subtasks = detail.subtasks, subtasks = detail.subtasks,
expanded = subtasksExpanded, expanded = subtasksExpanded,
onToggle = { subtasksExpanded = !subtasksExpanded }, onToggle = { subtasksExpanded = !subtasksExpanded },
onToggleSubtask = onToggleSubtask, onToggleSubtask = onToggleSubtask,
onAddSubtask = onAddSubtask, onAddSubtask = onAddSubtask,
onOpenSubtask = onOpenSubtask, onOpenSubtask = onOpenSubtask,
) )
}
} }
} }
cards.forEachIndexed { index, card -> cards.forEachIndexed { index, card ->
@@ -326,12 +325,15 @@ private fun SubtasksGroup(
style = MaterialTheme.typography.titleMedium, style = MaterialTheme.typography.titleMedium,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
) )
Text( // No count until there's something to count.
text = "$done / ${subtasks.size}", if (subtasks.isNotEmpty()) {
style = MaterialTheme.typography.labelLarge, Text(
color = MaterialTheme.colorScheme.onSurfaceVariant, text = "$done / ${subtasks.size}",
) style = MaterialTheme.typography.labelLarge,
Spacer(Modifier.width(8.dp)) color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Spacer(Modifier.width(8.dp))
}
Icon( Icon(
imageVector = Icons.Rounded.ExpandMore, imageVector = Icons.Rounded.ExpandMore,
contentDescription = null, contentDescription = null,