# QUICK FIX ACTION PLAN ## Your Issue: - Projects Overview shows emails, browser tabs as "projects" - Real projects are hidden in "general" with 1069 activities - Shows 0 files for everything - Not grouping by actual project names ## Immediate Fix (3 steps): ### 1. Run Diagnostic Query First Run `diagnostic_queries.sql` to see what's in your database ### 2. Update Your Code Replace your `activity_categorization_api.py` with `activity_categorization_api_fixed.py` The key changes: ```python # Old: Everything goes to "general" or shows emails as projects # New: Only shows actual coding projects, properly grouped def group_productive_activities_by_project(activities): # Filters out emails, browser tabs # Extracts real project names from window titles # Groups all files from same project together ``` ### 3. Fix Your Database Run `fix_project_extraction.sql` to clean up existing data ### 4. Restart ```bash pm2 restart timesheet-backend ``` ## Result: - Only real projects show up (timesheet, kiki, mahindra-manulife, etc.) - Correct file counts - Combined time for all files in each project - No more emails/browser tabs in projects list ## If you need the projects endpoint specifically fixed: See `projects_endpoint_fix.md` for the complete endpoint code.