diff --git a/docs/planning/doris-barbell-v1-plan.md b/docs/planning/doris-barbell-v1-plan.md index 7ea1c7b..40ea330 100644 --- a/docs/planning/doris-barbell-v1-plan.md +++ b/docs/planning/doris-barbell-v1-plan.md @@ -47,8 +47,9 @@ Tech stack: FastAPI, Jinja2, JSON state store for V1 bootstrap, Docker Compose o - Homepage now renders current metrics, recent workouts, exercise bests, and placeholder template/routine scaffolding. - Homepage now renders John's imported five-day split as the default routine board. - Homepage now includes mobile-friendly HTML forms for quick weight entry, body measurements, exercise templates, routine drafts, and quick workout logging. +- Routine log sheets now support dropdown exercise selection with set-by-set rep and weight entry for seeded program days. - Homepage now includes John-focused recent history snapshots so the app is useful before charts exist. -- Tests currently cover health, seeded users, BMI calculation, imperial measurement logging, exercise template creation, routine creation, history ordering, structured workout logging, progression summaries, homepage render, and form-post redirects. +- Tests currently cover health, seeded users, BMI calculation, imperial measurement logging, exercise template creation, routine creation, history ordering, structured workout logging, progression summaries, homepage render, routine log flows, and form-post redirects. ## Next build slices diff --git a/home/doris-barbell/README.md b/home/doris-barbell/README.md index 5b38b59..5df187b 100644 --- a/home/doris-barbell/README.md +++ b/home/doris-barbell/README.md @@ -53,6 +53,7 @@ The current scaffold already supports: - exercise template creation/listing - routine creation/listing on top of John's imported base split - structured workout logging with nested exercises and sets +- dedicated routine log sheets with dropdown exercise selection plus set-by-set reps and weight entry - history endpoints for weight, measurements, and workouts - exercise progression summaries with max weight and estimated 1RM per exercise - mobile-friendly homepage with HTML forms for: diff --git a/home/doris-barbell/app/routes/ui.py b/home/doris-barbell/app/routes/ui.py index 8f2f260..cc1852d 100644 --- a/home/doris-barbell/app/routes/ui.py +++ b/home/doris-barbell/app/routes/ui.py @@ -133,6 +133,7 @@ def routine_log_sheet(request: Request, routine_id: str): 'title': f"Log {routine['name']}", 'routine': routine, 'routine_sheet': _build_routine_log_sheet(routine), + 'exercise_options': _exercise_options_for_routine(request, routine), 'routine_action_label': _routine_action_label(routine['name']), 'default_performed_at': _default_performed_at_value(), }, @@ -285,6 +286,24 @@ def _build_routine_log_sheet(routine: dict) -> list[dict]: return sheet +def _exercise_options_for_routine(request: Request, routine: dict) -> list[str]: + routine_names = [exercise['exercise_name'] for exercise in routine.get('exercises', []) if exercise.get('exercise_name')] + template_names = [ + template['name'] + for template in request.app.state.store.list_exercise_templates() + if template.get('name') + ] + ordered = [] + seen = set() + for name in [*routine_names, *template_names]: + normalized = name.strip().lower() + if normalized in seen: + continue + ordered.append(name) + seen.add(normalized) + return ordered + + def _default_reps_value(target_reps: str | None) -> str: if target_reps is None: return '' diff --git a/home/doris-barbell/app/templates/routine_log.html b/home/doris-barbell/app/templates/routine_log.html index a1e8a11..0886e87 100644 --- a/home/doris-barbell/app/templates/routine_log.html +++ b/home/doris-barbell/app/templates/routine_log.html @@ -52,13 +52,18 @@ {% for exercise in routine_sheet %}
-
{{ exercise.target_sets }} sets
-

{{ exercise.exercise_name }}

+

Target reps: {{ exercise.target_reps or 'enter manually' }}

{% for set in exercise.sets %} diff --git a/home/doris-barbell/tests/test_app.py b/home/doris-barbell/tests/test_app.py index 8b129ba..7392499 100644 --- a/home/doris-barbell/tests/test_app.py +++ b/home/doris-barbell/tests/test_app.py @@ -388,6 +388,9 @@ def test_seeded_routine_can_render_prefilled_log_sheet(tmp_path: Path) -> None: assert 'Thursday: Shoulders' in body assert 'Shoulder Press' in body assert 'Save shoulder day workout' in body + assert 'name="exercise_0_name"' in body + assert '