Skip to content

[REQ-001] Show current streak count and 🔥 badge per habit in the UI #2

@markoub

Description

@markoub

User story

As a user, I want to see my current streak number next to each habit, and a 🔥 badge when I'm on a roll (3+ days), so that I feel rewarded for consistency.

Acceptance criteria

  • Each habit row in src/main.ts displays the current streak count returned by currentStreak(habit, today).
  • When the current streak is ≥ 3, a 🔥 emoji badge is shown alongside the streak count.
  • When the current streak is 0, no streak number or badge is displayed (clean / uncluttered).
  • today is obtained from the existing dayStr() helper — never hardcoded.
  • The streak display updates immediately when the user marks a habit done or undone (i.e. re-renders correctly on each toggle).
  • No new runtime dependencies are introduced.
  • npm test and npm run build both pass.

Definition of done

npm test and npm run build pass; streak display is wired to currentStreak from src/habits.ts; all DOM/rendering changes are confined to src/main.ts.

Depends on: the issue that adds currentStreak to src/habits.ts ([REQ-001] Add currentStreak and bestStreak pure functions with unit tests).

Source: REQ-001 (vault/02 - Requirements/REQ-001 - Streaks and momentum.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentCreated/handled by the autonomous pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions