| name | dashboard-data-flow-consistency |
| description | Keep dashboard views aligned on shared query keys, polling policy, invalidation, mutation feedback, and loading/error/empty states. Use this when editing dashboard views, hooks, or task controls. |
| owner | any |
| trigger | null |
| version | 1 |
Dashboard Data Flow Consistency
Use this when changing the dashboard so new code follows the shared data-flow patterns instead of adding one-off query logic.
Prefer Existing Shared Primitives
dashboard/src/hooks/useDashboardData.ts
dashboard/src/hooks/dashboardQueryConfig.ts
dashboard/src/hooks/useDashboardInvalidation.ts
dashboard/src/hooks/useDashboardMutationStatus.ts
dashboard/src/components/StatusNotice.tsx
dashboard/src/components/PanelPlaceholder.tsx
Workflow
- Check whether the data already belongs in a shared hook before adding a new
useQuery.
- Keep query keys, polling intervals, stale times, and retry policy in shared config.
- Route mutation follow-up through shared invalidation helpers.
- Use one consistent status surface for success and error feedback.
- Handle all four UI states explicitly:
loading, blocking error, empty, and populated.
- If multiple task actions can conflict, disable the whole control surface while one is pending.
Review Questions
- Did this change add another one-off query or mutation pattern that should live in a shared hook instead?
- Are loading and error states explicit, or still hidden behind blank panels?
- Are task actions issuing overlapping requests?
- Did tests cover the new state or action path?
Minimum Verification
- targeted dashboard tests for the changed view
npm run build
- repo verification stack if runtime code also changed