Skip to content

feat: add search and sort filter for contributors#674

Open
Ayush2006385 wants to merge 4 commits into
GitMetricsLab:mainfrom
Ayush2006385:feat/contributor-search-filter
Open

feat: add search and sort filter for contributors#674
Ayush2006385 wants to merge 4 commits into
GitMetricsLab:mainfrom
Ayush2006385:feat/contributor-search-filter

Conversation

@Ayush2006385
Copy link
Copy Markdown

@Ayush2006385 Ayush2006385 commented Jun 1, 2026

🔎 Feature Request: Contributor Search & Filter

Changes Implemented:

  • Client-side search filters contributors dynamically by username.
  • Added sorting functionality (Most to Least / Least to Most).
  • Added Min PR count filtering.
  • Added PR Type selector options (All / Merged / Open / Closed).
  • Added a functional "Clear Filters" configuration reset button.

🎨 Styling Refactor

  • Migrated contributor card components to MUI sx props.
  • Handled explicit hover borderColor parameters for layout uniformity.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 1, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 8c5724a
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1d95578126b10008508bca
😎 Deploy Preview https://deploy-preview-674--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you @Ayush2006385 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@Ayush2006385, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 49 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4890672b-5186-4998-9ed3-bd0d87b83568

📥 Commits

Reviewing files that changed from the base of the PR and between cbd8675 and 8c5724a.

📒 Files selected for processing (1)
  • src/pages/Contributors/Contributors.tsx
📝 Walkthrough

Walkthrough

The Contributors page now supports real-time client-side search by username and sorting by contribution count. Two local state variables drive filtering and sorting logic, which computes a derived filtered list rendered below new MUI form controls and a results count.

Changes

Contributor Search and Sort Feature

Layer / File(s) Summary
State setup and filtering logic
src/pages/Contributors/Contributors.tsx
MUI form imports (TextField, Select, MenuItem, FormControl, InputLabel) are added. State tracks search (username query) and sortOrder (ascending/descending). Filtered list filters contributors by case-insensitive login match and sorts by contributions according to sortOrder.
Search UI controls and filtered rendering
src/pages/Contributors/Contributors.tsx
New TextField and Select controls render above the grid for search input and sort selection. Count summary ("Showing X of Y contributors") is displayed. Grid now maps over filtered instead of contributors. Hover styling removes the prior outlineColor setting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

level:intermediate, quality:clean

Poem

🐰 A rabbit hops through the contributor field,
With search and sort powers now revealed,
Filter by username, sort by might,
Finding top contributors—quick insight! 🔍✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements search by username and sorting by contributions, but is missing minimum PR count filtering, PR type filtering (merged/open/closed), and a Clear filters button—all specified requirements from issue #663. Add minimum PR count filter, PR type filter options, and a Clear filters button to fully address all objectives from issue #663.
Out of Scope Changes check ⚠️ Warning The card hover styling adjustment (removing outlineColor) is not mentioned in issue #663 and appears to be an incidental change unrelated to the filtering feature. Remove the card hover styling change or document why it's necessary; keep changes focused on search and filter functionality from issue #663.
Description check ⚠️ Warning PR description lacks required template structure and misses critical details from the template including issue reference, testing details, and type of change checkboxes. Update description to follow the template format: add explicit issue closure statement, document testing procedures, include type-of-change checkboxes, and provide any screenshots if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding search and sort filtering for contributors, which aligns with the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/pages/Contributors/Contributors.tsx (2)

55-61: ⚡ Quick win

Consider memoizing the filtered list.

The filtered list is recomputed on every render. For better performance, wrap this computation in useMemo with dependencies on contributors, search, and sortOrder.

♻️ Proposed optimization
+import { useEffect, useState, useMemo } from "react";
+
...

-  const filtered = contributors
-    .filter((c) => c.login.toLowerCase().includes(search.toLowerCase()))
-    .sort((a, b) =>
-      sortOrder === "desc"
-        ? b.contributions - a.contributions
-        : a.contributions - b.contributions
-    );
+  const filtered = useMemo(
+    () =>
+      contributors
+        .filter((c) => c.login.toLowerCase().includes(search.toLowerCase()))
+        .sort((a, b) =>
+          sortOrder === "desc"
+            ? b.contributions - a.contributions
+            : a.contributions - b.contributions
+        ),
+    [contributors, search, sortOrder]
+  );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/Contributors/Contributors.tsx` around lines 55 - 61, Wrap the
computation that builds the filtered list in a useMemo to avoid recalculation on
every render: replace the direct assignment to the filtered variable with a
useMemo that returns the filtered-and-sorted array and depends on contributors,
search, and sortOrder; keep the same filter and sort logic (referencing
contributors, search, sortOrder, and the filtered variable name) so the memoized
value updates only when those inputs change.

115-164: 💤 Low value

Significant styling refactor not mentioned in PR description.

The contributor card styling was completely refactored from className-based to sx-based inline styles. While the implementation looks correct, this change was not mentioned in the PR objectives or description. Consider documenting this refactor in the PR description for reviewer clarity.

Changes include:

  • Migration from className props to sx props
  • Removal of outlineColor from hover state
  • Addition of explicit borderColor change in hover
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/Contributors/Contributors.tsx` around lines 115 - 164, The PR
changed contributor card styling from className-based to MUI sx props but the PR
description doesn't mention this refactor; update the PR description to
explicitly state the styling migration in Contributors (the
Card/Link/Avatar/Button JSX), note that className props were replaced with sx
usage, that outlineColor was removed from the hover state and borderColor was
added on hover, and include a brief rationale or QA notes so reviewers know this
was intentional and what to check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/pages/Contributors/Contributors.tsx`:
- Around line 55-61: Wrap the computation that builds the filtered list in a
useMemo to avoid recalculation on every render: replace the direct assignment to
the filtered variable with a useMemo that returns the filtered-and-sorted array
and depends on contributors, search, and sortOrder; keep the same filter and
sort logic (referencing contributors, search, sortOrder, and the filtered
variable name) so the memoized value updates only when those inputs change.
- Around line 115-164: The PR changed contributor card styling from
className-based to MUI sx props but the PR description doesn't mention this
refactor; update the PR description to explicitly state the styling migration in
Contributors (the Card/Link/Avatar/Button JSX), note that className props were
replaced with sx usage, that outlineColor was removed from the hover state and
borderColor was added on hover, and include a brief rationale or QA notes so
reviewers know this was intentional and what to check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fe7298e1-e60c-4343-b6fd-04c5354e344a

📥 Commits

Reviewing files that changed from the base of the PR and between 53f820b and cbd8675.

📒 Files selected for processing (1)
  • src/pages/Contributors/Contributors.tsx

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant