Add a Discuss button beside Start on TODO items

This commit is contained in:
Ian Gulliver
2026-10-16 08:53:02 -07:00
parent cac24e534f
commit 2bb7833de3
14 changed files with 227 additions and 205 deletions
+7 -4
View File
@@ -35,12 +35,11 @@ function fill(el, model) {
titleEl.classList.remove("task-name");
const key = `${projectId}\n${title}`;
const busy = starting.has(key);
const button = h("button", { disabled: busy }, busy ? "Starting…" : "Start");
button.onclick = async () => {
const start = async (discuss) => {
starting.add(key);
fill(el, model);
try {
await post("/api/projects/{projectId}/todo/tasks", { path: { projectId }, body: { title, model } });
await post("/api/projects/{projectId}/todo/tasks", { path: { projectId }, body: { title, model, discuss } });
}
catch (err) {
void showAlert(errorText(err));
@@ -48,6 +47,10 @@ function fill(el, model) {
starting.delete(key);
fill(el, model);
};
replace(action, button);
const startButton = h("button", { disabled: busy, title: "Start a task that gets straight to work" }, busy ? "Starting…" : "Start");
startButton.onclick = () => void start(false);
const discussButton = h("button", { disabled: busy, title: "Start a task that talks it through with you before changing anything" }, "Discuss");
discussButton.onclick = () => void start(true);
replace(action, startButton, " ", discussButton);
}
//# sourceMappingURL=todolink.js.map