Describe the bug
The TopRepos.tsx widget is supposed to show "most active repos over any time range" (per README), but the current implementation fetches repos sorted by pushed_at or star count from GitHub's REST API — not by commit count within the selected 7d/14d/30d/90d window.
A repo the user hasn't touched in 6 months appears as "most active" simply because it has many stars or a recent push from a fork.
Expected behavior
Top Repos should rank by number of commits made by the authenticated user within the selected time range.
Fix approach
- For each repo, call
GET /repos/{owner}/{repo}/commits?author={username}&since={startDate}
- Sort repos by commit count descending
- Show commit count badge next to each repo name
- Cache results in Supabase to avoid rate limit issues
Note: This is related to but distinct from issue #35 (repo filter on contribution chart) — that issue filters the chart by repo; this issue fixes the ranking logic in TopRepos.
File: src/app/api/metrics/repos/route.ts, src/components/TopRepos.tsx
Describe the bug
The
TopRepos.tsxwidget is supposed to show "most active repos over any time range" (per README), but the current implementation fetches repos sorted bypushed_ator star count from GitHub's REST API — not by commit count within the selected 7d/14d/30d/90d window.A repo the user hasn't touched in 6 months appears as "most active" simply because it has many stars or a recent push from a fork.
Expected behavior
Top Repos should rank by number of commits made by the authenticated user within the selected time range.
Fix approach
GET /repos/{owner}/{repo}/commits?author={username}&since={startDate}Note: This is related to but distinct from issue #35 (repo filter on contribution chart) — that issue filters the chart by repo; this issue fixes the ranking logic in TopRepos.
File:
src/app/api/metrics/repos/route.ts,src/components/TopRepos.tsx