generated from coulomb/repo-seed
feat(tasks): adopt canonical task statuses
This commit is contained in:
@@ -141,11 +141,14 @@ const _STATUS_STYLE = {
|
||||
archived: "background:#e2e3e5;color:#383d41",
|
||||
open: "background:#dbeafe;color:#1e40af",
|
||||
in_progress: "background:#fef3c7;color:#92400e",
|
||||
wait: "background:#fef3c7;color:#92400e",
|
||||
progress: "background:#ede9fe;color:#5b21b6",
|
||||
addressed: "background:#dcfce7;color:#166534",
|
||||
deferred: "background:#f1f5f9;color:#64748b",
|
||||
wont_fix: "background:#f3f4f6;color:#9ca3af",
|
||||
todo: "background:#f1f5f9;color:#475569",
|
||||
done: "background:#dcfce7;color:#166534",
|
||||
cancel: "background:#f3f4f6;color:#9ca3af",
|
||||
cancelled: "background:#f3f4f6;color:#9ca3af",
|
||||
resolved: "background:#dcfce7;color:#166534",
|
||||
superseded: "background:#e2e3e5;color:#383d41",
|
||||
@@ -226,8 +229,8 @@ function _buildBody(entity, type) {
|
||||
if (entity.tasks_total !== undefined) {
|
||||
els.push(_divider(),
|
||||
tf("Tasks", `${entity.tasks_done ?? 0} done / ${entity.tasks_total} total` +
|
||||
(entity.tasks_in_progress > 0 ? ` · ${entity.tasks_in_progress} in progress` : "") +
|
||||
(entity.tasks_blocked > 0 ? ` · ${entity.tasks_blocked} blocked` : ""))
|
||||
(entity.tasks_progress > 0 ? ` · ${entity.tasks_progress} progress` : "") +
|
||||
(entity.tasks_wait > 0 ? ` · ${entity.tasks_wait} wait` : ""))
|
||||
);
|
||||
}
|
||||
if (entity.depends_on?.length) {
|
||||
|
||||
@@ -153,7 +153,7 @@ export const FIELD_HELP = {
|
||||
},
|
||||
status: {
|
||||
label: "Status",
|
||||
description: "Current lifecycle state: todo, in_progress, blocked, done, or cancelled.",
|
||||
description: "Current lifecycle state. Tasks use wait, todo, progress, done, or cancel.",
|
||||
doc: "/docs/workstream-lifecycle",
|
||||
},
|
||||
topic_id: {
|
||||
@@ -182,7 +182,7 @@ export const FIELD_HELP = {
|
||||
},
|
||||
needs_human: {
|
||||
label: "Needs Human",
|
||||
description: "True if the task is blocked waiting for human input or approval.",
|
||||
description: "True if the task is waiting for human input or approval.",
|
||||
doc: "/interventions",
|
||||
},
|
||||
intervention_note: {
|
||||
|
||||
@@ -3,7 +3,7 @@ import {WORKSTREAM_STATUSES} from "./workplan-status.js";
|
||||
|
||||
const STYLE_ID = "status-control-styles";
|
||||
|
||||
export const TASK_STATUSES = ["todo", "in_progress", "blocked", "done", "cancelled"];
|
||||
export const TASK_STATUSES = ["wait", "todo", "progress", "done", "cancel"];
|
||||
export {WORKSTREAM_STATUSES};
|
||||
|
||||
function ensureStyles() {
|
||||
@@ -138,9 +138,9 @@ export function statusControl({
|
||||
if (nextStatus === currentStatus) return;
|
||||
|
||||
let blockingReason = null;
|
||||
if (type === "task" && nextStatus === "blocked") {
|
||||
if (type === "task" && nextStatus === "wait") {
|
||||
const existingReason = entity?.blocking_reason ?? "";
|
||||
const reason = existingReason || window.prompt("Blocking reason required for blocked tasks:");
|
||||
const reason = existingReason || window.prompt("Reason this task is waiting:");
|
||||
if (!reason) {
|
||||
select.value = currentStatus;
|
||||
setMessage("unchanged");
|
||||
|
||||
@@ -33,7 +33,7 @@ export function isOpenWorkstream(status) {
|
||||
|
||||
export function isStalledWorkstream(w, staleDays = 7) {
|
||||
const staleAt = new Date(Date.now() - staleDays * 24 * 60 * 60 * 1000);
|
||||
const openTasks = (w.todo ?? 0) + (w.in_progress ?? 0) + (w.blocked ?? 0);
|
||||
const openTasks = (w.todo ?? 0) + (w.progress ?? 0) + (w.wait ?? 0);
|
||||
return ["active", "blocked"].includes(normalizeWorkstreamStatus(w.status))
|
||||
&& new Date(w.updated_at) < staleAt
|
||||
&& (w.done ?? 0) > 0
|
||||
|
||||
Reference in New Issue
Block a user