Skip to content

Conversation

@kunal-511
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented Jun 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
git-intel ❌ Failed (Inspect) Jun 2, 2025 4:56pm

@kunal-511 kunal-511 self-assigned this Jun 2, 2025
@kunal-511 kunal-511 requested a review from Copilot June 2, 2025 16:58
Copy link

Copilot AI left a 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

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);
}
// return Math.round(((recentAvg - olderAvg) / olderAvg) * 100);
// }
Copy link

Copilot AI Jun 2, 2025

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.

Copilot uses AI. Check for mistakes.
<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}
Copy link

Copilot AI Jun 2, 2025

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.

Suggested change
#{contributors.indexOf(contributor) + 1}
#{index + 1}

Copilot uses AI. Check for mistakes.
@kunal-511 kunal-511 merged commit 962a4d1 into main Jun 2, 2025
2 of 3 checks passed
kunal-511 added a commit that referenced this pull request Jun 2, 2025
kunal-511 added a commit that referenced this pull request Jun 2, 2025
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