Décharge conseillée et progression par série (5d) ; journal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
74bd0851cb
commit
d0aff18d8e
+23
-2
@@ -12,7 +12,7 @@ import { resolveExercise, trackingFor } from "../domain/program.js";
|
||||
import { EFFORT_LABELS, TRACKING_LABELS } from "./labels.js";
|
||||
import { kg, parseAmount, restLabel } from "./format.js";
|
||||
import { chronoSteps, doneCount, draftExercise, markSet, perSetLoad, proposedReps, setLoadAt, setPerSetLoad, targetLabel, targetReps, topLoad, usesLoad, usesTime, workingLoadData } from "./session-draft.js";
|
||||
import { progressionAdvice } from "../domain/progression.js";
|
||||
import { perSetAdvice, progressionAdvice } from "../domain/progression.js";
|
||||
|
||||
/**
|
||||
* @typedef {object} ExerciseCardOptions
|
||||
@@ -71,6 +71,8 @@ export function exerciseCard(o) {
|
||||
};
|
||||
/** Garde les charges par série pour la fois suivante (WorkingLoadSet). */
|
||||
const saveLoads = () => {
|
||||
// Décharge : les charges allégées ne remplacent pas les charges de travail.
|
||||
if (ex.deload) return;
|
||||
const data = workingLoadData(ex);
|
||||
const saved = store.getState().workingLoads[ex.key];
|
||||
if (saved?.loadKg !== data.loadKg || JSON.stringify(saved?.setsKg ?? null) !== JSON.stringify(data.setsKg ?? null))
|
||||
@@ -234,6 +236,7 @@ export function exerciseCard(o) {
|
||||
input.addEventListener("change", () => {
|
||||
const v = parseAmount(input.value);
|
||||
if (v === undefined || (field === "seconds" && !v)) return;
|
||||
if (ex.deload && isLoad) return;
|
||||
const saved = store.getState().workingLoads[ex.key]?.[field] ?? null;
|
||||
if (saved !== v) store.dispatch("WorkingLoadSet", isLoad ? { key: ex.key, loadKg: v } : { key: ex.key, seconds: v });
|
||||
});
|
||||
@@ -300,7 +303,24 @@ export function exerciseCard(o) {
|
||||
// ---- conseil de progression (double progression) ------------------------------
|
||||
const advice = h("div", { class: "advice", hidden: true });
|
||||
const paintAdvice = () => {
|
||||
const a = usesLoad(ex.tracking) ? progressionAdvice(store.getState(), o.sessionKey, item) : null;
|
||||
// Charge par série : +2,5 kg sur chaque série (lot 5d).
|
||||
const ramp = perSetLoad(ex) && !ex.deload ? perSetAdvice(store.getState(), o.sessionKey, item) : null;
|
||||
if (ramp && JSON.stringify(workingLoadData(ex).setsKg) !== JSON.stringify(ramp.setsKg)) {
|
||||
advice.hidden = false;
|
||||
replace(advice,
|
||||
h("p", { class: "advice__head" }, h("span", { class: "mark" }, "Prêt à monter"), h("span", { class: "num advice__kg" }, `${ramp.setsKg.map(kg).join(" → ")} kg`)),
|
||||
h("p", { class: "muted" }, `Dernière fois : ${ramp.reason}.`),
|
||||
h("button", { type: "button", class: "btn btn--primary btn--block", on: { click: () => {
|
||||
ex.setLoads = [...ramp.setsKg];
|
||||
ex.loadKg = topLoad(ex);
|
||||
saveLoads();
|
||||
advice.hidden = true;
|
||||
drawWork();
|
||||
changed();
|
||||
} } }, "Adopter +2,5 kg par série"));
|
||||
return;
|
||||
}
|
||||
const a = usesLoad(ex.tracking) && !perSetLoad(ex) ? progressionAdvice(store.getState(), o.sessionKey, item) : null;
|
||||
if (!a || ex.loadKg === a.newLoadKg) {
|
||||
advice.hidden = true;
|
||||
return;
|
||||
@@ -334,6 +354,7 @@ export function exerciseCard(o) {
|
||||
count,
|
||||
h("span", { class: "chevron", "aria-hidden": "true" })),
|
||||
h("div", { class: "exercise__body" },
|
||||
ex.deload && h("p", { class: "coach-note coach-note--plain deload-note" }, "Semaine de décharge : charge baissée de 10 %, et une série de moins à partir de trois. Tes charges de travail restent les mêmes."),
|
||||
resolved.note && h("p", { class: "coach-note" }, resolved.note),
|
||||
muscles,
|
||||
resolved.cues.length > 0 && [h("h3", { class: "mini-label" }, "Le geste"),
|
||||
|
||||
Reference in New Issue
Block a user