feat: Habit Tracker for Echo Dashboard #2

Open
Marius wants to merge 30 commits from feature/habit-tracker into master
Owner

Overview

Complete implementation of Habit Tracker feature for Echo Dashboard with full customization options, lives system, and comprehensive testing.

Changes Implemented

Backend (8 API endpoints)

  • GET /api/habits with stats (streak, best, completion_rate, weekly_summary)
  • POST /api/habits (create with all customization options)
  • PUT /api/habits/{id} (edit all fields)
  • DELETE /api/habits/{id}
  • POST /api/habits/{id}/check (check-in with optional note/rating/mood)
  • POST /api/habits/{id}/skip (skip with lives system)
  • POST /api/habits/{id}/restore-life (restore after 7 consecutive check-ins)
  • Helper functions: calculate_streak, should_check_today, get_completion_rate, get_weekly_summary

Frontend

  • Responsive card-based layout (1/2/3 columns)
  • Complete create/edit modals with all customization options:
    • Frequency types: daily, specific_days, x_per_week, weekly, monthly, custom
    • Category, color, icon picker, priority, notes, reminder time
  • Check-in interactions (simple click + long-press for detailed entry)
  • Lives system display (❤️ hearts) and skip functionality
  • Streak display (🔥 current + 🏆 best)
  • Filter & sort by category, status, priority, name, streak
  • Stats section with weekly summary bar chart
  • Mobile-responsive with touch optimization (44px+ buttons)

Key Features

  • Lives System: Duolingo-style 3 lives max, skip uses 1 life to maintain streak
  • Streak Calculation: Fixed bug where skips were incorrectly extending streaks - skips now maintain but don't count toward total
  • Frequency Support: All 6 frequency types with custom day selection
  • Customization: Icon picker (Lucide icons), color picker, categories, priorities
  • Data Structure: habits.json schema with completions history

Testing

  • 9 end-to-end integration tests covering all workflows
  • All tests passing in dashboard/tests/
  • Coverage: API endpoints, UI components, integration flows

Integration

  • Navigation link added to index.html
  • API paths use /echo/ prefix
  • Toast notifications for user feedback
  • Common.css for consistent styling

Testing Performed

  • Create habit with all customization options
  • Edit habit (all fields)
  • Check-in (simple and detailed with note/rating/mood)
  • Lives system (skip preserves streak, restore after 7 days)
  • Streak calculation for all frequency types
  • UI responsive on mobile and desktop
  • Integration test suite (9 E2E tests)
  • No console errors

Bug Fixes

  • Fixed streak calculation in habits_helpers.py: skips now correctly maintain streak without extending it (only 'check' type completions count toward total)

PRD: ~/clawd/tasks/prd-habit-tracker.md
Stories: US-001 through US-015

## Overview Complete implementation of Habit Tracker feature for Echo Dashboard with full customization options, lives system, and comprehensive testing. ## Changes Implemented ### Backend (8 API endpoints) - GET /api/habits with stats (streak, best, completion_rate, weekly_summary) - POST /api/habits (create with all customization options) - PUT /api/habits/{id} (edit all fields) - DELETE /api/habits/{id} - POST /api/habits/{id}/check (check-in with optional note/rating/mood) - POST /api/habits/{id}/skip (skip with lives system) - POST /api/habits/{id}/restore-life (restore after 7 consecutive check-ins) - Helper functions: calculate_streak, should_check_today, get_completion_rate, get_weekly_summary ### Frontend - Responsive card-based layout (1/2/3 columns) - Complete create/edit modals with all customization options: - Frequency types: daily, specific_days, x_per_week, weekly, monthly, custom - Category, color, icon picker, priority, notes, reminder time - Check-in interactions (simple click + long-press for detailed entry) - Lives system display (❤️ hearts) and skip functionality - Streak display (🔥 current + 🏆 best) - Filter & sort by category, status, priority, name, streak - Stats section with weekly summary bar chart - Mobile-responsive with touch optimization (44px+ buttons) ### Key Features - **Lives System**: Duolingo-style 3 lives max, skip uses 1 life to maintain streak - **Streak Calculation**: Fixed bug where skips were incorrectly extending streaks - skips now maintain but don't count toward total - **Frequency Support**: All 6 frequency types with custom day selection - **Customization**: Icon picker (Lucide icons), color picker, categories, priorities - **Data Structure**: habits.json schema with completions history ### Testing - 9 end-to-end integration tests covering all workflows - All tests passing in dashboard/tests/ - Coverage: API endpoints, UI components, integration flows ### Integration - Navigation link added to index.html - API paths use /echo/ prefix - Toast notifications for user feedback - Common.css for consistent styling ## Testing Performed - ✅ Create habit with all customization options - ✅ Edit habit (all fields) - ✅ Check-in (simple and detailed with note/rating/mood) - ✅ Lives system (skip preserves streak, restore after 7 days) - ✅ Streak calculation for all frequency types - ✅ UI responsive on mobile and desktop - ✅ Integration test suite (9 E2E tests) - ✅ No console errors ## Bug Fixes - Fixed streak calculation in habits_helpers.py: skips now correctly maintain streak without extending it (only 'check' type completions count toward total) ## Related PRD: ~/clawd/tasks/prd-habit-tracker.md Stories: US-001 through US-015
Marius added 15 commits 2026-02-10 17:51:13 +00:00
Marius added 9 commits 2026-02-10 21:02:37 +00:00
Marius added 6 commits 2026-02-11 07:37:16 +00:00
This pull request has changes conflicting with the target branch.
  • .gitignore
  • dashboard/api.py
  • dashboard/archive/tasks-2026-02.json
  • dashboard/habits.html
  • dashboard/habits.json
  • dashboard/habits_helpers.py
  • dashboard/swipe-nav.js
  • dashboard/tasks.json
  • dashboard/tests/test_habits_helpers.py
  • dashboard/todos.json
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/habit-tracker:feature/habit-tracker
git checkout feature/habit-tracker
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: romfast/clawd#2
No description provided.