Skip to content

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

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

Feat: Added commit diff size trend [ISSUE: #174]#322
abdullahxyz85 wants to merge 6 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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 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.

@abdullahxyz85
Copy link
Copy Markdown
Author

Hi @Priyanshu-byte-coder ,
I completed the issue: #174 , please review and merge it,
and add label: gssoc:approved and level: critical 🙏.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR conflicts with recently merged changes. Please rebase onto main:

git fetch upstream && git rebase upstream/main

Resolve any conflicts, push, and I'll review.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Hi @abdullahxyz85 — this PR has a merge conflict with main. Please rebase your branch:

git fetch upstream
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-lease

Once rebased, we'll review and merge.

@abdullahxyz85
Copy link
Copy Markdown
Author

Sure, i am doing!

@abdullahxyz85
Copy link
Copy Markdown
Author

@Priyanshu-byte-coder I resolved the conflicts , please review and add label: gssoc:approved and level.

@abdullahxyz85
Copy link
Copy Markdown
Author

Closing to reopen as separate, isolated feature PRs for proper review

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.

Same bundling problem as #321 — please clean up before merge:

1. Remove already-merged files after rebasing
The following files are already in main (merged via #336 and earlier PRs). After rebasing, delete them from this branch:

  • src/app/api/leaderboard/route.ts
  • supabase/migrations/20260519000000_add_leaderboard_opt_in.sql
  • src/app/leaderboard/page.tsx

2. Scope this PR to DiffTrendChart only
This PR touches prs/route.ts, issues/route.ts, settings/page.tsx, BadgeSection.tsx, TopRepos.tsx, supabase.ts, tsconfig.json — none of these are related to the diff size trend feature. Revert any changes not specifically needed for DiffTrendChart.

The files that belong in this PR:

  • src/components/DiffTrendChart.tsx
  • src/app/api/metrics/diff-trend/route.ts
  • src/app/globals.css (adding --success / --destructive tokens) ✓
  • src/app/dashboard/page.tsx (registering the widget) ✓
  • e2e/dashboard-widgets.spec.js (mocking the new route) ✓

The chart component itself looks good: CSS vars throughout, proper loading/error/computing/empty states, clean recharts usage. Just needs the cleanup above.

@abdullahxyz85
Copy link
Copy Markdown
Author

I closed these PR's and opened new PR

Same bundling problem as #321 — please clean up before merge:

1. Remove already-merged files after rebasing The following files are already in main (merged via #336 and earlier PRs). After rebasing, delete them from this branch:

  • src/app/api/leaderboard/route.ts
  • supabase/migrations/20260519000000_add_leaderboard_opt_in.sql
  • src/app/leaderboard/page.tsx

2. Scope this PR to DiffTrendChart only This PR touches prs/route.ts, issues/route.ts, settings/page.tsx, BadgeSection.tsx, TopRepos.tsx, supabase.ts, tsconfig.json — none of these are related to the diff size trend feature. Revert any changes not specifically needed for DiffTrendChart.

The files that belong in this PR:

  • src/components/DiffTrendChart.tsx
  • src/app/api/metrics/diff-trend/route.ts
  • src/app/globals.css (adding --success / --destructive tokens) ✓
  • src/app/dashboard/page.tsx (registering the widget) ✓
  • e2e/dashboard-widgets.spec.js (mocking the new route) ✓

The chart component itself looks good: CSS vars throughout, proper loading/error/computing/empty states, clean recharts usage. Just needs the cleanup above.

I closed these PR's and opened new PR

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.

2 participants