Skip to content

Commit b786915

Browse files
Adjust reps dropdown range in workout session logger (#115)
## Summary - Updated the workout session logger’s repOptions logic so non-AMRAP rep dropdowns now always start at 0 instead of min_reps. - Updated the dropdown upper bound to end at max_reps + 3, with a fallback to min_reps + 3 when max_reps is unavailable (and 0 + 3 if neither is finite). - This now produces the requested behavior (e.g., a 6–8 rep range yields options 0 through 11). ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69944ec8ca3883259a68d5f2c3261183)
1 parent 2e802aa commit b786915

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

workout-session-logger.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,10 @@ <h2 style="margin: 0;">Workout tools</h2>
362362
function repOptions(block) {
363363
if (block.amrap) return [];
364364
const options = [];
365-
const min = Number(block.min_reps) || 1;
366-
const max = Number(block.max_reps) || min;
367-
for (let i = min; i <= max; i += 1) {
365+
const maxReps = Number(block.max_reps);
366+
const fallbackMax = Number(block.min_reps);
367+
const rangeEnd = (Number.isFinite(maxReps) ? maxReps : (Number.isFinite(fallbackMax) ? fallbackMax : 0)) + 3;
368+
for (let i = 0; i <= rangeEnd; i += 1) {
368369
options.push(i);
369370
}
370371
return options;

0 commit comments

Comments
 (0)