feat(maintainer/analytics): add PR Volume chart component - #770
Merged
jakharmonika364 merged 4 commits intoJul 26, 2026
Merged
Conversation
Contributor
|
@diksha78dev is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
…Blocked, and Stalled series
diksha78dev
force-pushed
the
feat/maintainer-analytics-pr-volume
branch
from
July 22, 2026 05:18
22c131a to
b4d7f3d
Compare
Collaborator
|
@diksha78dev |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Siddhartha-singh01
requested changes
Jul 23, 2026
Siddhartha-singh01
left a comment
Collaborator
There was a problem hiding this comment.
## Review #770
**Verdict:** Request changes
### Good
- `requireMaintainer` + install repo scoping looks right.
- Chart empty state and Recharts styling match existing analytics cards.
- CI green; Vercel preview ready.
### Blockers
1. **Not wired to the UI** `analytics/page.tsx` never calls `getPrVolumeTimeSeries` or renders `PrVolumeChart`. Feature would not appear after merge.
2. **Not exported** from `src/app/actions/maintainer/index.ts` like the other analytics actions.
3. **Merged under-count** query filters only `githubCreatedAt >= from`, but buckets merged by `mergedAt`. PRs created before the range and merged inside it are missed. Also add an upper bound to `to`.
4. **Stalled series is wrong** uses current `state === 'open'` and increments **every** bucket where `githubUpdatedAt` is older than bucketEnd−7d. One stale PR inflates the whole chart. Also uses 7d while `getStalePrs` defaults to 14d.
### Also
- Nested loop O(PRs × buckets) will hurt on `all` + large installs; bucket by event timestamp instead.
- No unit tests for bucketing / series rules.
- Please add the screen recording @Ayush4958 asked for once the chart is actually on the page (then we can clear **Needs author reply**).
@diksha78dev wire the chart into the analytics page, fix merge/stalled math, re-export the action, and this becomes a solid #717 close.
Collaborator
Author
Screen.Recording.2026-07-25.170945.mp4@Ayush4958 , @Siddhartha-singh01 i have addressed all the fixes which are needed you can review again and let me know if anything else requires to be fixed or add i'd be happy to resolve them. |
Siddhartha-singh01
approved these changes
Jul 25, 2026
Siddhartha-singh01
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the updates and the screen recording, @diksha78dev! I've reviewed the latest code changes.
The Good ✅
- UI & Exports: Everything is correctly exported and wired up to the analytics page.
- Merged Under-Count Fixed: Changing the query to fetch all PRs created before
toperfectly solves the missing merged PRs issue. - Stalled Series Fixed: The rolling window logic (
githubUpdatedAt + 14 days) for calculating stalled PRs across buckets is much more accurate now. - Loop Optimization: Excellent job refactoring the nested loops. The
findBucketIndexhelper and the conditional overlap checks for stalled PRs are great optimizations.
Remaining Blocker ❌
- Unit Tests: I noticed there are still no unit tests for the bucketing and series rules (which was requested in the original review). Since the date math for
getPrVolumeTimeSeries(especially the stalled logic) is complex, we need a few test cases in a.test.tsfile to ensure this doesn't accidentally break in the future.
Collaborator
Author
|
@Siddhartha-singh01 I have added the unit tests for the bucketing and series rules. |
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.
Summary
Adds the PR Volume area chart to the maintainer analytics dashboard showing Merged, AI Blocked, and Stalled PR series over the selected time range.
Type of Change
Related Issue
Closes #717
What was changed?
getPrVolumeTimeSeriesserver action insrc/app/actions/maintainer/analytics.tsto calculate dynamic bucket intervals (daily/weekly/monthly) and tally PRs.<PrVolumeChart>insrc/app/(app)/maintainer/analytics/pr-volume-chart.tsxusing Recharts to match the design specifications (green area, dashed line graphs).Screenshots
Checklist
npm run dev)