Akshay Fix Popular PRs Duration Filtering - #5458
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
iAbhi001
left a comment
There was a problem hiding this comment.
PR Review & Local Verification Summary
Tested locally on branch Akshay_fix_popular_prs_duration_filter connected to local HGNRest development backend (port 4500).
✅ Verification Checklist:
- API & Network Filtering: Verified via DevTools Network tab that switching the dropdown triggers distinct GET requests with appropriate duration parameters (
lastWeek,last2weeks,lastMonth,allTime) returning200 OK. - Data Consistency: Executed verification script across all four durations. UI components (chart bars, Total PRs, Avg Reviews/PR, Most Reviewed PR) correctly matched backend responses:
- Last Week: 20 rows | 1 review | Top:
FE-999999: 1| Avg:0.1 - Last 2 Weeks: 20 rows | 2 reviews | Top:
FE-999999: 2| Avg:0.1 - Last Month: 20 rows | 3 reviews | Top:
FE-999999: 3| Avg:0.2 - All Time: 20 rows | 411 reviews | Top:
FE-999999: 41| Avg:20.6
- Last Week: 20 rows | 1 review | Top:
- UI & Dark Mode: Chart axes, bar elements, tooltips, and insights cards render cleanly across light and dark modes.
- Automated Tests: All unit test suites executed and passed locally.
LGTM! Approved.
DeepighaJ
left a comment
There was a problem hiding this comment.
Tested the PR locally against the provided test steps.
- Verified all duration filters: Last Week, Last 2 Weeks, Last Month, and All Time.
- Confirmed each selection sends the correct duration query parameter and receives a successful API response.
- Verified the chart data matches the corresponding API response, including PR numbers, review counts, total PRs, average reviews/PR, and most reviewed PR.
- Verified recent-period data is reflected correctly based on the API response.
- Verified the page in dark mode; chart, labels, tooltip, summary values, and insights remain readable.
- Verified the route loads successfully for the volunteer, owner user roles.
- No functional issues found during testing.
Last 2 weeks:
Last Month:
All Time:
Volunteer Role:
iAbhi001
left a comment
There was a problem hiding this comment.
Local Testing & PR Review Summary
Validated locally on branch Akshay_fix_popular_prs_duration_filter against a local HGNRest backend instance (localhost:4500).
Verification Breakdown:
-
Network & API Behavior: Confirmed in DevTools that updating the timeframe dropdown fires the expected GET requests with corresponding duration query params (
lastWeek,last2weeks,lastMonth,allTime), each returning a200 OKstatus. -
Data Accuracy: Ran automated verification across every timeframe filter. Chart visualisations and summary metrics (Total PRs, Avg Reviews/PR, Top Reviewed PR) align precisely with the API payload:
-
Last Week: 20 rows | 1 total review | Top:
FE-999999: 1| Avg:0.1 -
Last 2 Weeks: 20 rows | 2 total reviews | Top:
FE-999999: 2| Avg:0.1 -
Last Month: 20 rows | 3 total reviews | Top:
FE-999999: 3| Avg:0.2 -
All Time: 20 rows | 411 total reviews | Top:
FE-999999: 41| Avg:20.6 -
Visual & Theme Checks: Chart axes, bars, tooltips, and overview cards display properly in both light and dark themes.
-
Test Suite: Local unit tests run clean with zero failures.
LGTM — approved for merge.
DeMoliT1on
left a comment
There was a problem hiding this comment.
Hi @akv-iu,
Tested on local with PR branch Akshay_fix_popular_prs_duration_filter. The API integration seems to be working correctly. And the filters query the correct data from backend.
Approving!







Description
The Top 20 Most Popular PRs chart used fixed January 2026 mock dates and filtered them in the browser. As those dates aged, Last Week, Last 2 Weeks, and Last Month returned no data while All Time continued to show the mock records.
This change connects the chart to the existing duration-aware backend endpoint so every dropdown selection requests current review data and refreshes the loading, chart, and insights states.
Fixes Priority Medium task 2: Data Consistency Verification for Top 20 Most Popular PRs.
Related PRS (if any):
/api/analytics/popular-prsendpoint already exists on backenddevelopment.Main changes explained:
PRData.jsto remove the expired mock PR dataset.PRReviewTeamAnalytics.jsxto request live data for Last Week, Last 2 Weeks, Last Month, and All Time.URL.jswith the popular PR analytics endpoint.How to test:
Akshay_fix_popular_prs_duration_filter.npm install, thennpm run start:local.developmentbranch on port 4500.http://localhost:5173/pr-team-analytics/popular-prs(use the port printed by Vite if it is different).popular-prs.duration=lastWeekduration=last2weeksduration=lastMonthduration=allTimeprNumberandreviewCount.reviewCountdivided by the array length, rounded to one decimal.Automated checks completed:
Screenshots or videos of changes:
PR.mp4
Note:
The existing dark-mode presentation is preserved.
Last Monthrepresents the previous calendar month, not a cumulative superset of Last Week and Last 2 Weeks, so review counts are not required to increase monotonically across those three filters.