Skip to content

Latest commit

Β 

History

History
593 lines (378 loc) Β· 6.36 KB

nextphase.md

File metadata and controls

593 lines (378 loc) Β· 6.36 KB

HabitFlow v0.2.0 - Quantified Habits & Progress Tracking

Overview

HabitFlow currently supports binary habit tracking (completed / not completed). The next major milestone introduces Quantified Habits, allowing users to track measurable goals such as reading pages, drinking water, walking steps, coding hours, and more.

This release transforms HabitFlow from a simple streak tracker into a more capable personal progress system while maintaining full backward compatibility with existing user data.


Release Goals

Primary Objective

Support two habit types:

  • Boolean Habits
  • Numeric Habits

Examples:

Habit Type Target
Exercise Boolean Completed
Read Books Numeric 30 Pages
Water Intake Numeric 8 Glasses
Walking Numeric 10,000 Steps
Meditation Numeric 20 Minutes

Epic 1: Database Migration

Goal

Extend the database schema without breaking existing installations.

Tasks

Add Habit Type

New field:

habit_type TEXT NOT NULL DEFAULT 'boolean'

Supported values:

boolean
numeric

Add Numeric Habit Metadata

target_value REAL
unit TEXT

Examples:

8 glasses
30 pages
2 hours
10000 steps

Extend Habit Logs

Current:

habit_logs
β”œβ”€β”€ habit_id
β”œβ”€β”€ date
β”œβ”€β”€ completed

New:

habit_logs
β”œβ”€β”€ habit_id
β”œβ”€β”€ date
β”œβ”€β”€ completed
β”œβ”€β”€ value

Example:

Target: 30 pages
Current: 15 pages
Completed: false

Create Migration

File:

migration_0002_numeric_habits.sql

Requirements:

  • Preserve all habits
  • Preserve all logs
  • Preserve streak history
  • Zero data loss

Epic 2: Domain & Business Logic

Goal

Introduce a unified progress engine.

Tasks

Create HabitType Enum

enum HabitType {
    Boolean,
    Numeric,
}

Progress Service

Create:

src/services/progress_service.rs

Functions:

progress_percent()
remaining_amount()
is_completed()

Completion Rules

Boolean Habit:

checked = completed

Numeric Habit:

value >= target_value

Completion should update automatically.


Streak Engine Compatibility

Verify:

  • Boolean habits
  • Numeric habits
  • Mixed habit collections

Epic 3: Habit Creation Experience

Goal

Allow users to create measurable habits.

Tasks

Update New Habit Modal

Current:

Name
Category
Icon

New:

Name
Category
Icon

Habit Type
β—‹ Boolean
β—‹ Numeric

Numeric Configuration

Visible only when Numeric selected.

Fields:

Target Value
Unit

Example:

Target: 8
Unit: glasses

Validation

Prevent:

  • Empty target
  • Zero target
  • Negative values
  • Invalid numbers
  • Empty units

Epic 4: Today View Redesign

Goal

Support both binary and measurable habits.

Boolean Habits

No UI changes.

Example:

β˜‘ Exercise
πŸ”₯ 12 Day Streak

Numeric Habits

Example:

πŸ’§ Water Intake

6 / 8 glasses

[β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘]
75%

Quick Actions

Add controls:

[-] [+]

Actions:

  • Increment
  • Decrement

Direct Editing

Allow users to edit progress manually.

Example:

15 / 30 pages

Completion Feedback

When target is reached:

  • Animate progress bar
  • Show completion state
  • Trigger success feedback

Epic 5: Statistics Upgrade

Goal

Provide meaningful insights for quantified habits.

New Metrics

Display:

  • Total Units Completed
  • Average Daily Progress
  • Best Performance Day
  • Most Consistent Habit
  • Most Productive Habit

Trend Charts

Show:

Actual Progress
vs
Target Progress

Heatmap Enhancement

Intensity levels:

0%
25%
50%
75%
100%

instead of binary complete/incomplete values.


Epic 6: Weekly Progress Grid

Goal

Improve visualization for numeric habits.

Progress-Based Cells

Current:

β—‹
●

New:

β–‘
β–’
β–“
β–ˆ

based on completion percentage.


Hover Details

Display:

  • Date
  • Progress
  • Current Value
  • Target Value

Epic 7: Import & Export

Goal

Maintain compatibility across versions.

Export Schema Update

Example:

{
  "habit_type": "numeric",
  "target_value": 8,
  "unit": "glasses"
}

Backward Compatibility

Requirements:

  • Import old backups
  • Import new backups
  • Automatic schema detection

Epic 8: Testing

Unit Tests

Progress Engine

Test:

  • 0%
  • 25%
  • 50%
  • 75%
  • 100%
  • Over target

Streak Engine

Verify:

  • Boolean habits
  • Numeric habits
  • Mixed habits

Import / Export

Verify:

  • New schema
  • Legacy schema

Integration Tests

Numeric Habit Creation

Flow:

  1. Create habit
  2. Save
  3. Restart application
  4. Verify persistence

Progress Tracking

Flow:

  1. Increment progress
  2. Reach target
  3. Verify completion
  4. Verify streak update

Migration Testing

Flow:

  1. Open v0.1 database
  2. Run migration
  3. Verify all data preserved

Epic 9: UI Polish

Empty States

Create screens for:

  • No habits
  • No numeric habits
  • No statistics available

Tooltips

Show:

  • Current Progress
  • Remaining Amount
  • Target Value

Accessibility

Verify:

  • Keyboard navigation
  • Focus indicators
  • Screen reader labels

Theme Compatibility

Test all existing themes.

Current count:

22 Themes

Definition of Done

Functional

  • Numeric habits fully supported
  • Boolean habits remain unchanged
  • Progress tracking operational
  • Automatic completion logic working
  • Statistics updated
  • Weekly grid updated

Reliability

  • Existing databases migrate successfully
  • Import/export compatibility maintained
  • No streak corruption
  • No data loss

Release

  • Production build passes
  • Windows installer builds successfully
  • MSI upgrade path verified
  • Release notes prepared

Estimated Version Outcome

HabitFlow v0.2.0 will introduce measurable habit tracking and progress visualization, forming the foundation for future features such as:

  • Habit reminders
  • Achievements
  • Monthly calendar view
  • Advanced analytics
  • Cloud synchronization

This release should be considered the first major functional expansion beyond simple streak tracking.