Dominic's Tasks - Implementation Plan v3

Version: 3.1 Architecture: Multi-Child Family with Parent Approval Workflow Last Updated: January 19, 2026 Author: MiniMax Agent

---

Overview

This document outlines the implementation plan for v3 of Dominic's Tasks, which introduces a multi-child family structure with a comprehensive parent approval workflow for task completion.

Architecture Summary

Data Structure (v2)

families/{familyId}
├── settings: FamilySettings
├── children:
│   ├── {childId}: ChildProfile
│   │   ├── stats: { totalEP, level, currentStreak, tasksCompleted, totalTasks }
│   │   └── settings: { defaultApprovalLevel, ... }
│   └── {childId2}: ChildProfile
└── approvals:
    ├── {approvalId}: TaskApproval
    └── (query: where status == 'pending')

families/{familyId}/children/{childId}/tasks/{taskId} ├── Task document (with approvalStatus, approvalId fields) └── comments: └── {commentId}: Comment

Approval Levels

LevelNameDescription

0No Approval RequiredPoints awarded immediately upon task completion 1Light VerificationPoints held for 24 hours unless parent rejects 2Parent Approval RequiredParent must review and approve before points awarded 3Evidence RequiredChild must upload evidence before parent review

---

Implementation Status - January 19, 2026

