Fix: My Work listed tasks from draft/completed/cancelled plans - #53
Merged
Conversation
'My Open Tasks' filtered only by task status, not by the owning plan's status — so a not-started task on a draft plan (never activated) or a leftover open task on a completed/cancelled plan showed up as if it were live work. getTasks now selects codePlans.status as TaskWithContext.planStatus (the query already joins code_plans; this was just missing from the select/return), and My Work filters to planStatus === 'active'. The Tasks page is unaffected — it's the comprehensive review surface and intentionally shows tasks across all plan statuses. Regression tests: planStatus is present and correct for tasks on active and completed plans (207 total, up from 206). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7FhGxYjnJHJ7m9MpH2dgJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
"My Open Tasks" on
/my-workfiltered only by task status (!== 'done'), never checking the owning plan's status. Result: a not-started task on a draft plan you never activated — or a leftover open task on a completed/cancelled plan — showed up in your personal to-do list as if it were live work.Fix
getTasksalready inner-joinscode_plans(needed forplanTitle), socodePlans.statuswas one field away — added it to the select and the returnedTaskWithContextasplanStatus./my-worknow filtersmyTaskstoplanStatus === 'active'in addition to the existingstatus !== 'done'.The
/taskspage is untouched — it's the comprehensive review surface and is meant to show tasks across every plan status; only the personal "what should I actually be doing" view needed the filter.Tests
Two regression assertions in
getTaskscoverage:planStatusis present and correct for a task on the active fixture plan and for one on the completed fixture plan (uses existing seed data, no new fixtures needed). 207 tests passing (up from 206); typecheck and production build clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y7FhGxYjnJHJ7m9MpH2dgJ
Generated by Claude Code