Skip to content

[Bug] Dashboard crashes when rendering Total Lines Committed KPI #1223

@bcExpt1123

Description

@bcExpt1123

Description

The dashboard overview crashes on load when the Total Lines Committed KPI is rendered.

GET /dash/lines/total returns a JSON object { "linesCommitted": <number> }, but the UI treated the response as a bare number. That object was passed through buildDashboardKpis into KpiCard, which then tried to render it inside Typography. React throws because objects are not valid children.

Error (console):

Objects are not valid as a React child (found: object with keys {linesCommitted}). 
If you meant to render a collection of children, use an array instead.

Root cause: Type/usage mismatch in useLinesTotal (number vs { linesCommitted: number }) and useDashboardData using linesTotalQuery.data ?? 0 without reading .linesCommitted.

Affected code path: useLinesTotaluseDashboardDatabuildDashboardKpisDashboardOverviewKpiCard

Steps to Reproduce

  1. Open the app and go to the Dashboard page (overview with KPI cards).
  2. Ensure the dashboard loads data from /dash/lines/total (default when the API is reachable).
  3. Wait for KPI cards to render.

Expected Behavior

  • The Total Lines Committed KPI shows a formatted number (e.g. 12,345).
  • The dashboard loads without errors.

Actual Behavior

  • The page crashes with a React render error.
  • The error references an object with key linesCommitted.
  • Other KPIs may render briefly; the crash occurs when the lines-total KPI value is rendered.

Additional Context

API response shape:

{ "linesCommitted": 12345 }
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions