Archive v1.1 Calendar & Polish milestone artifacts (roadmap, requirements, phase directories) to milestones/. Evolve PROJECT.md with validated requirements and new key decisions. Update RETROSPECTIVE.md with v1.1 section and cross-milestone trends. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.4 KiB
3.4 KiB
Phase 6: Task History - Context
Gathered: 2026-03-16 Status: Ready for planning
## Phase BoundaryLet users view past completion dates for any individual task. The data layer already records completions (TaskCompletions table + completeTask writes timestamps). This phase adds a DAO query and a UI to surface that data. Requirements: HIST-01 (verify recording works), HIST-02 (view history).
## Implementation DecisionsEntry point
- From the task edit form (TaskFormScreen) in edit mode: add a "Verlauf" (History) button/row that opens the history view
- From CalendarTaskRow: add onTap to navigate to the task edit form (currently only has checkbox) — history is then one tap away
- No long-press or context menu — keep interaction model simple and consistent
History view format
- Bottom sheet (showModalBottomSheet) — consistent with existing template_picker_sheet and icon_picker_sheet patterns
- Each entry shows: date formatted as "dd.MM.yyyy" and time as "HH:mm" — German locale
- Entries listed reverse-chronological (newest first)
- No grouping or pagination — household tasks won't have thousands of completions; simple ListView is sufficient
Empty state
- When task has never been completed: centered icon (e.g., Icons.history) + "Noch nie erledigt" message — meaningful, not just blank
- No special state for many completions — just scroll
Claude's Discretion
- Exact bottom sheet height and styling
- Whether to show a completion count summary at the top of the sheet
- Animation and transition details
- DAO query structure (single method returning List)
- Whether CalendarTaskRow onTap goes to edit form or directly to history
No specific requirements — user chose "You decide." Open to standard approaches that match existing app patterns.
<code_context>
Existing Code Insights
Reusable Assets
TaskCompletionstable: Already exists in database.dart (id, taskId, completedAt) — no schema change neededTasksDao.completeTask(): Already inserts into taskCompletions on every completion — HIST-01 data recording is doneshowModalBottomSheet: Used by template_picker_sheet.dart and icon_picker_sheet.dart — established pattern for overlaysAppLocalizations+.arbfiles: German-only localization pipeline in place
Established Patterns
- DAOs extend
DatabaseAccessor<AppDatabase>with@DriftAccessorannotation - Riverpod
StreamProvider.autoDisposeorFutureProviderfor reactive data - Feature folder structure:
features/tasks/data/,domain/,presentation/ - Bottom sheets use
showModalBottomSheetwithDraggableScrollableSheetor simpleColumn
Integration Points
TaskFormScreen(edit mode): Entry point for history — add a row/button whenisEditingTasksDao: AddwatchCompletionsForTask(int taskId)orgetCompletionsForTask(int taskId)methodCalendarTaskRow: Currently no onTap — needs navigation to task edit form for history accessrouter.dart: Route/rooms/:roomId/tasks/:taskIdalready exists for TaskFormScreen — no new route needed if using bottom sheetapp_de.arb: Add localization strings for history UI labels
</code_context>
## Deferred IdeasNone — discussion stayed within phase scope
Phase: 06-task-history Context gathered: 2026-03-16