Skip to content

feat: add Merged/Open/Closed status filter controls to PR Analytics chart (#1488) - #2789

Closed
Bhavy12-cell wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Bhavy12-cell:feat/pr-status-filter-1488
Closed

feat: add Merged/Open/Closed status filter controls to PR Analytics chart (#1488)#2789
Bhavy12-cell wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Bhavy12-cell:feat/pr-status-filter-1488

Conversation

@Bhavy12-cell

Copy link
Copy Markdown
Contributor

Summary

Closes #1488

Problem

The PR Analytics section showed static consolidated charts with no way
to filter by PR status. Users could not focus on purely Open, Merged,
or Closed streams to review pending engineering workloads.

Solution

Added interactive pill/segmented filter buttons above the PR charts
allowing filtering across all four PR states.

Changes

src/components/PRMetrics.tsx

  • Extended prFilter state type to include "closed" in addition
    to "all", "merged", "open"
  • Added "closed" pill button with distinct orange color
  • Each status pill uses a unique color for instant visual recognition:
    • All → accent color
    • Merged → green
    • Open → blue
    • Closed → orange
  • Added aria-pressed to each pill for accessibility
  • Wired PRBreakdownChart below PRStatusDonutChart passing
    the active prFilter so both charts respond to the same filter

src/components/PRBreakdownChart.tsx

  • Added PRBreakdownChartProps interface with optional filter prop
  • Chart slices are filtered/zeroed based on active filter so the
    donut chart visually reflects the selected status
  • Legend items are filtered to only show relevant status labels
  • Defaults to "all" when no filter prop is passed (backward compatible)

How It Works

  1. User clicks a status pill (Merged / Open / Closed / All)
  2. prFilter state updates instantly — no API call
  3. Both PRStatusDonutChart and PRBreakdownChart re-render
    showing only the selected status data
  4. Stat cards below are filtered to show relevant metrics

Files Changed

  • src/components/PRMetrics.tsx
  • src/components/PRBreakdownChart.tsx

Checklist

  • ✅ Filter state tracked via React useState
  • ✅ Display items filtered before passing to Recharts
  • ✅ All four status options: All, Merged, Open, Closed
  • ✅ Distinct color per status for clarity
  • ✅ aria-pressed for accessibility
  • ✅ Backward compatible — PRBreakdownChart defaults to "all"
  • ✅ No new dependencies
  • ✅ No TypeScript errors

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) and removed gssoc26 GSSoC 2026 contribution labels Jun 25, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Thanks for contributing! We are currently in a code cleanup sprint and not accepting new features. Please see: #2651

This PR will be revisited once the sprint ends. In the meantime, tests, refactors, bug fixes, and documentation are welcome.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

New UI/feature PRs are on hold during the code quality sprint — see discussion #2651. PRs for tests, refactoring, bug fixes, docs, and performance are welcome.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

New feature/UI PRs are on hold during the code-quality sprint — see discussion #2651. We'll revisit after the sprint; tests, refactors, and bug-fix PRs are the priority right now.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Filtering the donut by zeroing all other slices leaves a single 100% slice — the chart stops conveying anything once a filter is active. Consider dimming/highlighting the selected slice while keeping the others visible instead. Indentation in the new blocks also needs fixing.

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) labels Jul 13, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Reviewed and approved the substance — the closed PR filter, colored status pills, and aria-pressed are a genuine improvement and CI is green. But the branch now has merge conflicts against main (PRMetrics.tsx moved underneath it). Please rebase on latest main and resolve, and while you're in there tidy the indentation in the chartData / legend / filter-button blocks (it drifted to 1-space in places). Ping me once it's conflict-free and I'll merge.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Closing as stale. The last commit on this branch was 2026-06-25, over a month ago, and there's been no activity since. It also has merge conflicts against current main.

This isn't a rejection of the idea — DevTrack's PR queue grew past 110 open PRs, so I'm clearing branches that have gone quiet so the review tab reflects what's actually in progress.

If you still want to land this: rebase on current main, address any review feedback above, and reopen this PR (or open a fresh one) — I'll review it. Thanks for contributing to DevTrack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add metric status filter controls (Merged vs Open vs Closed) to the PR Analytics chart module

2 participants