Statistics

{#each [["today", "Today"], ["weekly", "Weekly"], ["monthly", "Monthly"]] as [tab, label]} {/each}
{#if activeTab === "today"}

Today

{stats?.todayCompleted ?? 0}
Breaks taken
{compliancePercent}%
Compliance
{breakTimeFormatted()}
Break time
{stats?.todaySkipped ?? 0}
Skipped
{#if $config.daily_goal_enabled}

Daily Goal

{goalPercent}%
{stats?.dailyGoalProgress ?? 0} / {$config.daily_goal_breaks} breaks
{stats?.dailyGoalMet ? "Goal reached!" : `${$config.daily_goal_breaks - (stats?.dailyGoalProgress ?? 0)} more to go`}
{/if}

Streak

Current streak
Consecutive days with breaks
{stats?.currentStreak ?? 0}
Best streak
All-time record
{stats?.bestStreak ?? 0}
{#if nextMilestone()}
Next milestone
{nextMilestone()} day streak
{nextMilestone()! - (stats?.currentStreak ?? 0)} days away
{/if}

Last 7 Days

{#if history.length > 0} {#each history as day} {/each}
Break history for the last {history.length} days
DateCompletedSkipped
{day.date} {day.breaksCompleted} {day.breaksSkipped}
{/if}
Completed
Skipped
{:else if activeTab === "weekly"}
{#each weeklySummaries as week, i} {@const prevWeek = weeklySummaries[i + 1]} {@const trend = prevWeek ? week.complianceRate - prevWeek.complianceRate : 0}

Week of {week.weekStart}

{week.totalCompleted}
Completed
{week.totalSkipped}
Skipped
{Math.round(week.complianceRate * 100)}%
Compliance
Avg {week.avgDailyCompleted.toFixed(1)} breaks/day {#if prevWeek} {#if trend > 0} {:else if trend < 0} {:else} {/if} {Math.abs(Math.round(trend * 100))}% {/if}
{/each}
{:else}

Last 30 Days

{#if monthHistory.length > 0} {#each monthHistory as day} {/each}
Break history for the last {monthHistory.length} days
DateCompletedSkipped
{day.date}{day.breaksCompleted}{day.breaksSkipped}
{/if}
Completed
Skipped

Activity Heatmap

{#if monthHistory.length > 0} {#each monthHistory as day} {/each}
Activity heatmap for the last {monthHistory.length} days
DateBreaks completed
{day.date}{day.breaksCompleted}
{/if}
Less
More

Monthly Summary

{monthTotalCompleted}
Total breaks
{monthAvgCompliance()}%
Avg compliance
{Math.floor(monthTotalTime / 60)} min
Total break time
{(monthTotalCompleted / 30).toFixed(1)}
Avg daily breaks
{/if}