feat(chart): рабочий максимум «вес × повторы» с зелёным прогрессом и красным откатом

This commit is contained in:
Иван Овчинников
2026-11-20 07:35:11 +03:00
parent 35fabb1610
commit 4da4fd9365
5 changed files with 129 additions and 82 deletions
+6 -1
View File
@@ -180,8 +180,13 @@ export function getExerciseChart(exerciseName, clientId = null) {
totalReps += rps;
}
}
// повторы, взятые на максимальном весе — по ним видно прогресс при том же весе
let topReps = 0;
for (const st of sets) {
if (st.weight === maxWeight && st.reps > topReps) topReps = st.reps;
}
if (maxWeight > 0 || totalReps > 0) {
points.push({ date: w.startTime, name: ex.name, maxWeight, totalReps, sets });
points.push({ date: w.startTime, name: ex.name, maxWeight, topReps, totalReps, sets });
}
}
}