app: todos can be marked started (◐ in progress) without checking off — v0.3.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bonna
2026-08-07 13:02:43 -05:00
parent 8da8272ad1
commit 3269032525
6 changed files with 11 additions and 3 deletions

View File

@@ -67,9 +67,11 @@ document.addEventListener("keydown", (e) => {
// ── Today ────────────────────────────────────────────────────────
function todoRow(t, sub) {
const going = t.started && !t.done;
return `<div class="todo" ${sub ? 'style="margin-left:26px"' : ""}>
<input type="checkbox" data-t="${t.id}" ${t.done ? "checked" : ""}>
<span class="${t.done ? "done" : ""}" style="flex:1">${sub ? "↳ " : ""}${esc(t.text)}</span>
<span class="${t.done ? "done" : going ? "started" : ""}" style="flex:1">${sub ? "↳ " : ""}${esc(t.text)}${going ? ` <span class="pill butter">◐ in progress</span>` : ""}</span>
${t.done ? "" : `<button class="startbtn${going ? " on" : ""}" data-start="${t.id}" title="${going ? "not started after all" : "mark as started"}">◐</button>`}
${sub ? "" : `<button class="chip" data-sub="${t.id}" title="add subtask"></button>`}</div>
${sub ? "" : `<div class="subform" data-subform="${t.id}" hidden style="margin:2px 0 6px 26px">
<input type="text" placeholder="subtask… ⇧Enter = another · Enter = new task · ⌫ empty = undo · Esc" style="width:88%;padding:7px 12px;font-size:13.5px"></div>`}`;
@@ -138,6 +140,7 @@ async function today() {
}
}));
view.querySelectorAll("[data-t]").forEach((c) => c.addEventListener("change", async () => { await api("/api/todos/toggle", { id: Number(c.dataset.t) }); today(); }));
view.querySelectorAll("[data-start]").forEach((b) => b.addEventListener("click", async () => { await api("/api/todos/start", { id: Number(b.dataset.start) }); today(); }));
view.querySelectorAll("[data-s]").forEach((c) => c.addEventListener("change", async () => { await api("/api/shopping/toggle", { id: Number(c.dataset.s) }); today(); }));
$("#goto-firing")?.addEventListener("click", () => $('#nav button[data-v="firings"]').click());
}