Skip to content

Added TaskItem composable with tests.#187

Open
opencode-agent[bot] wants to merge 1 commit into
mainfrom
opencode/issue128-20260715173240
Open

Added TaskItem composable with tests.#187
opencode-agent[bot] wants to merge 1 commit into
mainfrom
opencode/issue128-20260715173240

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Done! Here's a summary of what was implemented:

TaskItem Composable

  • Created at foliary/src/commonMain/kotlin/dev/appoutlet/foliary/core/ui/component/task/TaskItem.kt
  • Wrapped in the existing FoliaryCard for consistent rounded-corner styling with border and shadow
  • Checkbox on the start side using Checkbox(checked = isCompleted, onCheckedChange = null) — display-only, no interaction logic
  • Title with single-line ellipsis; when isCompleted = true, the title gets TextDecoration.LineThrough and reduced opacity (0.38f)
  • Description (optional) capped at maxLines = 3 with TextOverflow.Ellipsis
  • Overdue pill (red, using errorContainer/onErrorContainer) shown only when isOverdue = true and isCompleted = false
  • Includes @Preview variants for default, overdue, and completed states

String resources

  • Added task_item_overdue to strings.xml

Compose UI tests

  • Created at foliary/src/commonTest/kotlin/dev/appoutlet/foliary/core/ui/component/task/TaskItemTest.kt
  • Tests cover:
    • Title and description rendering
    • Description hidden when null
    • Checkbox presence
    • Overdue pill shown only when overdue and not completed
    • Completed state rendering (checkbox + distinct title styling)

All 7 JVM tests pass successfully.

Closes #128

New%20session%20-%202026-07-15T17%3A32%3A39.928Z
opencode session  |  github run

Co-authored-by: MessiasLima <MessiasLima@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create reusable TaskItem Composable with completed state

0 participants