Skip to content

fix(dashboard): Fixes a dashboard crash when rendering the **Total Lines Committed** KPI.#1224

Open
bcExpt1123 wants to merge 2 commits into
entrius:testfrom
bcExpt1123:fix/dashboard-lines-total-kpi-crash
Open

fix(dashboard): Fixes a dashboard crash when rendering the **Total Lines Committed** KPI.#1224
bcExpt1123 wants to merge 2 commits into
entrius:testfrom
bcExpt1123:fix/dashboard-lines-total-kpi-crash

Conversation

@bcExpt1123
Copy link
Copy Markdown
Contributor

Summary

Fixes a dashboard crash when rendering the Total Lines Committed KPI.

GET /dash/lines/total returns { linesCommitted: number }, but the client typed and consumed it as a bare number. The full response object was passed into buildDashboardKpis and then KpiCard, which triggered:

Objects are not valid as a React child (found: object with keys {linesCommitted})

Changes:

  • Add LinesTotal type matching the API response
  • Type useLinesTotal with LinesTotal instead of number
  • Read linesTotalQuery.data?.linesCommitted ?? 0 in useDashboardData before building KPIs

Related Issues

fixes #1223

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before:
image

After:
image

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

The lines total endpoint returns { linesCommitted }, not a bare number.
Passing the object into KpiCard caused a React render crash on the dashboard.
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 18, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 19, 2026

Fix conflicts.

@bcExpt1123
Copy link
Copy Markdown
Contributor Author

@anderdc
I've fixed the conflicts. Please review again. thanks

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Dashboard crashes when rendering Total Lines Committed KPI

2 participants