Feat/repo contribution distribution chart#367
Conversation
|
@prashant2007-wq 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. |
There was a problem hiding this comment.
Thanks for your first PR on DevTrack! 🎉
A maintainer will review it within 48 hours. While you wait:
- Make sure CI is passing (type-check + lint)
- Double-check the PR description is filled out and the issue is linked
- Feel free to ask questions in Discussions if you need help
|
Two critical fixes needed before merge: 1. Remove committed env file (critical)
git rm ".env.localø"
git pushAlso add 2. Hardcoded Tailwind colors break dark mode The component uses Tailwind utility classes that assume a dark background and break in light mode: // Current (broken in light mode):
"border-white/10 bg-white/5" → border-[var(--border)] bg-[var(--card)]
"bg-black/10" → bg-[var(--control)]
"text-muted-foreground" → text-[var(--muted-foreground)]
"bg-primary text-primary-foreground" → bg-[var(--accent)] text-[var(--accent-foreground)]Also, the first chart color Fix these two and the PR is mergeable. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Hardcoded hex colors break theming — 7 of 8 entries in the COLORS array are raw hex values that won't adapt to dark/light mode or custom themes:
// Change these to CSS vars or project tokens
"#22c55e" → consider var(--success) if defined, or keep as chart-specific color
"#f97316", "#06b6d4", etc.For rotating chart colors with no CSS var equivalent, document the decision with a comment. But text-red-300 in the error state must become text-[var(--destructive)].
Missing EOF newline in RepoContributionDistribution.tsx.
Link the issue — PR checklist is entirely blank. Add the issue number this closes.
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Issues found in this PR:
- Raw Tailwind color classes — replace
text-red-*/bg-red-*withtext-[var(--destructive)]/ appropriate CSS var equivalents. All colors must use CSS variables for theme support.
|
Fixed the remaining raw Tailwind color issue.
I also ran: npm run lint
npm run type-check |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
The COLORS array in RepoContributionDistribution.tsx uses hardcoded hex values for recharts slices. Since recharts doesn't resolve CSS vars in SVG attributes, define chart color variables in globals.css (e.g., --chart-2 through --chart-7) and compute them at runtime:
const style = getComputedStyle(document.documentElement);
const COLORS = [
style.getPropertyValue('--accent').trim(),
style.getPropertyValue('--chart-2').trim(),
// ...
];Then define the values in globals.css light/dark blocks. This keeps all colors theme-aware.
|
Merge conflict with current main. Please rebase against main to resolve before this can be merged. |
|
This PR has merge conflicts with |
|
This PR has conflicts with the current |
2783d58 to
1489390
Compare
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
This PR has merge conflicts with main. Please rebase onto the latest main branch and resolve conflicts to proceed with merging.
1489390 to
4bf8ac7
Compare
|
This PR has merge conflicts with |
33d0b8b to
3b11be9
Compare
0efbf59
into
Priyanshu-byte-coder:main
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
Summary
Added a Repository Contribution Distribution Chart below the Contribution Heatmap section on the dashboard.
This chart helps users understand which repositories they contribute to the most by showing repository-wise commit distribution, percentage contribution, and hover tooltip details.
The chart uses real GitHub contribution data from the existing backend endpoint:
So it displays repository data for the logged-in GitHub user instead of using sample/static data.
Closes #308
Type of Change
Changes Made
RepoContributionDistributioncomponent./api/metrics/repos?days=365endpoint to fetch real repository metrics.var(--accent)for the first chart color.text-[var(--destructive)]..env.localøfile..env.local*to.gitignoreso local environment files are not tracked.RepoContributionDistribution.tsxends with a newline.How to Test
Steps for the reviewer to verify this works:
Pull this branch locally.
Install dependencies:
.env.local:Log in using GitHub.
Scroll below the Contribution Heatmap section.
Verify that the Repository Contribution Distribution Chart is visible.
Verify that the chart displays real repository contribution data from the logged-in user.
Test both chart modes:
Hover over chart items and verify that the tooltip displays:
Verify all UI states:
Switch between light and dark mode and verify that the chart container, text, controls, and error state remain readable.
Screenshots (if UI change)
Add screenshots here:
Checklist
npm run lintpasses locallynpm run type-check).env.local*to.gitignoreRepoContributionDistribution.tsxends with a newline