Skip to content

feat: Task List V2 ViewModel layer (PR #2)#1200

Open
igorescodro wants to merge 6 commits intotask-list-part-1from
task-list-part-2
Open

feat: Task List V2 ViewModel layer (PR #2)#1200
igorescodro wants to merge 6 commits intotask-list-part-1from
task-list-part-2

Conversation

@igorescodro
Copy link
Owner

Summary

Implements presentation/ViewModel layer for Task List V2 feature:

  • Add TaskListV2(categoryId) navigation destination
  • Create TaskListV2ViewState with sealed state classes (Loading, Error, Loaded)
  • Create TaskListV2ViewModel with task grouping logic (Overdue/Today/Upcoming/Completed/No Date)
  • Create TaskItemMapper to handle entity mapping (follows existing mapper pattern)
  • Register TaskListV2ViewModel in Koin DI
  • Comprehensive test fakes (LoadTasksByCategoryFake, LoadCategoryFake)
  • 13 unit tests covering state transitions, task grouping, and add task functionality

Changes

  • New mapper: TaskItemMapper for TaskWithCategory → TaskItem conversion
  • New view state: TaskListV2ViewState with sealed classes
  • New ViewModel: TaskListV2ViewModel with reactive flow-based architecture
  • Test infrastructure with fakes and comprehensive unit tests
  • Proper Koin DI setup with all dependencies bound

Test Results

./gradlew :features:task:desktopTest
BUILD SUCCESSFUL - All tests pass

✅ Generated with Claude Code

@igorescodro igorescodro changed the base branch from main to task-list-part-1 March 8, 2026 20:04
igorescodro and others added 6 commits March 14, 2026 09:49
Registers the TaskListV2 route in the navigation destinations module,
making it accessible from the navigation graph.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces the ViewModel and view state for the Task List V2 screen, supporting
grouped task sections (overdue, today, upcoming, completed, no date),
task counts, and an inline add-task field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds LoadCategoryFake and LoadTasksByCategoryFake test doubles alongside
comprehensive ViewModel tests covering state emissions, task grouping by
due date, task counts, and add-task behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wires TaskListV2ViewModel into the task Koin module so it can be
injected across the presentation layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves item mapping logic into a dedicated TaskItemMapper class, registers it
in the Koin module, and corrects the DateTimeProvider import in ViewModel tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reworks category loading in the ViewModel to handle the nullable result directly
rather than relying on a fake isNull flag. Updates LoadCategoryFake and
LoadTasksByCategoryFake accordingly, and rewrites the test suite to follow
the given/when/then structure with per-test category setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.

1 participant