Fix/prmetrics empty state#394
Conversation
|
@mrunalC27 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Two issues:
1. This PR includes #325's DashboardHeader.tsx changes
The DashboardHeader changes are already being reviewed in #325. Once #325 merges, rebase this PR on main so only the PRMetrics empty-state diff remains. Don't merge this before #325 merges (or it would land both sets of changes at once, making the history harder to read).
2. Indentation inconsistency in the empty-state ternary
) : (
- <div className="grid ...
// becomes
) : metrics?.total === 0 ? (
<div className="flex ...The ) : moved from 6-space to 8-space indent and the content from 8 to 10. Match the surrounding ternary branches' indentation.
|
fixed it |
957683a to
1f8d6f9
Compare
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
1. total field not returned by the API — the component checks metrics?.total === 0 but /api/metrics/prs doesn't return a total field. The empty state will never render because metrics.total will be undefined, not 0. Update the API route to return total as well.
2. JSX indentation is malformed — the new ternary branch and the <div className="grid"> inside it are indented inconsistently (mixed 10-space and 12-space). Fix to match the surrounding 8-space indent — or run Prettier.
Summary
Adds a proper empty state to the PR Analytics section when a user has no pull requests instead of showing empty metrics and charts.
Closes #215
Type of Change
Changes Made
metrics?.total === 0var(--muted-foreground)styling to match existing UI patternsPRDatainterface to include thetotalfieldHow to Test
Steps for the reviewer to verify this works:
Screenshots (if UI change)
Added empty state UI for users with no pull requests.
Checklist
npm run lintpasses locallynpm run type-check)