From b6d3cc4e70dc47c62d033b7f6ac4a4f85c6cfa0c Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Tue, 8 Sep 2026 20:57:03 -0400 Subject: [PATCH] Consolidate dashboard clear-filters controls to one shared function (#76) The sidebar's own Clear button cleared status/category/type/dates but never search/priority/assigned_to, while the page-level "Clear All Filters" button cleared a different subset. Neither control alone reliably returned the dashboard to a fully unfiltered state. The sidebar button now delegates to clearAllFilters() so both controls always clear the same complete set of params. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015nCxwFFsy8ouMWzn56rPVP --- assets/js/dashboard.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/assets/js/dashboard.js b/assets/js/dashboard.js index 9b431c7..fca33fd 100644 --- a/assets/js/dashboard.js +++ b/assets/js/dashboard.js @@ -361,14 +361,9 @@ function initSidebarFilters() { } if (clearFiltersBtn) { - clearFiltersBtn.addEventListener('click', () => { - const params = new URLSearchParams(window.location.search); - ['status','category','type', - 'created_from','created_to','updated_from','updated_to','closed_from','closed_to' - ].forEach(k => params.delete(k)); - params.set('page', '1'); - window.location.search = params.toString(); - }); + // Delegate to clearAllFilters() so both controls always clear the same + // complete set of filter params instead of two independently-maintained lists. + clearFiltersBtn.addEventListener('click', clearAllFilters); } }