From bbdcdfe7fc208bc097b00bd6374d177165fddb1f Mon Sep 17 00:00:00 2001 From: Deepesh Kafaltiya Date: Mon, 18 May 2026 21:36:58 +0530 Subject: [PATCH 1/2] feat: add clear filters button to search form for better UX --- templates/index.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 05ad04c1..4288ceaf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -466,10 +466,16 @@

Find Your Next Project

- +
+ + + +
From 2ac75e84f638eea3f40d5b3107f4f5dc9cf5f451 Mon Sep 17 00:00:00 2001 From: Deepesh Kafaltiya Date: Tue, 19 May 2026 11:26:37 +0530 Subject: [PATCH 2/2] fix: clear global selectedSkills array and remove visual chips dynamically --- static/script.js | 33 +++++++++++++++++++++++++++++++++ templates/index.html | 25 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/static/script.js b/static/script.js index d4de2211..7a575796 100644 --- a/static/script.js +++ b/static/script.js @@ -74,6 +74,39 @@ if (isIndexPage) { // Tracks currently selected skills to prevent duplicates var selectedSkills = []; + // Clear Filters Button Functionality +var clearFiltersBtn = document.getElementById("clear-filters-btn"); +if (clearFiltersBtn) { + clearFiltersBtn.addEventListener("click", function() { + var recommendForm = document.getElementById("recommend-form"); + if (recommendForm) { + // 1. Reset standard form dropdowns and fields + recommendForm.reset(); + + // 2. Clear out the internal JavaScript array tracker completely + selectedSkills = []; + + // 3. Clear the hidden inputs and visual chips using the file's own variables + if (skillsHidden) skillsHidden.value = ""; + if (chipsSelectedEl) chipsSelectedEl.innerHTML = ""; + if (skillsTextInput) { + skillsTextInput.value = ""; + skillsTextInput.focus(); // Place cursor back on input + } + + // 4. Hide autocomplete suggestions if any are open + var suggestionsBox = document.getElementById("skills-suggestions"); + if (suggestionsBox) suggestionsBox.innerHTML = ""; + + // 5. Reset quick-pick chip visual active states if they have any + if (quickPickChips) { + quickPickChips.forEach(function(chip) { + chip.classList.remove("active", "selected"); + }); + } + } + }); +} // ---------------------------------------------------------- diff --git a/templates/index.html b/templates/index.html index 4288ceaf..b2214a85 100644 --- a/templates/index.html +++ b/templates/index.html @@ -638,6 +638,31 @@ + + +