Files
HouseHoldKeaper/.planning/phases/02-rooms-and-tasks/2-CONTEXT.md
Jean-Luc Makiola 998f2be87f docs(phase-2): complete context and implementation planning
- Documented comprehensive plan for Phase 2: Rooms and Tasks
- Includes feature scope, requirements, implementation decisions, UI/UX specifics, and scheduling logic
- Updated schema: added Room and Task tables with CRUD and recurrence support
- Added implementation details for room/task templates, cleanliness indicators, and overdue task handling
- Generated Drift schemas for database versioning (v1 → v2) with test coverage
2026-03-16 18:39:00 +01:00

7.7 KiB

Phase 2: Rooms and Tasks - Context

Gathered: 2026-03-15 Status: Ready for planning

## Phase Boundary

Users can create and manage rooms and tasks, mark tasks done, and trust the app to schedule the next occurrence automatically. Delivers: room CRUD with icons and reorder, task CRUD with frequency intervals and effort levels, task completion with auto-scheduling, bundled German-language task templates for 14 room types, overdue highlighting, and room cards with cleanliness indicators.

Requirements: ROOM-01, ROOM-02, ROOM-03, ROOM-04, ROOM-05, TASK-01, TASK-02, TASK-03, TASK-04, TASK-05, TASK-06, TASK-07, TASK-08, TMPL-01, TMPL-02

## Implementation Decisions

Room cards & layout

  • 2-column grid layout on the Rooms screen — compact cards, shows more rooms at once
  • Each card shows: room icon, room name, count of due/overdue tasks, thin cleanliness progress bar
  • No next-task preview or total task count on cards — keep them clean
  • Cleanliness indicator: thin horizontal progress bar at bottom of card, fill color shifts green→yellow→red based on ratio of on-time to overdue tasks
  • Icon picker: curated grid of ~20-30 hand-picked household Material Icons in a bottom sheet. No full icon search — focused and simple
  • Cards support drag-and-drop reorder (ROOM-04)
  • Delete room with confirmation dialog that warns about cascade deletion of all tasks (ROOM-03)

Task completion & overdue

  • Leading checkbox on each task row to mark done — tap to toggle. No swipe gesture.
  • Tapping the task row (not the checkbox) opens task detail/edit
  • Overdue visual: due date text turns warm red/coral color. Rest of row stays normal — subtle but clear
  • No undo on completion — immediate and final. Records timestamp, auto-calculates next due date
  • Task row info: task name, relative due date (e.g. "Heute", "in 3 Tagen", "Überfällig"), and frequency label (e.g. "Wöchentlich", "Alle 3 Tage"). No effort indicator or description preview on list view
  • Tasks within a room sorted by due date (default sort order, TASK-06)

Template selection flow

  • Post-creation prompt: user creates a room first (name + icon), then gets prompted "Aufgaben aus Vorlagen hinzufügen?" with template selection
  • Room type is optional — used only to determine which templates to suggest. Not stored as a permanent field. If no matching room type is detected, no template prompt appears
  • All templates unchecked by default — user explicitly checks what they want. No pre-selection
  • Users can create fully custom rooms (name + icon only) with no template prompt if no room type matches
  • Templates cover all 14 room types from TMPL-02: Küche, Badezimmer, Schlafzimmer, Wohnzimmer, Flur, Büro, Garage, Balkon, Waschküche, Keller, Kinderzimmer, Gästezimmer, Esszimmer, Garten/Außenbereich
  • Templates are bundled in the app as static data (German language)

Scheduling & recurrence

  • Two interval categories with different behavior:
    • Day-count intervals (daily, every N days, weekly, biweekly): add N days from due date. Pure arithmetic, no clamping.
    • Calendar-anchored intervals (monthly, quarterly, every N months, yearly): anchor to original day-of-month. If the month is shorter, clamp to last day of month but remember the anchor (e.g. task set for the 31st: Jan 31 → Feb 28 → Mar 31)
  • Next due calculated from original due date, not completion date — keeps rhythm stable even when completed late
  • Catch-up on very late completion: if calculated next due is in the past, keep adding intervals until next due is today or in the future. No stacking of missed occurrences
  • Custom intervals: user picks a number + unit (Tage/Wochen/Monate). E.g. "Alle 10 Tage" or "Alle 3 Monate"
  • Preset intervals from TASK-04: daily, every 2 days, every 3 days, weekly, biweekly, monthly, every 2 months, quarterly, every 6 months, yearly, custom
  • All due dates stored as date-only (calendar day) — established in Phase 1 pre-decision

