This commit adds a complete onboarding improvements system including progress
tracking, streamlined UI, and role-based family invitation system.
## Backend Changes
### Database Migrations
- Add onboarding tracking fields to users table (onboarding_completed, onboarding_step, onboarding_data)
- Add role-based invite codes to families table (parent/caregiver/viewer codes with expiration)
- Add indexes for fast invite code lookups
### User Preferences Module
- Add UserPreferencesController with onboarding endpoints
- Add UserPreferencesService with progress tracking methods
- Add UpdateOnboardingProgressDto for validation
- Endpoints: GET/PUT /api/v1/preferences/onboarding, POST /api/v1/preferences/onboarding/complete
### Families Module - Role-Based Invites
- Add generateRoleInviteCode() - Generate role-specific codes with expiration
- Add getRoleInviteCodes() - Retrieve all active codes for a family
- Add joinFamilyWithRoleCode() - Join family with automatic role assignment
- Add revokeRoleInviteCode() - Revoke specific role invite codes
- Add sendEmailInvite() - Generate code and send email invitation
- Endpoints: POST/GET/DELETE /api/v1/families/:id/invite-codes, POST /api/v1/families/join-with-role, POST /api/v1/families/:id/email-invite
### Email Service
- Add sendFamilyInviteEmail() - Send role-based invitation emails
- Beautiful HTML templates with role badges (👨👩👧 parent, 🤝 caregiver, 👁️ viewer)
- Role-specific permission descriptions
- Graceful fallback if email sending fails
### Auth Service
- Fix duplicate family creation bug in joinFamily()
- Ensure users only join family once during onboarding
## Frontend Changes
### Onboarding Page
- Reduce steps from 5 to 4 (combined language + measurements)
- Replace card-based selection with dropdown selectors
- Add automatic progress saving after each step
- Add progress restoration on page mount
- Extract FamilySetupStep into reusable component
### Family Page
- Add RoleInvitesSection component with accordion UI
- Generate/view/copy/regenerate/revoke controls for each role
- Send email invites directly from UI
- Display expiration dates (e.g., "Expires in 5 days")
- Info tooltips explaining role permissions
- Only visible to users with parent role
### API Client
- Add role-based invite methods to families API
- Add onboarding progress methods to users API
- TypeScript interfaces for all new data structures
## Features
✅ Streamlined 4-step onboarding with dropdown selectors
✅ Automatic progress save/restore across sessions
✅ Role-based family invites (parent/caregiver/viewer)
✅ Beautiful email invitations with role descriptions
✅ Automatic role assignment when joining with invite codes
✅ Granular permission control per role
✅ Email fallback if sending fails
✅ All changes tested and production-ready
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
All notification API calls were missing the /api/v1 prefix causing 404 errors.
Fixed all endpoints:
- GET /api/v1/notifications
- PATCH /api/v1/notifications/:id/read
- PATCH /api/v1/notifications/mark-all-read
- PATCH /api/v1/notifications/:id/dismiss
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changed from offset=0 to includeRead=false to match backend API parameters.
Backend only supports: limit, status, includeRead
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed notification bell integration by:
- Updated API client to match backend's wrapped response format
- Changed notification types to match database enums
- Adjusted notification interface to include all backend fields
- Backend notifications API already exists, no changes needed
Backend endpoint: GET /api/v1/notifications returns:
{ success: true, data: { notifications: [...] } }
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements Phase 1 of notification bell feature with:
- NotificationBell component with badge counter (99+ max)
- useNotifications hook with 30s polling and caching
- Notifications API client for backend integration
- Integration into AppShell header next to user avatar
- Responsive dropdown (400px desktop, full-width mobile)
- Empty state, loading, and error handling
- Optimistic UI updates for mark as read
- Animated badge with pulse effect
- Icon mapping for notification types
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed two critical issues in user settings:
1. Settings save 400 error - Removed invalid notifications boolean
that didn't match backend DTO structure
2. Push notifications toggle not working - Properly structured
notifications preferences as nested object with pushEnabled/emailEnabled
Changes:
- Updated state to use pushEnabled instead of simple notifications boolean
- Load pushEnabled from user.preferences.notifications.pushEnabled
- Send notifications as nested object to match UpdateProfileDto
- Both push and email notification toggles now work independently
Backend DTO expects:
{
preferences: {
notifications: {
pushEnabled: boolean,
emailEnabled: boolean
}
}
}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical permission bypass where viewers could:
- Remove family members (now only parents can)
- Invite new members (now only parents can)
- Generate share codes (now only parents can)
- Add children (now only parents can)
- Edit children (now only parents and caregivers can)
- Delete children (now only parents can)
Changes:
- Family page: Added isParent checks for all admin actions
- Children page: Added canAddChildren, canEditChildren, canDeleteChildren checks
- Both pages now use useSelectedFamily hook for consistent role access
Backend already had correct permission checks - this fixes the frontend to respect them.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created useSelectedFamily hook for managing family selection across app
- Added family selector dropdown to family page when user has multiple families
- Family selection persists in localStorage
- Fixed bug where users could only see their first family
- Updated dev port from 3005 to 3030 in package.json
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement database-backed notification settings that persist across restarts:
Backend changes:
- Updated DashboardService to read/write notification settings from database
- Added 6 notification settings keys to dbSettingsMap:
* enable_email_notifications (boolean)
* enable_push_notifications (boolean)
* admin_notifications (boolean)
* error_alerts (boolean)
* new_user_alerts (boolean)
* system_health_alerts (boolean)
- Settings are now retrieved from database with fallback defaults
Database:
- Seeded 6 default notification settings in settings table
- All notification toggles default to 'true'
- Settings persist across server restarts
Frontend:
- Admin settings page at /settings already configured
- Notifications tab contains all 6 toggle switches
- Settings are loaded from GET /api/v1/admin/dashboard/settings
- Settings are saved via POST /api/v1/admin/dashboard/settings
API Endpoints (already existed, now enhanced):
- GET /api/v1/admin/dashboard/settings - Returns all settings including notifications
- POST /api/v1/admin/dashboard/settings - Persists notification settings to database
Files modified:
- maternal-app-backend/src/modules/admin/dashboard/dashboard.service.ts
Benefits:
✅ Global notification settings are now persistent
✅ Admin can control email/push notifications globally
✅ Admin can configure alert preferences
✅ Settings survive server restarts and deployments
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add validation in onSubmit to check for invite code when required
- Display user-friendly error message instead of API error
- Prevent form submission until invite code is provided
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Backend Changes:
- Added GET /api/v1/auth/registration/config public endpoint
- Returns registrationMode and requireInviteCode settings
- No authentication required - accessible before registration
- Injected ConfigService into AuthController
This allows the frontend to dynamically show/hide the invite code
field based on the current registration mode setting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Frontend Changes:
- Added inviteCode field to registration schema (optional)
- Added invite code TextField to registration form UI
- Updated RegisterData interface in AuthContext to include inviteCode
- Pass inviteCode to backend during registration
- Added helpful placeholder text indicating field is optional
User Experience:
- Invite code field appears after email in registration form
- Helper text explains it's optional and can be left blank if registration is open
- Backend will validate the code if REGISTRATION_MODE=invite_only
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Removed from git tracking:
- Development documentation: ADMIN_IMPLEMENTATION_STATUS.md, DATABASE_SCHEMA_SYNC.md, PROGRESS.md, PRODUCTION_DEPLOYMENT.md, PRODUCTION_INSTALLATION.md, TESTING.md, PACKAGE_UPGRADE_PLAN.md, BACKUP_STRATEGY.md
- Production scripts: deploy-production.sh, migrate-production.sh, start-production.sh, stop-production.sh
- Test files: test-azure-openai.js, test-prompt-injection.*, test-rate-limit.sh, test-voice-intent.mjs, test-audio.wav
- Example files: example-queries.gql
Updated .gitignore to exclude:
- Development documentation patterns (*_IMPLEMENTATION_STATUS.md, etc.)
- Production deployment scripts
- Test scripts and files (test-*.js, test-*.ts, test-*.mjs)
- Temp directories (**/temp/)
- Example files (example-queries.gql)
All files remain available locally but won't clutter the repository.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update frontend .env.local to use https:// for API URLs
- Update admin .env.local to use https:// for API URLs
- Update start-dev.sh to generate .env.local files with HTTPS URLs
- Update backend CORS configuration to allow HTTPS origins
- Change WebSocket URLs from ws:// to wss://
This fixes the Mixed Content error when accessing the app over HTTPS
- Remove production Docker Compose files (docker-compose.production.yml, docker-compose.prod-simple.yml)
- Remove production Dockerfiles (backend and frontend)
- Move implementation docs to docs/implementation-docs/ directory
- Remove test scripts (test-embeddings.js, test-voice-*.js/sh)
- Update ecosystem.config.js with production environment variables (CORS, JWT secrets, database config)
- Add database connection pooling configuration
- Update CORS configuration for production domains (parentflowapp.com)
- Fix frontend dev server port configuration (3005)
- Add PWA web push implementation plan documentation
- Simplify health check endpoints (remove MongoDB/Redis specific checks)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created production-ready Dockerfiles with multi-stage builds
- Implemented complete CI/CD pipeline with GitHub Actions:
- Automated testing for backend and frontend
- Security scanning with Trivy
- Docker image building and pushing to GHCR
- Automated deployments to dev and production
- Zero-downtime deployment strategy with rollback
- Set up docker-compose for both development and production
- Configured Nginx reverse proxy with SSL support
- Domain configuration:
- Development: maternal.noru1.ro:3005, maternal-api.noru1.ro:3015
- Production: parentflowapp.com, api.parentflowapp.com
- Created comprehensive health check endpoints for monitoring
- Updated port configuration for development environment
- Added environment-specific configuration files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created EnhancedInsightsDashboard with multiple chart types:
- Area charts with gradients for activity trends
- Radar chart for weekly activity patterns
- 24-hour heatmap visualization
- Bubble/scatter chart for correlations
- Time of day distribution bar chart
- Added toggle between basic and enhanced chart views
- Implemented chart export functionality (PNG/PDF)
- Fixed API endpoint URLs (circadian-rhythm, query params)
- Fixed component library conflicts (shadcn/ui → MUI)
- Added comprehensive null safety for timestamp handling
- Added alert type translations in all 5 languages
- Installed html2canvas and jspdf for export features
- Applied consistent minimum width styling to all charts
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive API client methods for all advanced analytics endpoints
- Create CircadianRhythmCard component for sleep pattern visualization
- Create AnomalyAlertsPanel for anomaly detection and alerts
- Create GrowthPercentileChart with WHO/CDC percentiles
- Create CorrelationInsights for activity correlations
- Create TrendAnalysisChart with predictions
- Add advanced analytics page with all new components
- Add UI component library (shadcn/ui) setup
- Add navigation link to advanced analytics from insights page
All advanced analytics features are now accessible from the frontend UI.
## AI Chat Fixes
- **CRITICAL**: Fixed AI chat responding only with sleep-related info
- Root cause: Current user message was never added to context before sending to AI
- Added user message to context in ai.service.ts before API call
- Fixed conversation ID handling for new conversations (undefined check)
- Fixed children query to properly use FamilyMember join instead of incorrect familyId lookup
- Added FamilyMember entity to AI module imports
- **Context improvements**:
- New conversations now use empty history array (not the current message)
- Properly query user's children across all their families via family membership
## Children Authorization Fix
- **CRITICAL SECURITY**: Fixed authorization bug where all users could see all children
- Root cause: Controllers used `user.sub` but JWT strategy returns `user.userId`
- Changed all children controller methods to use `user.userId` instead of `user.sub`
- Added comprehensive logging to track userId and returned children
- Backend now correctly filters children by family membership
## WebSocket Authentication
- **Enhanced error handling** in families gateway
- Better error messages for connection failures
- Added debug logging for token validation
- More descriptive error emissions to client
- Added userId fallback (checks both payload.userId and payload.sub)
## User Experience
- **Auto-clear cache on logout**:
- Logout now clears localStorage and sessionStorage
- Prevents stale cached data from persisting across sessions
- Users get fresh data on every login without manual cache clearing
## Testing
- Backend correctly returns only user's own children (verified in logs)
- AI chat now responds to all types of questions, not just sleep-related
- WebSocket authentication provides clearer error feedback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace basic Select dropdown with ChildSelector component
- Add child photo + name display matching other pages (/track/feeding, etc.)
- Update state management to use selectedChildIds array for consistency
- Improve visual consistency across the application
- Maintain single selection mode for insights filtering
- Remove mock authentication from authSlice to enable real user login
- Fix WebSocket connection errors by using real JWT tokens
- Consolidate duplicate filters on insights page into single shared filter
- Update InsightsDashboard to accept props instead of managing own state
- Add MUI Grid styling for 20% min-width and centering
- Improve UX with unified filter controls for both insights and predictions
Authentication & Token Management:
- Add deviceId to token refresh flow (backend requires both refreshToken and deviceId)
- Fix React Strict Mode token clearing race condition with retry logic
- Improve AuthContext to handle all token state combinations properly
- Store deviceId in localStorage alongside tokens
UI/UX Improvements:
- Remove deprecated legacyBehavior from Next.js Link components
- Update primary theme color to WCAG AA compliant #7c3aed
- Fix nested button error in TabBar voice navigation
- Fix invalid Tabs value error in DynamicChildDashboard
Multi-Child Dashboard:
- Load all children into Redux store properly
- Fetch metrics for all children, not just selected one
- Remove mock data to prevent unauthorized API calls
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added back button to UnifiedInsightsDashboard component to match
the navigation pattern used in tracker pages (sleep, feeding, etc).
Changes:
- Added ArrowBack icon import
- Added useRouter hook
- Added IconButton with router.back() onClick handler
- Restructured header to include back button alongside title
Now insights page has consistent navigation with tracker pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
GraphQL endpoint was returning 400 errors due to authentication issues
with the GqlAuthGuard. Replaced GraphQL query with REST API calls to
match the working insights page pattern.
Changes:
- Removed useQuery(GET_DASHBOARD) GraphQL call
- Added REST API calls: childrenApi.getChildren(), trackingApi.getActivities()
- Calculate today's summary from activities client-side
- Load children and dashboard data separately
- Removed all GraphQL debug logging
Now home page uses same REST pattern as insights page:
1. Load children via childrenApi
2. Load activities via trackingApi
3. Calculate summary from filtered activities
This eliminates the GraphQL 400 errors and makes Today's Summary
display correctly with feeding count, sleep duration, diaper count.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Root cause: Trackers were using Redux state.auth.user (mock data) while
insights page was using useAuth() hook (real backend data from /me).
Since the user is logged in as andrei@cloudz.ro, AuthContext fetches
the real user with Alice child, but trackers were looking for mock
familyId 'fam_test123' which doesn't exist.
Fix: Changed all tracker pages and home page to use:
user?.families?.[0]?.familyId (from useAuth hook)
instead of:
state.auth.user?.familyId (from Redux mock)
This makes all pages consistent with the insights page approach.
Files updated:
- app/page.tsx (home)
- app/track/sleep/page.tsx
- app/track/feeding/page.tsx
- app/track/diaper/page.tsx
- app/track/activity/page.tsx
- app/track/growth/page.tsx
- app/track/medicine/page.tsx
Now all pages fetch children using the real logged-in user's familyId.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added Alice and Bob as mock children in development mode to allow
tracking pages and UI to work without requiring authentication.
Changes:
- Updated childrenSlice to use childrenApi for consistent backend calls
- Pre-populated Redux store with 2 mock children (Alice, Bob)
- Set selectedChildId to first child by default
- Added mock token to localStorage for API client
This allows all tracking forms and ChildSelector components to work
in development without needing real login/auth flow.
TODO: Remove mocks and implement real authentication in production.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added mock test user to auth slice initialState to provide familyId
for children fetching in development environment.
Issue: Tracking pages couldn't fetch children because state.auth.user
was null, resulting in no familyId for API calls.
Solution: Mock user with test familyId in development mode only.
TODO: Implement proper authentication flow in production.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated all 6 tracking forms with ChildSelector component:
✅ Feeding form
✅ Sleep form
✅ Diaper form
✅ Activity form
✅ Growth form
✅ Medicine form
Changes applied to each form:
- Replace local child state with Redux state management
- Use ChildSelector component instead of custom select
- Sync selectedChildIds with Redux store
- Update API calls to use selectedChild.id
- Remove duplicate loadChildren functions
- Use Redux loading state
Build Results:
- ✅ All 38 pages compiled successfully
- ✅ No TypeScript errors
- ✅ No runtime warnings
- Bundle sizes optimized (all tracking forms 3-10 kB)
Phase 3 Activity Logging: 100% COMPLETE
- Replace local child state with Redux state management
- Use ChildSelector component instead of custom select
- Sync selectedChildIds with Redux store
- Update API calls to use selectedChild.id
- Remove loadChildren function
- Replace local child state with Redux state management
- Use ChildSelector component instead of custom select
- Sync selectedChildIds with Redux store
- Update API calls to use selectedChild.id
- Remove loadChildren function
- Replace local child state with Redux state management
- Use ChildSelector component instead of custom select
- Sync selectedChildIds with Redux store
- Update API calls to use selectedChild.id
- Remove duplicate child loading logic
- Build and test successfully
- Create ComparisonView component for analytics comparison
- Add compareChildren API method with ComparisonMetric enum
- Implement interactive chart visualization with Recharts
- Support multiple metrics: sleep patterns, feeding frequency, diaper changes, activities
- Show per-child summary cards with color-coded display
- Date range filtering with DatePicker
- Build and test successfully
Completed Phase 3 tasks:
✅ Dynamic dashboard with tabs (1-3 children) and cards (4+ children)
✅ ChildSelector integration in tracking forms (feeding form complete, pattern documented for others)
✅ Comparison analytics visualization component
✅ Frontend build and test successful
- Replace local child selector with shared ChildSelector component
- Use Redux for children state management
- Sync selected child with Redux store
- Remove duplicate child loading logic
- Maintain single child selection for feeding tracking
- Build and test successfully
State Updates:
- Added selectedChildIds array for multi-select
- Added defaultChildId for quick actions
- Added viewMode (auto/tabs/cards) with automatic detection
- Added lastSelectedPerScreen for per-route child memory
- Updated Child interface with displayColor, sortOrder, nickname fields
- Changed sort comparator to use sortOrder (birth order) instead of createdAt
New Actions:
- selectChildren(ids[]) - Select multiple children
- toggleChildSelection(id) - Toggle single child in multi-select
- setDefaultChild(id) - Set default child for quick actions
- setViewMode(mode) - Manual view mode override
- setLastSelectedForScreen({screen, childId}) - Remember per-screen selection
localStorage Integration:
- Persists selectedChildId
- Persists defaultChildId
- Persists viewMode preference
- Persists lastSelectedPerScreen map
New Selectors:
- selectSelectedChildren() - Get all selected children as array
- selectDefaultChild() - Get default child entity
- selectChildrenCount() - Total number of children
- selectViewMode() - Computed view mode (tabs/cards based on count)
- selectChildColor(childId) - Get child's display color
- selectLastSelectedForScreen(screen) - Get last child for specific screen
View Mode Logic:
- auto + <=3 children = tabs
- auto + >3 children = cards
- manual override = use set value
Use Cases:
- Dashboard child switching with tabs/cards
- Multi-child activity logging
- Child-specific routing memory
- Default child for quick actions
- Color-coded UI elements
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Theme-Aware Colors Across App:**
- Updated track page cards to use theme.palette colors
- Updated analytics page icons to use theme colors
- Updated login/register gradient backgrounds to use theme colors
- All colors now respond to Standard/High Contrast theme toggle
**Fixed Next Predicted Activity Section:**
- Connected to real analytics API predictions endpoint
- Fetches sleep and feeding predictions based on actual data
- Shows "Nap time in X minutes" when prediction available
- Displays formatted time using formatDistanceToNow
- Falls back to "Not enough data available for now. Keep tracking :)" when no predictions
**Multi-Language Support:**
- Added "notEnoughData" translation key to all 7 languages:
- English: "Not enough data available for now. Keep tracking :)"
- Spanish: "No hay suficientes datos disponibles por ahora. ¡Sigue rastreando! :)"
- French: "Pas assez de données disponibles pour le moment. Continuez à suivre :)"
- Portuguese: "Dados insuficientes disponíveis no momento. Continue rastreando :)"
- Chinese: "暂无足够数据。请继续记录 :)"
- German: "Derzeit nicht genügend Daten verfügbar. Weiter verfolgen :)"
- Italian: "Dati insufficienti al momento. Continua a monitorare :)"
**Color Mapping by Theme:**
*Purple Theme (Standard):*
- Feeding: Primary (#8b52ff)
- Sleep: Secondary (#ff7094)
- Diaper: Warning (amber)
- Medical: Error (red)
- Activity: Success (green)
- Growth: Primary Dark
*Peach Theme (High Contrast):*
- Feeding: Primary (#FFB6C1)
- Sleep: Secondary (#FFDAB9)
- Diaper: Warning (amber)
- Medical: Error (red)
- Activity: Success (green)
- Growth: Primary Dark
**Files Modified:**
- app/track/page.tsx - Dynamic theme colors
- app/analytics/page.tsx - Theme-aware icon colors
- app/(auth)/login/page.tsx - Gradient uses theme
- app/(auth)/register/page.tsx - Gradient uses theme
- app/page.tsx - Predictions integration
- locales/*/dashboard.json - All 7 languages
🎉 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Regenerated service worker and build artifacts after implementing
comprehensive WCAG 2.1 AA form accessibility enhancements.
Changes:
- Rebuilt Next.js production bundle
- Updated service worker cache manifest
- Restarted PM2 frontend process
Fixes 404 error on /track/sleep page caused by missing chunks.
🎉 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented comprehensive form accessibility improvements across all critical forms:
**Accessibility Attributes Added:**
- aria-required="true" on all required form fields
- aria-invalid on fields with validation errors
- aria-describedby linking error messages to inputs
- Unique id attributes on FormHelperText for error association
- role="alert" on error messages for screen reader announcements
- labelId on Select components for proper label association
- noValidate on forms to use custom validation
**Forms Updated:**
1. Login Form (app/(auth)/login/page.tsx)
- Email and password fields with full ARIA support
- Error message association with aria-describedby
2. Registration Form (app/(auth)/register/page.tsx)
- All text fields: name, email, password, DOB, parental email
- Checkbox fields: Terms, Privacy, COPPA consent
- Conditional required fields for minors
3. Child Dialog (components/children/ChildDialog.tsx)
- Name, birthdate, gender fields
- Dynamic aria-invalid based on validation state
4. Tracking Forms:
- Feeding form (app/track/feeding/page.tsx)
- Child selector, side selector, bottle type
- Food description with required validation
- Sleep form (app/track/sleep/page.tsx)
- Child selector, start/end time fields
- Quality and location selectors
**WCAG 2.1 Compliance:**
- ✅ 3.3.2 Labels or Instructions (AA)
- ✅ 4.1.3 Status Messages (AA)
- ✅ 1.3.1 Info and Relationships (A)
- ✅ 3.3.1 Error Identification (A)
**Documentation:**
- Updated REMAINING_FEATURES.md
- Marked Form Accessibility Enhancement as complete
- Status: 79 features completed (57%)
🎉 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- **EULA Persistence Fix**: Fixed EULA dialog showing on every login
- Added eulaAcceptedAt/eulaVersion to AuthResponse interface
- Updated login/register/getUserById endpoints to return EULA fields
- Changed EULACheck to use refreshUser() instead of window.reload()
- **Touch Target Accessibility**: All interactive elements now meet 48x48px minimum
- Fixed 14 undersized IconButtons across 5 files
- Changed size="small" to size="medium" with minWidth/minHeight constraints
- Updated children page, AI chat, analytics cards, legal viewer
- **Alt Text for Images**: Complete image accessibility for screen readers
- Added photoAlt field to children table (Migration V009)
- PhotoUpload component now includes alt text input field
- All Avatar components have meaningful alt text
- Default alt text: "Photo of {childName}", "{userName}'s profile photo"
- **Medical Tracking Consolidation**: Unified medical page with tabs
- Medicine page now has 3 tabs: Medication, Temperature, Doctor Visit
- Backward compatibility for legacy 'medicine' activity type
- Created dedicated /track/growth page for physical measurements
- **Track Page Updates**:
- Simplified to 6 options: Feeding, Sleep, Diaper, Medical, Activity, Growth
- Fixed grid layout to 3 cards per row with minWidth: 200px
- Updated terminology from "Medicine" to "Medical"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added translations for all activity types:
- growth: Growth
- medication: Medication
- medicine: Medicine
- temperature: Temperature
- activity: Activity
This fixes the 'activityTypes.medicine: 1' label display issue
on the insights page where translation keys were showing instead
of translated text.
File Changed:
- locales/en/insights.json
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Created UnifiedInsightsDashboard component with 2 tabs
- Tab 1: Insights - Shows existing charts, stats, and recent activities
- Tab 2: Predictions - Shows AI-powered predictions for next activities
- Growth Spurt Alert appears at the top when detected
- Child selector for families with multiple children
- Clean tab navigation with Timeline and TrendingUp icons
Features Now Accessible from /insights:
✅ Growth Spurt Detection (appears as alert banner)
✅ Pattern Analysis (feeding, sleep, diaper trends)
✅ AI Predictions (next feeding time, sleep duration, etc.)
✅ Charts and visualizations
✅ Recent activities timeline
User Experience:
- Single page access from bottom navigation (Insights icon)
- No need for separate /analytics page
- All smart AI features visible in one place
- Tab switching for different views
Files Changed:
- app/insights/page.tsx - Updated to use UnifiedInsightsDashboard
- components/features/analytics/UnifiedInsightsDashboard.tsx (new)
* Manages state for both tabs
* Loads insights and predictions data
* Renders Growth Spurt Alert
* Tab navigation UI
🎯 Result: Users can now easily see all AI insights and predictions
from the Insights menu item in bottom navigation!
Co-Authored-By: Claude <noreply@anthropic.com>