Add cancelled status for tasks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gros Frumos 2026-03-15 18:22:17 +02:00
parent 6e872121eb
commit bf38532f59
5 changed files with 7 additions and 6 deletions

View file

@ -223,7 +223,7 @@ def task_show(ctx, id):
@task.command("update")
@click.argument("task_id")
@click.option("--status", type=click.Choice(
["pending", "in_progress", "review", "done", "blocked", "decomposed"]),
["pending", "in_progress", "review", "done", "blocked", "decomposed", "cancelled"]),
default=None, help="New status")
@click.option("--priority", type=int, default=None, help="New priority (1-10)")
@click.pass_context

View file

@ -256,9 +256,9 @@ def test_patch_task_status_persisted(client):
assert r.json()["status"] == "blocked"
@pytest.mark.parametrize("status", ["pending", "in_progress", "review", "done", "blocked"])
@pytest.mark.parametrize("status", ["pending", "in_progress", "review", "done", "blocked", "cancelled"])
def test_patch_task_all_valid_statuses(client, status):
"""Все 5 допустимых статусов должны приниматься."""
"""Все 6 допустимых статусов должны приниматься."""
r = client.patch("/api/tasks/P1-001", json={"status": status})
assert r.status_code == 200
assert r.json()["status"] == status

View file

@ -141,7 +141,7 @@ class TaskPatch(BaseModel):
status: str
VALID_STATUSES = {"pending", "in_progress", "review", "done", "blocked"}
VALID_STATUSES = {"pending", "in_progress", "review", "done", "blocked", "cancelled"}
@app.patch("/api/tasks/{task_id}")

View file

@ -108,7 +108,7 @@ const filteredDecisions = computed(() => {
function taskStatusColor(s: string) {
const m: Record<string, string> = {
pending: 'gray', in_progress: 'blue', review: 'purple',
done: 'green', blocked: 'red', decomposed: 'yellow',
done: 'green', blocked: 'red', decomposed: 'yellow', cancelled: 'gray',
}
return m[s] || 'gray'
}

View file

@ -76,7 +76,7 @@ onUnmounted(stopPolling)
function statusColor(s: string) {
const m: Record<string, string> = {
pending: 'gray', in_progress: 'blue', review: 'yellow',
done: 'green', blocked: 'red', decomposed: 'purple',
done: 'green', blocked: 'red', decomposed: 'purple', cancelled: 'gray',
}
return m[s] || 'gray'
}
@ -228,6 +228,7 @@ async function changeStatus(newStatus: string) {
<option value="review">review</option>
<option value="done">done</option>
<option value="blocked">blocked</option>
<option value="cancelled">cancelled</option>
</select>
<span v-if="isRunning" class="inline-block w-2 h-2 bg-blue-500 rounded-full animate-pulse"></span>
<span class="text-xs text-gray-600">pri {{ task.priority }}</span>