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
+10 -1
View File
@@ -4,7 +4,8 @@
import { h } from "../dom.js";
import { addDays, daysBetween, mondayOf } from "../../domain/dates.js";
import { attendance, exerciseHistory } from "../../domain/analysis.js";
import { attendance, exerciseHistory, wodRecords } from "../../domain/analysis.js";
import { formatLabel, scoreLabel } from "../../domain/wod.js";
import { dec1, kg, mediumDay, plural, shortDay } from "../format.js";
import { screenHeader } from "../layout.js";
import { href } from "../router.js";
@@ -50,6 +51,7 @@ function overview({ store, nav, today }) {
const from = addDays(mondayOf(to), -7 * (ATTENDANCE_WEEKS - 1));
const { weeks, totals } = attendance(state, from, to);
const list = exercisesDone(state);
const wods = wodRecords(state);
const node = h("div", { class: "screen" },
screenHeader({ back: { label: "Accueil", onClick: () => nav.back(href.home()) }, kicker: "Ton parcours", title: "Analyses" }),
h("h2", { class: "tape" }, "Assiduité", h("span", { class: "tape__hint" }, `${ATTENDANCE_WEEKS} semaines`)),
@@ -65,6 +67,13 @@ function overview({ store, nav, today }) {
labels: [shortDay(weeks[0].monday), "cette semaine"],
}),
h("figcaption", { class: "chart__caption" }, "Séances par semaine, toutes natures. En couleur : la semaine en cours.")),
wods.length > 0 && [
h("h2", { class: "tape" }, "WOD", h("span", { class: "tape__hint" }, "record")),
h("ul", { class: "rows" }, wods.map((w) => h("li", { class: "row" },
h("span", { class: "row__main" },
h("span", { class: "row__title" }, `${w.name} · ${formatLabel(w.format)}`),
h("span", { class: "row__meta" }, `Record ${scoreLabel(w.best.result)} le ${shortDay(w.best.date)} · ${w.results.length} fois`
+ (w.results.length > 1 ? ` · dernière : ${scoreLabel(w.results[w.results.length - 1].result)}` : ""))))))],
h("h2", { class: "tape" }, "Par exercice"),
list.length
? h("ul", { class: "rows" }, list.map((x) => h("li", null, h("a", { class: "row", href: href.analysis(x.id) },