Skip to content

feat: Add PR open time distribution histogram [issue: #167]#321

Open
abdullahxyz85 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
abdullahxyz85:feat/pr-open-time-histogram
Open

feat: Add PR open time distribution histogram [issue: #167]#321
abdullahxyz85 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
abdullahxyz85:feat/pr-open-time-histogram

Conversation

@abdullahxyz85
Copy link
Copy Markdown

Summary [Issue: #167 ]

Adds a histogram showing how long PRs stay open before being merged, broken into time buckets to reveal code review velocity patterns.

What's Changed

  • New horizontal bar chart in PRMetrics component showing PR open time distribution
  • 4 time buckets: < 1h, 1-24h, 1-7d, > 7d
  • Uses recharts BarChart with responsive sizing
  • Interactive tooltips showing exact PR count per bucket
  • Respects existing 30-day range filter (ready for future range selection)
  • All styling uses CSS variables for theme consistency

Implementation Details

  • Modified /api/metrics/prs/route.ts to calculate and return time distribution data
  • Updated PRMetrics.tsx to render histogram below existing stats
  • Added TypeScript interfaces for proper type safety
  • Maintains backward compatibility with existing metrics

Visual Preview

image --- image --- image

Acceptance Criteria Met [issue: #167 ]

  • ✅ New chart in PR Analytics widget
  • ✅ 4 time buckets with intuitive labels
  • ✅ Horizontal bar chart using recharts
  • ✅ Data from existing /api/metrics/prs endpoint
  • ✅ Respects 30-day range
  • ✅ Uses CSS variables for colors
  • ✅ Tooltip shows exact count on hover

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

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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

@abdullahxyz85
Copy link
Copy Markdown
Author

Hi @Priyanshu-byte-coder ,
I hope u are doing well.
I completed the issue #167 , please review and merge it!
Please add the label gssoc:approved, and level: advanced or any other label that's required for gssoc contribution. or assign section add me.

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.

1 participant