Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces beginner-friendly issues functionality to help new contributors easily find suitable issues. Key changes include:
- Adding a date formatting utility in utils.ts
- Extending GitHub API types and queries to include beginnerIssues data
- Creating a new BeginnerIssues React component and updating the analytics page to display beginner-friendly issues
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/utils.ts | Added a new date formatting utility method |
| src/lib/github.ts | Extended repository and stats interfaces and updated GraphQL queries to include beginnerIssues |
| src/lib/github-types.ts | Updated GitHub API types to reflect beginnerIssues data |
| src/components/github/BeginnerIssues.tsx | New component for displaying beginner-friendly issues |
| src/app/analytics/[owner]/[repo]/page.tsx | Integrated beginnerIssues component into the analytics page and updated UI for enhanced repository stats |
Comment on lines
+1247
to
+1336
| // function calculateGrowthRate(historical: HistoricalData[], field: keyof HistoricalData): number { | ||
| // if (historical.length < 2) return 0; | ||
|
|
||
| const recent = historical.slice(-3); // Last 3 months | ||
| const older = historical.slice(-6, -3); // Previous 3 months | ||
| // const recent = historical.slice(-3); // Last 3 months | ||
| // const older = historical.slice(-6, -3); // Previous 3 months | ||
|
|
||
| const recentAvg = recent.reduce((sum, item) => sum + (Number(item[field]) || 0), 0) / recent.length; | ||
| const olderAvg = older.reduce((sum, item) => sum + (Number(item[field]) || 0), 0) / older.length; | ||
| // const recentAvg = recent.reduce((sum, item) => sum + (Number(item[field]) || 0), 0) / recent.length; | ||
| // const olderAvg = older.reduce((sum, item) => sum + (Number(item[field]) || 0), 0) / older.length; | ||
|
|
||
| if (olderAvg === 0) return recentAvg > 0 ? 100 : 0; | ||
| // if (olderAvg === 0) return recentAvg > 0 ? 100 : 0; | ||
|
|
||
| return Math.round(((recentAvg - olderAvg) / olderAvg) * 100); | ||
| } No newline at end of file | ||
| // return Math.round(((recentAvg - olderAvg) / olderAvg) * 100); | ||
| // } No newline at end of file |
There was a problem hiding this comment.
[nitpick] Consider removing the commented-out code for calculateGrowthRate if it is no longer needed to improve maintainability.
| <div className="text-sm text-neutral-400">{contributor.contributions} contributions</div> | ||
| </div> | ||
| <Badge variant="outline" className="text-purple-300 border-purple-700"> | ||
| #{contributors.indexOf(contributor) + 1} |
There was a problem hiding this comment.
Consider using the map callback's index parameter instead of calling indexOf on the contributors array for improved performance and clarity.
Suggested change
| #{contributors.indexOf(contributor) + 1} | |
| #{index + 1} |
kunal-511
added a commit
that referenced
this pull request
Jun 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.