Skip to content

Commit 46d85b5

Browse files
Allow decimal weights and remove last-session set chip (#119)
### Motivation - Allow users to enter free-form decimal weights in the session logger and remove the small per-exercise "last session" label showing previous weight/reps to simplify the UI and avoid redundancy. ### Description - Change the weight input `step` from `0.5` to `any` so decimal values of any precision are accepted (`weightInput.step = 'any'`). - Remove the `renderPreviousChip` function and the code that appended the per-exercise `Last: … kg · … reps` chip from `renderExercise` to drop the small last-session label. - Keep existing behaviour that still reads previous-set values for pre-filling inputs when available. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69bd13651728832580bee57c0d9205d3)
1 parent 3e27b7c commit 46d85b5

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

workout-session-logger.html

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -371,17 +371,6 @@ <h2 style="margin: 0;">Workout tools</h2>
371371
return state.latestSession.exercise_blocks.find((ex) => ex.exercise_name === exerciseName) || null;
372372
}
373373

374-
function renderPreviousChip(block) {
375-
const prev = findPreviousExercise(block.exercise_name);
376-
if (!prev) return null;
377-
const firstCompleted = prev.sets.find((set) => Number.isFinite(set.weight) || Number.isFinite(set.reps));
378-
if (!firstCompleted) return null;
379-
const chip = document.createElement('span');
380-
chip.className = 'chip';
381-
chip.textContent = `Last: ${firstCompleted.weight ?? '—'} kg · ${firstCompleted.reps ?? '—'} reps`;
382-
return chip;
383-
}
384-
385374
function createRepsInput(exerciseName, setIndex, initialValue, placeholder = 'Reps') {
386375
const input = document.createElement('input');
387376
input.type = 'number';
@@ -421,7 +410,7 @@ <h2 style="margin: 0;">Workout tools</h2>
421410
const weightInput = document.createElement('input');
422411
weightInput.type = 'number';
423412
weightInput.inputMode = 'decimal';
424-
weightInput.step = '0.5';
413+
weightInput.step = 'any';
425414
weightInput.placeholder = 'Weight';
426415
weightInput.dataset.exerciseName = exerciseName;
427416
weightInput.dataset.setIndex = setIndex;
@@ -477,8 +466,6 @@ <h2 style="margin: 0;">Workout tools</h2>
477466
? 'AMRAP'
478467
: `${block.min_reps ?? 0}${block.max_reps ?? 0} reps`;
479468

480-
const previousChip = renderPreviousChip(block);
481-
482469
const body = document.createElement('div');
483470
body.className = 'exercise-body';
484471

@@ -496,10 +483,6 @@ <h2 style="margin: 0;">Workout tools</h2>
496483
infoRow.appendChild(notesMeta);
497484
infoRow.appendChild(repRangeMeta);
498485

499-
if (previousChip) {
500-
infoRow.appendChild(previousChip);
501-
}
502-
503486
const setsGrid = document.createElement('div');
504487
setsGrid.className = 'stack';
505488

0 commit comments

Comments
 (0)