Skip to content

Tasks list: offer Reopen for a done task whose question still waits (#103) - #109

Open
dhruv1220 wants to merge 1 commit into
CopilotKit:mainfrom
dhruv1220:fix/tasks-list-reopen-resolved-with-question-103
Open

dhruv1220 wants to merge 1 commit into
CopilotKit:mainfrom
dhruv1220:fix/tasks-list-reopen-resolved-with-question-103

Conversation

@dhruv1220

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks list offers Mark done again when a done task has an unanswered question

1 participant