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
+14 -1
View File
@@ -3,6 +3,8 @@
// jour tirée du planning, les séances, le cardio, les repères et la grille des
// autres écrans.
import { pendingOneOffs, rotationSessions } from "../../domain/program.js";
import { formatLabel } from "../../domain/wod.js";
import { h, paintWhenIdle, setAccent } from "../dom.js";
import { inkOn, sessionColor } from "../color.js";
import { longDay, plural, shortDay } from "../format.js";
@@ -71,6 +73,7 @@ function homeContent(store, nav, today, synced) {
if (!hasProgram(state)) return onboarding({ store });
const program = /** @type {import("../../domain/program.js").Program} */ (state.program);
const oneOffs = pendingOneOffs(program, state.sessions);
const model = todayModel(state, today);
const last = lastDoneByKey(state);
/** @type {Node|null} */
@@ -161,8 +164,18 @@ function homeContent(store, nav, today, synced) {
h("header", { class: "visually-hidden" }, h("h1", null, program.name)),
todayBlock,
oneOffs.length > 0 && [
h("h2", { class: "tape" }, "WOD proposé", h("span", { class: "tape__hint" }, "hors rotation")),
h("ul", { class: "rows" }, oneOffs.map((s) =>
h("li", null, h("a", { class: "row", href: href.session(s.key) },
plaque("W", s.color),
h("span", { class: "row__main" },
h("span", { class: "row__title" }, s.name),
h("span", { class: "row__meta" }, `${s.format ? formatLabel(s.format) + " · " : ""}${estimatedMinutes(s)} min · une fois, quand tu veux`)),
h("span", { class: "chevron", "aria-hidden": "true" })))))],
h("h2", { class: "tape" }, "Séances"),
h("ul", { class: "rows" }, program.sessions.map((s) =>
h("ul", { class: "rows" }, rotationSessions(program).map((s) =>
h("li", null, h("a", { class: "row", href: href.session(s.key) },
plaque(s.key, s.color),
h("span", { class: "row__main" },