diff --git a/.planning/phases/03-daily-plan-and-cleanliness/3-CONTEXT.md b/.planning/phases/03-daily-plan-and-cleanliness/3-CONTEXT.md new file mode 100644 index 0000000..0ea52ac --- /dev/null +++ b/.planning/phases/03-daily-plan-and-cleanliness/3-CONTEXT.md @@ -0,0 +1,97 @@ +# Phase 3: Daily Plan and Cleanliness - Context + +**Gathered:** 2026-03-16 +**Status:** Ready for planning + + +## Phase Boundary + +Users can open the app and immediately see what needs doing today, act on tasks directly from the plan view, and see a room-level health indicator. Delivers: daily plan screen replacing the Home tab placeholder, with overdue/today/upcoming sections, task completion via checkbox, progress indicator, and "all clear" empty state. Cleanliness indicator on room cards is already implemented from Phase 2. + +Requirements: PLAN-01, PLAN-02, PLAN-03, PLAN-04, PLAN-05, PLAN-06, CLEAN-01 + + + + +## Implementation Decisions + +### Daily plan screen structure +- **Single scroll list** with three section headers: Überfällig → Heute → Demnächst +- **Flat task list** within each section — tasks are not grouped under room sub-headers. Each task row shows the room name as an inline tappable tag that navigates to that room's task list +- **Progress indicator** at the very top of the screen as a prominent card/banner (e.g. "5 von 12 erledigt") — first thing the user sees +- Overdue section only appears when there are overdue tasks +- Demnächst section is **collapsed by default** — shows header with count (e.g. "Demnächst (4)"), expands on tap +- PLAN-01 "grouped by room" is satisfied by room name shown on each task — not visual sub-grouping + +### Task completion on daily plan +- **Checkbox only** — no swipe-to-complete gesture. Consistent with Phase 2 room task list +- Completed tasks **animate out** of the list (slide away). Progress counter updates immediately +- **No navigation from tapping task rows** — the daily plan is a focused "get things done" screen. Only the checkbox and the room name tag are interactive +- Completion behavior is identical to Phase 2: immediate, no undo, records timestamp, auto-calculates next due date + +### Upcoming tasks scope +- **Tomorrow only** — Demnächst shows tasks due the next calendar day +- **Read-only preview** — no checkboxes, tasks cannot be completed ahead of schedule from the daily plan +- Collapsed by default to keep focus on today's actionable tasks + +### Claude's Discretion +- "All clear" empty state design (follow Phase 1's playful, emoji-friendly German tone with the established visual pattern: Material icon + message + optional action) +- Task row adaptation for daily plan context (may differ from TaskRow in room view since no row-tap navigation and room name tag is added) +- Exact animation for task completion (slide direction, duration, easing) +- Progress card/banner visual design (linear progress bar, circular, or text-only) +- Section header styling and the collapsed/expanded toggle for Demnächst +- How overdue tasks are sorted within the flat list (most overdue first, or by room, or alphabetical) + + + + +## Specific Ideas + +- The daily plan is the "quick action" screen — open app, see what's due, check things off, done. No editing, no navigation into task details from here +- Room name tags on task rows serve dual purpose: context (which room) and navigation shortcut (tap to go to that room) +- Progress indicator at top gives immediate gratification feedback — the number going up as you check things off +- Tomorrow's tasks are a gentle "heads up" — not actionable, just awareness of what's coming +- Overdue section should feel urgent but not stressful — warm coral color from Phase 2 (0xFFE07A5F), not alarm-red + + + + +## Existing Code Insights + +### Reusable Assets +- `TaskRow` (`lib/features/tasks/presentation/task_row.dart`): Existing row widget with checkbox, name, relative date, frequency label. Needs adaptation for daily plan (add room name tag, remove row-tap navigation, keep checkbox behavior) +- `TasksDao.completeTask()` (`lib/features/tasks/data/tasks_dao.dart`): Full completion logic with scheduling — reuse directly from daily plan +- `TasksDao.watchTasksInRoom()`: Current query is per-room. Daily plan needs a cross-room query (all tasks, filtered by date range) +- `RoomWithStats` + `RoomCard` (`lib/features/rooms/`): Cleanliness indicator already fully implemented — CLEAN-01 is satisfied on Rooms screen +- `formatRelativeDate()` (`lib/features/tasks/domain/relative_date.dart`): German relative date labels — reuse on daily plan task rows +- `_overdueColor` constant (0xFFE07A5F): Warm coral for overdue styling — reuse for overdue section +- `HomeScreen` (`lib/features/home/presentation/home_screen.dart`): Current placeholder with empty state pattern — will be replaced entirely +- `taskActionsProvider` (`lib/features/tasks/presentation/task_providers.dart`): Existing provider for task mutations — reuse for checkbox completion + +### Established Patterns +- **Riverpod 3 code generation**: `@riverpod` annotation + `.g.dart` files. Functional StreamProviders for data, class-based AsyncNotifier for mutations +- **Manual StreamProvider.family**: Used for `tasksInRoomProvider` due to drift Task type issue with riverpod_generator — may need similar pattern for daily plan queries +- **Localization**: All UI strings from ARB files via `AppLocalizations.of(context)` +- **Theme access**: `Theme.of(context).colorScheme` for all colors +- **GoRouter**: Existing routes under `/rooms/:roomId` — room name tag navigation can use `context.go('/rooms/$roomId')` + +### Integration Points +- Daily plan replaces `HomeScreen` placeholder — same route (`/` or Home tab in shell) +- New DAO query needed: watch all tasks across rooms, not filtered by roomId +- Room name lookup needed per task (tasks table has roomId, need room name for display) +- Phase 4 notifications will query the same "tasks due today" data this phase surfaces +- Completion from daily plan uses same `TasksDao.completeTask()` — no new data layer needed + + + + +## Deferred Ideas + +None — discussion stayed within phase scope + + + +--- + +*Phase: 03-daily-plan-and-cleanliness* +*Context gathered: 2026-03-16*