From 9e790e35708f834abe1a09af52e43742e164cb63 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 5 Mar 2026 19:02:24 +0000 Subject: web: add Accept/Reject for READY tasks, Start Next button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - READY state task cards show Accept + Reject buttons - Accept POSTs to /api/tasks/{id}/accept (→ COMPLETED) - Reject POSTs to /api/tasks/{id}/reject (→ PENDING) - "Start Next" button in toolbar POSTs to /api/scripts/start-next-task - CSS for .btn-accept and .btn-reject Co-Authored-By: Claude Sonnet 4.6 --- web/test/task-actions.test.mjs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/test/task-actions.test.mjs') diff --git a/web/test/task-actions.test.mjs b/web/test/task-actions.test.mjs index f2c21c4..2df6523 100644 --- a/web/test/task-actions.test.mjs +++ b/web/test/task-actions.test.mjs @@ -12,6 +12,7 @@ const RESTART_STATES = new Set(['FAILED', 'TIMED_OUT', 'CANCELLED']); function getCardAction(state) { if (state === 'PENDING') return 'run'; if (state === 'RUNNING') return 'cancel'; + if (state === 'READY') return 'approve'; if (RESTART_STATES.has(state)) return 'restart'; return null; } @@ -39,6 +40,10 @@ describe('task card action buttons', () => { assert.equal(getCardAction('CANCELLED'), 'restart'); }); + it('shows approve buttons for READY', () => { + assert.equal(getCardAction('READY'), 'approve'); + }); + it('shows no button for COMPLETED', () => { assert.equal(getCardAction('COMPLETED'), null); }); -- cgit v1.2.3