Summary
The commit chart has a time range selector (7d / 30d / 90d) but the PR Analytics widget always shows all-time data. This task adds the same filter to PR Analytics for consistency.
What needs to be done
- Reuse the existing range selector component from the commit chart
- Pass selected range as a query param:
/api/metrics/prs?range=30d
- All PR stat tiles (merge rate, review time, counts) should update on range change
- Default range:
30d
Files to touch
- PR Analytics widget component inside
src/components/
src/app/api/metrics/prs/ (extend to accept range query param if not already)
Hints
- Find the range selector already used in the commit chart and reuse it
- Use
useEffect with range as a dependency to re-fetch on change
- Check if the API already supports date filtering before adding new logic
Good for
Someone familiar with React state and API query params looking to contribute a UI feature.
Summary
The commit chart has a time range selector (7d / 30d / 90d) but the PR Analytics widget always shows all-time data. This task adds the same filter to PR Analytics for consistency.
What needs to be done
/api/metrics/prs?range=30d30dFiles to touch
src/components/src/app/api/metrics/prs/(extend to acceptrangequery param if not already)Hints
useEffectwith range as a dependency to re-fetch on changeGood for
Someone familiar with React state and API query params looking to contribute a UI feature.