From e04196a8d0493b2f84976ccbf2c9cf96f1797eca Mon Sep 17 00:00:00 2001 From: venemouscoder Date: Sun, 15 Feb 2026 00:40:49 +0100 Subject: [PATCH] feat: implement task filtering logic --- public/index.html | 6 +++++- public/script.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index a4e0fac..9891718 100644 --- a/public/index.html +++ b/public/index.html @@ -25,7 +25,11 @@
-
+
+ + + +
diff --git a/public/script.js b/public/script.js index 9c6912e..3db72d4 100644 --- a/public/script.js +++ b/public/script.js @@ -10,3 +10,17 @@ document.addEventListener('DOMContentLoaded', () => { // Load tasks will be called here later (Issue #9) }); +let currentFilter = 'all'; + +function filterTasks(status) { + currentFilter = status; + renderTasks(); +} + +// Note: You must update renderTasks() to respect this filter: +// const filtered = tasks.filter(t => { +// if (currentFilter === 'active') return !t.completed; +// if (currentFilter === 'completed') return t.completed; +// return true; +// }); +