Skip to content

Feat: Added commit diff size trend [ISSUE: #174]#390

Open
abdullahxyz85 wants to merge 10 commits into
Priyanshu-byte-coder:mainfrom
abdullahxyz85:feat/commit-diff-size-trend
Open

Feat: Added commit diff size trend [ISSUE: #174]#390
abdullahxyz85 wants to merge 10 commits into
Priyanshu-byte-coder:mainfrom
abdullahxyz85:feat/commit-diff-size-trend

Conversation

@abdullahxyz85
Copy link
Copy Markdown

Summary [ISSUE: #174 ]

Adds a stacked bar chart showing lines added vs. removed per week over the last 12 weeks, giving insight into codebase growth patterns.

What's Changed

  • New DiffTrendChart component in dashboard
  • API endpoint to fetch repository code frequency stats
  • Aggregates data from top 3 repositories
  • Stacked bar chart with lines added (green) and removed (red)
  • Handles GitHub 202 response (computing stats state)
  • Added CSS color variables for theme consistency

Implementation Details

  • Fetches from GitHub API: /repos/{owner}/{repo}/stats/code_frequency
  • Displays last 12 weeks of data
  • Shows loading, computing, and error states
  • Responsive design for all screen sizes
  • Full dark mode support

Acceptance Criteria Met: ISSUE: #174

  • ✅ New chart widget in dashboard
  • ✅ Data from GitHub Stats API
  • ✅ Aggregated across top 3 repos
  • ✅ Stacked bar with additions/deletions
  • ✅ Uses recharts BarChart with two data series
  • ✅ Last 12 weeks shown with dates
  • ✅ Tooltip shows exact counts
  • ✅ Handles 202 response (Computing stats)
  • ✅ Uses CSS variables for colors

Visual Overview:

Code Change Trend:

image

Closes: #174

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@abdullahxyz85 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.

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API route and chart component look clean. Two issues:

1. cursor={{ fill: "var(--accent)/10" }} is invalid
In DiffTrendChart.tsx, the recharts cursor prop passes fill: "var(--accent)/10" as an SVG attribute — var(--accent)/10 is Tailwind shorthand syntax, not valid CSS/SVG. SVG will ignore it (no fill applied). Replace with a transparent or semi-transparent value:

cursor={{ fill: "rgba(99, 102, 241, 0.1)" }}

Or just omit the cursor prop to use recharts default.

2. DiffTrendChart not registered in dashboard/page.tsx
The chart component is created but never imported or rendered anywhere. Add it to the dashboard page (inside the grid of widgets) so it actually appears.

@abdullahxyz85
Copy link
Copy Markdown
Author

abdullahxyz85 commented May 19, 2026

@Priyanshu-byte-coder Done! Please make sure to add the label: gssoc:approved and level:adavanced.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add commit diff size trend — lines added/removed per week chart

2 participants