-
Notifications
You must be signed in to change notification settings - Fork 0
Beginner Friendly Issues For the New Contributors #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
| // 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); | ||
| } | ||
| // return Math.round(((recentAvg - olderAvg) / olderAvg) * 100); | ||
| // } |
Copilot
AI
Jun 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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} |
Copilot
AI
Jun 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using the map callback's index parameter instead of calling indexOf on the contributors array for improved performance and clarity.
| #{contributors.indexOf(contributor) + 1} | |
| #{index + 1} |
No description provided.