Skip to content

feat(pr-insights): add PR Size Distribution analytics visualization#7839

Open
rastogiradhika wants to merge 3 commits into
JhaSourav07:mainfrom
rastogiradhika:feat/pr-size-distribution
Open

feat(pr-insights): add PR Size Distribution analytics visualization#7839
rastogiradhika wants to merge 3 commits into
JhaSourav07:mainfrom
rastogiradhika:feat/pr-size-distribution

Conversation

@rastogiradhika

Copy link
Copy Markdown
Contributor

##Description

Fixes #7798

This PR extends the existing PR Insights dashboard by introducing a PR Size Distribution visualization alongside the Highlights card. It classifies a developer's Pull Requests based on total lines changed (additions + deletions) into three industry-standard complexity buckets.

Changes

  1. Backend Data Service (services/github/pr-insights.ts):
  • Added PRSizeDistribution interface (atomic, standard, massive).
  • Added optional sizeDistribution?: PRSizeDistribution to PRInsightData.
  • Aggregated PRs into 3 buckets during single-pass processing:
    • Atomic (<100 LOC)
    • Standard (100–500 LOC)
    • Massive (>500 LOC)
  1. New Visualization (components/dashboard/PRInsights/PRSizeDistribution.tsx):
  • Built a responsive horizontal bar chart using Recharts (BarChart, Bar, XAxis, YAxis, Tooltip).
  • Added full dark mode support and internationalized labels.
  1. UI Integration (components/dashboard/PRInsights/PRInsightsClient.tsx):
  • Placed PRSizeDistribution into a clean 3-column responsive grid (lg:col-span-2) alongside Highlights (lg:col-span-1).

Notes

  1. Reuses existing additions and deletions data already fetched from GitHub GraphQL.
  2. Zero additional GitHub API network requests or rate limit overhead.
  3. Fully backward compatible with existing API responses and cache entries.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (New PR Insights dashboard feature & analytics chart)

Visual Preview

Screenshot 2026-07-08 235433

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/dashboard/torvalds).
  • I have run npm run lint and npm run build locally and resolved all errors.
  • My commits follow the Conventional Commits format (feat(pr-insights): ...).
  • I have made sure that I have only one commit to merge in this PR.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@rastogiradhika is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 8, 2026
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/4781-[hash].js 6.90 KB - +6.90 KB (++100%) 🆕 New
static/chunks/8427-[hash].js - 6.81 KB -6.81 KB (-100.00%) 🗑️ Deleted
static/chunks/8747-[hash].js - 47.02 KB -47.02 KB (-100.00%) 🗑️ Deleted
static/chunks/9425-[hash].js 52.20 KB - +52.20 KB (++100%) 🆕 New
static/chunks/9453-[hash].js 93.62 KB 93.33 KB +0.29 KB (+0.31%) 🔴 Regression
static/chunks/app/(root)/dashboard/[username]/page-[hash].js 52.68 KB 52.27 KB +0.41 KB (+0.78%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3938.06 KB 3917.41 KB +20.65 KB (+0.53%)
Total CSS 325.89 KB 325.86 KB +0.03 KB (+0.01%)

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(pr-insights): Visualize Pull Request Size Distribution in PR Insights Dashboard

1 participant