From 7ef6b6f9ee7c04f81d98c3d2632ec5d86e82da4c Mon Sep 17 00:00:00 2001 From: infinicaretech Date: Thu, 2 Apr 2026 15:49:35 +0000 Subject: [PATCH] fix: prevent form reset on error, add multi-select for goal/activity/injury - Remove profileNextStep(1) from saveProfile catch block so users stay on current step when an error occurs instead of being sent back to step 1 - Convert Goal, Activity Level, and Injury Area fields from single-select (radio/dropdown) to multi-select checkboxes with comma-separated storage - Add validateMultiEnum backend validation for comma-separated enum values - Update trainer.js filterByInjury and goal checks for multi-value support - Update dietitian.js TDEE, calorie, and water calculations for multi-values Co-Authored-By: Claude Opus 4.6 (1M context) --- src/public/index.html | 77 +++++++++++++++++++++++---------------- src/routes/profile.js | 17 +++++++-- src/services/dietitian.js | 40 ++++++++++---------- src/services/trainer.js | 22 +++++++---- 4 files changed, 94 insertions(+), 62 deletions(-) diff --git a/src/public/index.html b/src/public/index.html index 578fd6a..f4cd5f1 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -232,6 +232,11 @@ color: var(--gray); display: block; } + .hint { + font-size: 0.8rem; + color: var(--gray); + font-weight: 400; + } /* Checkbox group */ .checkbox-group { @@ -1159,47 +1164,47 @@