WOD ponctuel proposé par l'IA et records par WOD (lot 4c)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 15:06:39 +01:00
co-authored by Claude Opus 5.5
parent 06bd91d797
commit 7dc106837b
23 changed files with 275 additions and 23 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
// Le planning est calculé (planning.js), jamais stocké : seuls les réglages
// (PlanSettingsChanged) et les faits (SessionLogged, DaySkipped…) sont au journal.
import { rotationSessions } from "../../domain/program.js";
import { h, paintWhenIdle, replace } from "../dom.js";
import { addDays, isoWeek, mondayOf, mondayOfIsoWeek } from "../../domain/dates.js";
import { settingsForWeek } from "../../domain/planning.js";
@@ -93,7 +94,7 @@ export function weekScreen({ store, nav, today, query }) {
const next = selected.has(d) ? [...selected].filter((x) => x !== d) : [...selected, d];
save(withDays(settings, next));
const strength = weekRows(store.getState(), m, today()).plan.slots.filter((s) => s.kind === "strength").length;
const need = program?.sessions.length ?? 0;
const need = rotationSessions(program ?? null).length;
status.textContent = next.length === 0 ? "Aucun jour retenu."
: strength < need ? `${strength} séance${strength > 1 ? "s" : ""} de force sur ${need} : la rotation rattrapera la semaine suivante.`
: `${strength} séances de force, espacées au maximum.`;