feat: auto-populate suggested reps and weight in log form
Pre-fill the reps and weight inputs with progression engine suggestions so users can log sets without manually retyping values each time. Suggestions flow through the template chain on initial page load and on all HTMX partial responses (log, edit, delete).
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
<!-- Inline logging (Phase 4) -->
|
||||
{% if active_profile %}
|
||||
<div id="logs-exercise-{{ exercise.id }}">
|
||||
{% if suggestions and suggestions[exercise.id] %}
|
||||
{% set suggested_reps = suggestions[exercise.id].suggested_reps %}
|
||||
{% set suggested_weight = suggestions[exercise.id].suggested_weight %}
|
||||
{% endif %}
|
||||
{% if existing_logs and existing_logs[exercise.id] %}
|
||||
{% set logs = existing_logs[exercise.id] %}
|
||||
{% set exercise_id = exercise.id %}
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
<small style="white-space:nowrap; opacity:0.7;">Set {{ next_set|default(1) }}</small>
|
||||
<input type="number" name="reps" placeholder="Reps"
|
||||
min="0" max="100" required
|
||||
{% if suggested_reps %}value="{{ suggested_reps }}"{% endif %}
|
||||
style="width:5rem; margin-bottom:0;">
|
||||
<input type="text" name="weight" placeholder="Weight (lbs)"
|
||||
required
|
||||
{% if suggested_weight %}value="{{ suggested_weight }}"{% 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;">
|
||||
|
||||
Reference in New Issue
Block a user