Repository navigation
Conversation
STiFLeR7
left a comment
There was a problem hiding this comment.
Verified on Windows with Bun 1.4.3. With the Tasks row from main (b32ec10), the regression fails because the done task has no Reopen button while its question is waiting. On this PR, the task stays under Needs input, and clicking Reopen sends POST /api/openduet/tasks/question-task/reopen. The test also confirms that no /resolve request is sent.
All four focused Tasks screen tests passed, including the existing Mark done and Reopen cases. The app test harness captured the HTTP requests with a mock.
|
Thanks for verifying this on Windows with Bun 1.4.3 — the mock-captured request check (Reopen sends POST /reopen and never /resolve) is exactly the behavior the fix is meant to guarantee, so good to see it confirmed outside my own setup. |
|
Thanks, Dhruv. The Windows run confirmed the task stays under Needs input, and clicking Reopen sends |
Fixes #103.
When a task has an unanswered question and the person marks it done, the task page offers Reopen — but the row in Tasks → Active still offered "Mark done". Pressing it called /resolve a second time instead of reopening the task.
The row decided Reopen from its grouped status, and the grouping gives a pending question priority (statusOf returns "needs_input" whenever something waits), even though the task already carries a resolution timestamp. The task page decides from the timestamp instead (done = task.resolvedAt !== null). The row now does the same: the check is filled and offers Reopen whenever resolvedAt is set, while the row keeps its Needs input grouping so the pending question stays visible.
Test: added "a done task still offers Reopen under Needs input while its question waits" to openbot/app/tests/tasks-screen.test.tsx — a task with resolvedAt set and status needs_input plus an unanswered question from its own thread. Verified the new test fails on pristine code (the button read "Mark Choose a deck done") and passes with the fix, asserting the click sends POST /reopen and never POST /resolve. tasks-screen + pages + task-groups: 98/98 pass. App typecheck and biome format/lint clean.