Skip to content

feat: Added a Reset/Clear Filters button to search form - #298

Merged
komalharshita merged 2 commits into
komalharshita:mainfrom
DeepeshKafalatiya:feature/clear-filters-btn
May 19, 2026
Merged

feat: Added a Reset/Clear Filters button to search form#298
komalharshita merged 2 commits into
komalharshita:mainfrom
DeepeshKafalatiya:feature/clear-filters-btn

Conversation

@DeepeshKafalatiya

@DeepeshKafalatiya DeepeshKafalatiya commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary [required]

This pull request introduces a dedicated "Clear Filters" button to the main project recommendation form. Previously, users had to manually delete text from inputs and reset individual dropdown fields if they wanted to perform a brand-new search query. Adding a single-click reset button improves the application's layout accessibility and significantly smoothens the user journey when interacting with project recommendations.

Related Issue [required]

Closes #141

Type of Change [required]

  • Feature — adds new functionality
  • Style — CSS or visual changes only, no logic change

What Was Changed [required]

File Change made
templates/index.html Wrapped the submission block buttons in a responsive .form-actions flexbox container and added the secondary styled layout for the .btn-clear button element.
static/script.js Appended a custom DOM event listener on the clear button that resets the form, completely wipes out the internal tracking array selectedSkills, clears any visual text or generated skill chips, and resets element focuses natively.

How to Test This PR [required]

  1. Clone this branch: git checkout feature/clear-filters-btn
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000 and enter arbitrary keywords into the skills input and change several filter dropdowns.
  5. Click the new "Clear Filters" button next to "Generate My Projects". Verify that all form fields immediately return to their empty/blank placeholder state, all dynamic skill chips disappear, and cursor focus shifts back to the skills text field.
  6. Run the tests: python tests/test_basic.py

Expected test output:
27 passed, 0 failed out of 27 tests

Test Results [required]

27 passed, 0 failed out of 27 tests

Screenshots

Uploading image.png…

Before After
Form had only a primary "Generate My Projects" button with no quick method to reset fields. Form now contains a sleek "Clear Filters" secondary action button right next to the submit action.

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)

Notes for Reviewer

The new button logic handles native HTML form clearing using form.reset(), but is intentionally integrated directly inside static/script.js to clear the state of the active global selectedSkills array tracker. This ensures complete data synchronization between the visual frontend elements and the underlying application query state.

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

@DeepeshKafalatiya is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions 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.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

@DeepeshKafalatiya

Copy link
Copy Markdown
Contributor Author

Hi mentors, I have completed the implementation for issue #141. The form now correctly clears all filters, manages custom tag chips safely, and returns the cursor focus back to the primary inputs. Manual and local verification scripts have passed cleanly. Please review and approve the workflows when free. Thank you!

@DeepeshKafalatiya

Copy link
Copy Markdown
Contributor Author

Hi mentors! I've updated the implementation. The button logic has been cleanly integrated directly into static/script.js to ensure the global selectedSkills array tracker is completely wiped alongside the UI elements on click. It is working flawlessly now and ready for review!

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good contribution overall. Adding a Reset/Clear Filters button is a practical UX improvement that makes the search workflow smoother and more user-friendly, especially when multiple filters are applied.

The feature is well-scoped, useful, and fits naturally into the existing filtering system without introducing unnecessary complexity.

Minor future considerations would be ensuring all filter states/search inputs reset consistently and verifying keyboard accessibility behavior, but the current implementation looks solid and merge-ready.

Approved for merge.

@komalharshita
komalharshita merged commit cdcad82 into komalharshita:main May 19, 2026
7 of 8 checks passed
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.

[Enhancement]: Add a "Reset/Clear Filters" button to the project search form for better UX

2 participants