Skip to content

fix: clear filter functionality#114

Open
ShaikhGouhar wants to merge 3 commits into
niharika-mente:mainfrom
ShaikhGouhar:add-clear-filters-button
Open

fix: clear filter functionality#114
ShaikhGouhar wants to merge 3 commits into
niharika-mente:mainfrom
ShaikhGouhar:add-clear-filters-button

Conversation

@ShaikhGouhar

@ShaikhGouhar ShaikhGouhar commented Jun 20, 2026

Copy link
Copy Markdown

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue number)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-code modifications)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Manual testing (describe steps and browser tested in)
  • Automated tests added/run (if applicable)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings or console errors
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a "Clear Filters" button to the search filters section, allowing users to easily reset all active search criteria in a single click.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@ShaikhGouhar is attempting to deploy a commit to the niharika-mente's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b91f9f2-181f-490b-9710-7fbe1c1497cf

📥 Commits

Reviewing files that changed from the base of the PR and between f79bfc2 and 376c329.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !package-lock.json
📒 Files selected for processing (1)
  • components/SearchFilters.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/SearchFilters.tsx

📝 Walkthrough

Walkthrough

SearchFilters gains a handleClearFilters function that resets the local search state, clones searchParams, deletes the query, mode, sortBy, and tag keys, then calls router.push with scroll: false. A "Clear Filters" button in the UI calls this function. Minor whitespace formatting was also applied.

Changes

Clear Filters Feature

Layer / File(s) Summary
handleClearFilters logic and button UI
components/SearchFilters.tsx
Adds handleClearFilters to reset local search state and strip filter-related URL params (query, mode, sortBy, tag) via router.push. Adds a "Clear Filters" button that invokes this callback on click. Includes minor whitespace tweaks.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: clear filter functionality' is partially related but misleading—the PR implements a new feature, not a fix, as indicated by the description's 'New feature' checkbox. Revise the title to reflect that this is a new feature, e.g., 'feat: add clear filters button to SearchFilters component'.
Description check ⚠️ Warning The description is largely incomplete—the issue number, detailed motivation, and testing steps are missing, with only template checkboxes marked without substantive content. Fill in the issue number (referenced as #70), provide detailed description of the clear filter implementation and motivation, and document specific manual testing steps.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch add-clear-filters-button

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@components/SearchFilters.tsx`:
- Around line 45-60: In the handleClearFilters function, the URL parameters are
being cleared but the local search state (referenced on line 23) is not being
reset, causing the search input to display stale query text while the URL is
updated. Add a call to reset the search state variable to an empty string or its
initial value alongside the URL parameter deletion. Additionally, fix the
formatting by adding a space before the opening brace in the function
declaration and correct the indentation throughout the function body to maintain
consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f50bc1d-65e1-417c-bc74-e5aca1963f5c

📥 Commits

Reviewing files that changed from the base of the PR and between 352b809 and b838ba0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !package-lock.json
📒 Files selected for processing (2)
  • components/SearchFilters.tsx
  • package.json

Comment thread components/SearchFilters.tsx Outdated
@TarunyaProgrammer

Copy link
Copy Markdown
Collaborator

Issue Number; #70

Add issue number in desc too!

@TarunyaProgrammer TarunyaProgrammer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of minor suggestions:

  • The button currently uses flex flex-col justify-end, which isn't needed for a single text element and can be simplified.
  • Consider adding cursor-pointer, a hover state, and using rounded-lg to better match the styling of other interactive elements in the application.

Also, the PR includes MongoDB/Mongoose dependency upgrades. It may be preferable to keep dependency updates in a separate PR from feature changes to make testing and troubleshooting easier if issues arise.

@ShaikhGouhar

Copy link
Copy Markdown
Author

@TarunyaProgrammer , here is the requested changes , if any other changes are require ,please let me know

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

Labels

Medium SSoC26 TO CONTRIBUTE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants