WIP: PlanDetail shows "No work items" on live — empty-projectId listWorkItems call #314

Closed
toasterson wants to merge 0 commits from claude/wi-019f3882-plandetail-shows-no-work-items-on-live-e into main
Owner

Anima work item 019f3882-fbf0-76e2-86e4-9121b6c8bcbf.

GOAL: the PWA PlanDetail page lists a plan's work items on live data. Today it always shows "No work items" against a real backend even when items have the plan_id set (verified 2026-07-06 against prod with plan 019f3880-eb8d-7e20-95c2-13bcbc03a626, which has 6 draft items).

ROOT CAUSE: anima-pwa/src/pages/PlanDetail/PlanDetail.tsx:37 calls listWorkItems() with no argument. grpcApi.ts listWorkItems (~L497) then issues workItemClient.listWorkItems({ projectId: '' }) — the server returns an empty list for an empty projectId, so the client-side w.planId === plan.id filter (~L151) filters nothing. Same family as the known no-projectId mock-fallback trap on the dashboard (PR #276), but here it's a real-but-empty RPC rather than a mock fallback.

FIX (PWA-only, no proto change):

  • In PlanDetail, fetch items AFTER the plan loads and pass the scope: useAsync(() => plan ? listWorkItems(plan.projectId) : Promise.resolve([]), [plan?.projectId]) (keep the existing client-side planId filter), OR
  • Better if the proto already supports it: check whether ListWorkItemsRequest has a plan_id filter and use it directly; only then touch generated code (regen + reconcile in same change).
  • Audit the other listWorkItems() call sites for the same no-arg pattern while in there (rg "listWorkItems()" src/pages).

ACCEPTANCE: PlanDetail for a plan with draft items lists them on live data; a plan with none still shows the empty state; mock mode unchanged (Workflows.test-style page test updated/added for the fetch-after-plan behavior).

Anima work item `019f3882-fbf0-76e2-86e4-9121b6c8bcbf`. GOAL: the PWA PlanDetail page lists a plan's work items on live data. Today it always shows "No work items" against a real backend even when items have the plan_id set (verified 2026-07-06 against prod with plan 019f3880-eb8d-7e20-95c2-13bcbc03a626, which has 6 draft items). ROOT CAUSE: anima-pwa/src/pages/PlanDetail/PlanDetail.tsx:37 calls `listWorkItems()` with no argument. grpcApi.ts listWorkItems (~L497) then issues `workItemClient.listWorkItems({ projectId: '' })` — the server returns an empty list for an empty projectId, so the client-side `w.planId === plan.id` filter (~L151) filters nothing. Same family as the known no-projectId mock-fallback trap on the dashboard (PR #276), but here it's a real-but-empty RPC rather than a mock fallback. FIX (PWA-only, no proto change): - In PlanDetail, fetch items AFTER the plan loads and pass the scope: `useAsync(() => plan ? listWorkItems(plan.projectId) : Promise.resolve([]), [plan?.projectId])` (keep the existing client-side planId filter), OR - Better if the proto already supports it: check whether ListWorkItemsRequest has a plan_id filter and use it directly; only then touch generated code (regen + reconcile in same change). - Audit the other listWorkItems() call sites for the same no-arg pattern while in there (rg "listWorkItems\(\)" src/pages). ACCEPTANCE: PlanDetail for a plan with draft items lists them on live data; a plan with none still shows the empty state; mock mode unchanged (Workflows.test-style page test updated/added for the fetch-after-plan behavior).
Author
Owner

Merged at ae5d72d. Your project-scoped listWorkItems(projectId, planId) fix is the version kept in the merged PlanDetail. Closing.

Merged at `ae5d72d`. Your project-scoped `listWorkItems(projectId, planId)` fix is the version kept in the merged PlanDetail. Closing.
toasterson closed this pull request 2026-07-09 17:54:56 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!314
No description provided.