feat: replace wk1/wk4 targets with 6→8→10→12 rep ladder progression

Simplifies the progression model to a universal rep ladder: every exercise
follows 6→8→10→12 reps at current weight, then +5 lbs and reset to 6.
Replaces per-user wk1/wk4 rep and weight targets with a single
starting_weight field.

- Add Alembic migration to drop wk1_reps/wk4_reps/wk1_weight/wk4_weight,
  add starting_weight (migrated from wk1_weight)
- Run Alembic migrations on app startup instead of create_all, with
  auto-detection and stamping for legacy databases
- Include alembic/ and alembic.ini in Docker image
- Rewrite progression_service.get_suggestion() with ladder logic:
  climb, hold, weight_increase, hold_at_top, deload
- Replace wk1/wk4 grid in exercise cards with rep ladder progress bar
- Add color-coded progression badges by type
- Change weight log input from text to number with pre-filled suggestion
- Normalize weight input in routes (0→BW, bare number→N lbs)
- Remove schedule page (route, template, nav link, tests)
- Simplify user_programs.yaml from 4 fields to 1 per exercise
- Update all tests for new schema and progression logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 13:57:02 -05:00
parent 69b3357800
commit 52e48f8ed4
19 changed files with 410 additions and 494 deletions

View File

@@ -7,16 +7,26 @@
</header>
{% if program %}
<div class="grid">
<div>
<small>Week 1</small>
<p>{{ program.wk1_reps }} reps @ {{ program.wk1_weight }}</p>
</div>
<div>
<small>Week 4</small>
<p>{{ program.wk4_reps }} reps @ {{ program.wk4_weight }}</p>
{% set suggestion = suggestions[exercise.id] if suggestions and exercise.id in suggestions else None %}
{% set pos = suggestion.ladder_position if suggestion and suggestion.ladder_position is defined else -1 %}
{% if pos >= 0 %}
<div style="display: flex; gap: 0.25rem; align-items: center; margin-bottom: 0.75rem;">
{% for step in [6, 8, 10, 12] %}
<div style="flex: 1; text-align: center; padding: 0.35rem 0;
border-radius: 0.25rem; font-size: 0.85rem; font-weight: 600;
{% if loop.index0 <= pos %}
background: var(--pico-primary); color: var(--pico-primary-inverse);
{% else %}
background: var(--pico-muted-border-color); color: var(--pico-muted-color);
{% endif %}">
{{ step }}
</div>
{% endfor %}
<small style="margin-left: 0.5rem; white-space: nowrap;">@ {{ suggestion.suggested_weight }}</small>
</div>
{% else %}
<p><small>Starting weight: {{ program.starting_weight }}</small></p>
{% endif %}
{% endif %}
{% if suggestions and suggestions[exercise.id] %}

View File

@@ -12,8 +12,13 @@
<input type="number" name="reps" placeholder="Reps"
min="0" max="100" required
style="width:5rem; margin-bottom:0;">
<input type="text" name="weight" placeholder="Weight (lbs)"
required
<input type="number" name="weight" placeholder="Weight (lbs)"
min="0" max="999" step="0.5" required
{% if suggested_weight and suggested_weight != "BW" %}
value="{{ suggested_weight|replace(' lbs', '') }}"
{% elif suggested_weight == "BW" %}
value="0"
{% endif %}
style="width:8rem; margin-bottom:0;">
<label style="display:flex; align-items:center; gap:0.3rem; margin-bottom:0; white-space:nowrap;">
<input type="checkbox" name="felt_easy" role="switch" style="margin-bottom:0;">

View File

@@ -26,7 +26,6 @@
</li>
<li><a href="/">Home</a></li>
<li><a href="/workouts">Workouts</a></li>
<li><a href="/schedule">Schedule</a></li>
<li><a href="/dashboard">Dashboard</a></li>
<li><a href="/history">History</a></li>
<li><a href="/exercises">Exercises</a></li>

View File

@@ -1,6 +1,15 @@
{% if suggestion and suggestion.progression_type != "no_program" %}
{% set badge_colors = {
"deload": "var(--pico-del-color)",
"weight_increase": "var(--pico-ins-color)",
"climb": "var(--pico-primary)",
"hold": "var(--pico-muted-color)",
"hold_at_top": "var(--pico-muted-color)",
"baseline": "var(--pico-primary)",
} %}
{% set border_color = badge_colors.get(suggestion.progression_type, "var(--pico-primary)") %}
<div style="background: rgba(99, 102, 241, 0.1);
border-left: 3px solid var(--pico-primary);
border-left: 3px solid {{ border_color }};
padding: 0.5rem 1rem;
margin-bottom: 0.5rem;
border-radius: 0 0.25rem 0.25rem 0;">