diff --git a/app.js b/app.js index 3371d20..299fa0e 100644 --- a/app.js +++ b/app.js @@ -1297,25 +1297,17 @@ function renderSetSummary(s, a) { const byEx = {}; for (const e of s.entries || []) (byEx[e.exercise] = byEx[e.exercise] || []).push(e); for (const exKey of Object.keys(byEx)) { - const li = el("li", "hist-entry"); const sorted = byEx[exKey].sort((x, y) => x.sort - y.sort) - .filter(e => e.weight || e.reps); + .filter(e => e.done); if (!sorted.length) continue; - li.appendChild(el("span", "ex-name", exKey + ": ")); + const li = el("li", "hist-entry"); + const name = exKey.includes("/") + ? exKey.split("/").slice(1).join("/") : exKey; + li.appendChild(el("span", "ex-name", name + ": ")); const setsWrap = el("span", "hist-sets"); - sorted.forEach((e, idx) => { - const w = e.weight || t("empty_label"); - const r = e.reps || t("empty_label"); - const span = el("span", "hist-set"); - span.appendChild(el("span", e.done ? "set-done-box" : "set-undone-box", - e.done ? "✓" : "□")); - span.appendChild(document.createTextNode( - w + " " + unit + " × " + r + " " + repsUnit)); - setsWrap.appendChild(span); - if (idx < sorted.length - 1) { - setsWrap.appendChild(document.createTextNode(" · ")); - } - }); + setsWrap.textContent = sorted.map(e => + (e.weight || t("empty_label")) + " " + unit + " × " + + (e.reps || t("empty_label")) + " " + repsUnit).join(" · "); li.appendChild(setsWrap); ul.appendChild(li); } diff --git a/assets/screenshot.png b/assets/screenshot.png index cd4dc2f..a584481 100644 Binary files a/assets/screenshot.png and b/assets/screenshot.png differ diff --git a/tests/test_ui.js b/tests/test_ui.js index 6781e4e..4c9f0e6 100644 --- a/tests/test_ui.js +++ b/tests/test_ui.js @@ -169,9 +169,9 @@ async function main() { window.document.querySelector('.tab[data-view="history"]').click(); await waitFor(dom, d => d.window.document.querySelectorAll(".hist-card").length === 1); const histCard = () => window.document.querySelector(".hist-card"); - check("Verlauf: Haken-Box zeigt Abhak-Status", - !!histCard().querySelector(".set-done-box") - && histCard().querySelector(".set-done-box").textContent === "✓"); + check("Verlauf: nur abgehakte Saetze, kompakt", + !histCard().querySelector(".set-done-box") + && !histCard().querySelector(".hist-sets").textContent.includes("□")); check("Verlauf: Abgehaktes Set mit Gewicht", await waitFor(dom, d => d.window.document.querySelector(".hist-sets").textContent.includes("18,5")));