add habit goal-period difficulty and habit formation research notes
Ground the 21-day habit myth in actual research (Lally et al. 2010) and let users pick a target period (21/66/254 days or unlimited) matching that study's easy/median/hard automaticity timelines when creating a habit, with progress shown on the habits list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
x-data="{
|
||||
editing: false,
|
||||
mask: {{ habit.weekdays_mask }},
|
||||
difficulty: '{{ habit.difficulty.value }}',
|
||||
alarmOn: {{ 'true' if habit.reminder_time else 'false' }},
|
||||
days: ['월', '화', '수', '목', '금', '토', '일'],
|
||||
}"
|
||||
@@ -17,6 +18,14 @@
|
||||
{{ weekday_label(habit.weekdays_mask) }}
|
||||
{% if habit.reminder_time %}· 알람 {{ habit.reminder_time.strftime("%H:%M") }}{% endif %}
|
||||
</div>
|
||||
{% set progress = goal_progress(habit) %}
|
||||
<div class="goal-progress-badge">
|
||||
{% if progress %}
|
||||
목표 {{ difficulty_label(habit.difficulty) }} · {{ progress.elapsed }}/{{ progress.target }}일차{% if progress.reached %} · 목표 기간 달성!{% else %} (D-{{ progress.remaining }}){% endif %}
|
||||
{% else %}
|
||||
{{ difficulty_label(habit.difficulty) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% set stats = stats_map[habit.id] %}
|
||||
{% if stats.scheduled_days > 0 %}
|
||||
<div class="habit-item-stats">
|
||||
@@ -78,6 +87,7 @@
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
<input type="hidden" name="weekdays_mask" :value="mask" />
|
||||
<input type="hidden" name="difficulty" :value="difficulty" />
|
||||
|
||||
<div class="field">
|
||||
<label for="edit-name-{{ habit.id }}">습관 이름</label>
|
||||
|
||||
Reference in New Issue
Block a user