✅ Completed Features (Today's Updates)

#### Critical Fixes

  • [x] FamilySetupScreen Bug Fix - Fixed empty updateFamilySettings function that prevented new family registration
  • - File: src/components/FamilySetupScreen.tsx - Change: Imported updateParentSettings from FamilyContext and integrated directly into handleCreateProfile

  • [x] ParentDashboard Approval Integration - Connected dashboard to real approval data from Firestore
  • - File: src/components/ParentDashboard.tsx - Changes: - Imported useTasks hook with pendingApprovals, approveTaskCompletion, rejectTaskCompletion - Created displayApprovals memoized transform to convert TaskApproval records to display format - Replaced mock data with real-time approval data - Implemented working approve/reject handlers connected to TasksContext - Added human-readable approval level labels using APPROVAL_LEVELS configuration - Enhanced approval cards with child avatar, theme color, and evidence indicators

  • [x] TaskCard Approval State Visuals - Implemented visual feedback for approval workflow states
  • - File: src/components/TaskCard.tsx - Changes: - Added getStatusStyles() function for conditional card styling - Implemented yellow border/background for pending_approval state - Implemented green border/background for done state - Added "Waiting for Parent" badge with clock icon for pending tasks - Disabled completion checkbox for pending approval tasks - Added appropriate hover states and transitions

  • [x] Layout Child Profile Stats - Updated sidebar to display correct child statistics
  • - File: src/components/Layout.tsx - Changes: - Imported useFamily hook - Added conditional rendering for child mode vs parent mode - Child mode now shows selected child's avatar, name, level, EP, and streak - Parent mode shows simplified "Parent Mode" indicator

  • [x] Tasks.tsx v2 Paths - Updated to use v2 Firestore path structure
  • - File: src/pages/Tasks.tsx - Changes: - Added useFamily hook for currentProfileId - Updated restoreTasks to use families/{uid}/children/{profileId}/tasks path - Added v2-specific fields (approvalStatus, approvalId) to restored tasks - Added validation to ensure user and profile are selected before restoration

    #### Infrastructure

  • [x] Firestore Security Rules - Created comprehensive security rules
  • - File: firestore.rules - Features: - Family isolation (only owner can access their family's data) - Child profile management permissions - Task CRUD with validation - Approval workflow permissions (parents only can approve/reject) - Chat and resource permissions

  • [x] v1 to v2 Migration Utility - Created data migration tool
  • - File: src/services/migrateV1ToV2.ts - Features: - Authenticates user and validates authorization - Creates family structure with child profile - Migrates legacy v1 tasks to v2 structure - Preserves all task data and timestamps - Deletes legacy user documents - Provides preview mode to check migration scope

    #### Documentation

  • [x] Comprehensive Audit Report
  • - File: dev/docs/03-audits-analysis/V2_CODEBASE_AUDIT.md - Contents: - Executive summary of codebase state - Critical issues with severity ratings - Context and data architecture review - UI component analysis - Parent dashboard deep dive - Priority action items with status tracking - Firestore data structure documentation - Testing checklist - Implementation roadmap

  • [x] Documentation Index Update
  • - File: dev/docs/README.md - Added links to new audit report and migration utility

    ---

    File Structure (Updated)

    dominicstasks/
    ├── src/
    │   ├── App.tsx                      # Main app with routing
    │   ├── main.tsx                     # Entry point
    │   ├── context/
    │   │   ├── AuthContext.tsx          # Authentication
    │   │   ├── FamilyContext.tsx        # Family/child profiles
    │   │   └── TasksContext.tsx         # Task management + approvals
    │   ├── components/
    │   │   ├── Layout.tsx               # Main layout (UPDATED: child stats)
    │   │   ├── TaskCard.tsx             # Task display (UPDATED: approval states)
    │   │   ├── TaskModal.tsx            # Add/edit task
    │   │   ├── TaskColumn.tsx           # Task column wrapper
    │   │   ├── ProfileSelectionScreen.tsx  # Child profile picker
    │   │   ├── FamilySetupScreen.tsx    # First-time setup (FIXED)
    │   │   ├── ParentDashboard.tsx      # Parent admin panel (UPDATED)
    │   │   ├── PinPad.tsx               # PIN entry component
    │   │   ├── CommentsModal.tsx        # Task comments
    │   │   ├── CommentsPanel.tsx        # Inline comments
    │   │   └── ...
    │   ├── pages/
    │   │   ├── Tasks.tsx                # Main tasks page (UPDATED: v2 paths)
    │   │   ├── Calendar.tsx             # Calendar view
    │   │   ├── FamilyChat.tsx           # Family messaging
    │   │   ├── ParentChat.tsx           # Parent-only chat
    │   │   ├── History.tsx              # Completed tasks history
    │   │   ├── Achievements.tsx         # Achievement badges
    │   │   ├── Resources.tsx            # Learning resources
    │   │   └── Login.tsx                # Login page
    │   ├── services/
    │   │   ├── firebase.ts              # Firebase configuration
    │   │   ├── devMode.ts               # Development utilities
    │   │   ├── googleDrive.ts           # Google Drive integration
    │   │   └── migrateV1ToV2.ts         # v1 data migration (NEW)
    │   ├── types/
    │   │   └── index.ts                 # TypeScript types
    │   ├── utils/
    │   │   └── index.ts                 # Utility functions
    │   └── index.css                    # Global styles
    ├── firestore.rules                  # Firestore security rules (NEW)
    ├── package.json
    └── tailwind.config.js
    

    ---

    Context Dependencies

    AuthContext

  • Provides: user, firebaseUser, signIn, signOut, isParent, isAuthorized
  • Used by: All components needing authentication state
  • FamilyContext

  • Provides: family, currentProfile, profiles, selectProfile, enterParentMode, etc.
  • Used by: Layout, ProfileSelectionScreen, ParentDashboard, TasksContext
  • TasksContext

  • Provides: tasks, completeTask, approveTaskCompletion, rejectTaskCompletion, pendingApprovals
  • Used by: TaskCard, Tasks, ParentDashboard
  • ---

    Setup Instructions

    First-Time Setup

  • User logs in with Google account
  • Redirected to FamilySetupScreen if no family exists
  • Step 1: Enter family name
  • Step 2: Create parent PIN
  • Step 3: Add first child profile
  • Redirect to profile selection
  • Adding New Child (Parent Mode)

  • Enter parent PIN
  • Navigate to Children tab
  • Click "Add Child"
  • Enter name, select avatar, choose theme color
  • Profile created automatically
  • Configuring Approval Levels

  • Enter parent mode
  • Navigate to Children tab
  • Click edit on child's profile
  • Set "Default Approval Level"
  • Save changes
  • Approving Tasks

  • Enter parent mode
  • Navigate to Approvals tab
  • Review pending approvals
  • Click "Approve" or "Reject"
  • (Optional) Add rejection reason
  • ---

    Rollout Plan - Updated

    Phase 1: Core Infrastructure ✅ COMPLETE

  • [x] Family structure
  • [x] Child profiles
  • [x] Task CRUD
  • [x] Basic approval workflow
  • [x] CRITICAL FIXES (FamilySetupScreen, ParentDashboard, TaskCard, Layout, Tasks.tsx)
  • Phase 2: Integration & Security ✅ COMPLETE

  • [x] Context connections
  • [x] UI updates
  • [x] Firestore security rules
  • [x] Data migration utility
  • Phase 3: Testing & Polish 🚧 IN PROGRESS

  • [ ] Unit tests for context providers
  • [ ] Integration tests for approval workflow
  • [ ] End-to-end user journey tests
  • [ ] Mobile responsive testing
  • [ ] Performance optimization
  • Phase 4: Launch 📋 PENDING

  • [ ] Deploy to production
  • [ ] Monitor errors
  • [ ] Gather feedback
  • [ ] Plan Phase 5 features
  • ---

    Known Issues & Workarounds

    IssueSeverityStatusWorkaround

    Legacy user documents in FirestoreLowDocumentedData migration utility No email notifications yetMediumPendingManual checking pending approvals No push notifications yetMediumPendingCheck Approvals tab regularly Evidence upload not implementedLowPendingUse comments for evidence Tasks.tsx uses custom renderingLowIdentifiedCould refactor to use TaskCard

    ---

    Testing Checklist

    Unit Tests (Pending)

  • [ ] FamilyContext profile selection
  • [ ] TasksContext completion logic
  • [ ] Approval level calculation
  • [ ] PIN verification
  • Integration Tests (Pending)

  • [ ] Complete task → creates approval
  • [ ] Approve approval → marks task done
  • [ ] Reject approval → returns task to todo
  • [ ] Switch profile → shows correct tasks
  • E2E Tests (Pending)

  • [ ] New family setup flow
  • [ ] Parent approval workflow
  • [ ] Child task completion flow
  • [ ] Profile switching
  • ---

    Next Steps

    Immediate (This Session)

  • Test the fixes in development environment
  • Verify all imports are correct
  • Check for any TypeScript errors
  • This Week

  • Complete testing phase
  • Mobile responsive testing
  • Performance profiling
  • Before Launch

  • Final security review
  • Error monitoring setup
  • Documentation completion
  • ---

    Related Documentation

  • v2 Codebase Audit
  • Changelog
  • Milestones
  • Firestore Rules (Project Root)
  • ---

    Summary of Changes (January 19, 2026)

    Files Modified

  • src/components/FamilySetupScreen.tsx - Fixed setup wizard
  • src/components/ParentDashboard.tsx - Real approval data integration
  • src/components/TaskCard.tsx - Approval state visuals
  • src/components/Layout.tsx - Child profile statistics
  • src/pages/Tasks.tsx - v2 Firestore paths
  • Files Created

  • firestore.rules - Firestore security rules
  • src/services/migrateV1ToV2.ts - v1 to v2 data migration
  • dev/docs/03-audits-analysis/V2_CODEBASE_AUDIT.md - Comprehensive audit report
  • Files Updated

  • dev/docs/README.md - Documentation index
  • dev/IMPLEMENTATION_PLAN_v3.md - This document
  • ---

    Document Owner: Development Team Next Review: After Phase 3 completion Version: 3.1.0