Claude's Discretion

  • Room creation form layout (full screen vs bottom sheet vs dialog)
  • Task creation/edit form layout and field ordering
  • Exact Material Icons chosen for the curated icon picker set
  • Drag-and-drop reorder implementation approach (ReorderableListView vs custom)
  • Delete confirmation dialog design
  • Animation on task completion (checkbox fill, row transition)
  • Template data structure and storage format (Dart constants vs JSON asset)
  • Exact color values for overdue red/coral (within the sage & stone palette)
  • Empty state design for rooms with no tasks (following Phase 1 playful tone)
## Specific Ideas
  • Room type detection for templates should be lightweight — match room name against known types, don't force a classification step
  • The template prompt after room creation should feel like a helpful suggestion, not a required step — easy to dismiss
  • Overdue text color should be warm (coral/terracotta) not harsh alarm-red — fits the calm sage & stone palette
  • Relative due date labels in German: "Heute", "Morgen", "in X Tagen", "Überfällig seit X Tagen"
  • The cleanliness bar should be subtle — thin, at the bottom edge of the card, not a dominant visual element
  • Checkbox interaction should feel instant — no loading spinners, optimistic UI

<code_context>

Existing Code Insights

Reusable Assets

  • AppDatabase (lib/core/database/database.dart): Drift database with schema v1, currently no tables — Phase 2 adds Room, Task, and TaskCompletion tables
  • appDatabaseProvider (lib/core/providers/database_provider.dart): Riverpod provider with keepAlive: true and ref.onDispose(db.close) — all DAOs will reference this
  • ThemeNotifier pattern (lib/core/theme/theme_provider.dart): AsyncNotifier with SharedPreferences persistence — template for room/task notifiers
  • SettingsScreen (lib/features/settings/presentation/settings_screen.dart): ConsumerWidget with ref.watch + ref.read(...notifier) pattern — template for reactive screens
  • RoomsScreen placeholder (lib/features/rooms/presentation/rooms_screen.dart): Ready to replace with actual room grid
  • app_de.arb (lib/l10n/app_de.arb): Localization file with 18 existing keys — Phase 2 adds room/task/frequency/effort strings

Established Patterns

  • Riverpod 3 code generation: @riverpod annotation + .g.dart files via build_runner. Functional providers for reads, class-based AsyncNotifier for mutations
  • Clean architecture: features/X/data/domain/presentation layer structure. Presentation never imports directly from data layer
  • GoRouter StatefulShellRoute: /rooms branch exists, ready for nested routes (/rooms/:roomId, /rooms/:roomId/tasks/new)
  • Material 3 theming: ColorScheme.fromSeed with sage green seed (0xFF7A9A6D), warm stone surfaces. All color via Theme.of(context).colorScheme
  • Localization: ARB-based, German-only, strongly typed AppLocalizations.of(context).keyName
  • Database testing: NativeDatabase.memory() for in-memory tests, setUp/tearDown pattern
  • Widget testing: ProviderScope + MaterialApp.router with German locale

Integration Points

  • Phase 2 replaces the RoomsScreen placeholder with the actual room grid
  • Room cards link to room detail screens via GoRouter nested routes under /rooms
  • Task completion data feeds Phase 3's daily plan view (overdue/today/upcoming grouping)
  • Cleanliness indicator logic established here is reused by Phase 3 room cards on the Home screen
  • Phase 4 notifications query task due dates established in this phase's schema

</code_context>

## Deferred Ideas

None — discussion stayed within phase scope


Phase: 02-rooms-and-tasks Context gathered: 2026-03-15