Skip to content

[GOOD FIRST ISSUE] Add date range filter (7d / 30d / 90d) to PR Analytics widget #2453

@vbarik317-droid

Description

@vbarik317-droid

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.

Metadata

Metadata

Labels

gssoc:assignedGSSoC: Issue assigned to a contributor

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions