From 32f51101cfd6c7dff10af99d87c089765ceddc5f Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 22:54:29 +0530 Subject: [PATCH 01/12] Fixed bug #1: the form submit listener now calls handleAddCheck correctly in --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 5dc8d87..8f3a251 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,5 @@ const STORAGE_SAVE_KEY = "launchdesk-v1-items"; -const STORAGE_LOAD_KEY = "launchdesk-items-v1"; // Intentional bug: this key should match STORAGE_SAVE_KEY. +const STORAGE_LOAD_KEY = "launchdesk-v1-items"; const demoChecks = [ { @@ -91,7 +91,7 @@ const activityLog = document.getElementById("activityLog"); let checks = loadChecks(); let currentView = checks; -form.addEventListener("submit", (event) => handleAddChek(event)); // Intentional bug: misspelled function name. +form.addEventListener("submit", (event) => handleAddCheck(event)); searchInput.addEventListener("input", applyFilters); statusFilter.addEventListener("change", applyFilters); priorityFilter.addEventListener("change", applyFilters); From f6cd1aaecf43d3b1bbfffee7450a15c36a939937 Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 22:59:16 +0530 Subject: [PATCH 02/12] Fixed bug #3: the add-check flow now blocks submission when either title or category is missing in --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 8f3a251..d983db5 100644 --- a/js/app.js +++ b/js/app.js @@ -132,8 +132,8 @@ function handleAddCheck(event) { const owner = ownerInput.value.trim() || "Unassigned"; const dueDate = dueDateInput.value || new Date().toISOString().slice(0, 10); - if (!title && !category) { - // Intentional bug: validation should stop when either required field is missing. + if (!title || !category) { + // Required fields must both be provided. formMessage.textContent = "Please enter a check title and choose a category."; return; From 202b4e74803f444ef2c9d2797f96e82d97359e3e Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:00:35 +0530 Subject: [PATCH 03/12] Fixed bug #4: the search now checks title, category, priority, status, and owner in app.js. --- js/app.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index d983db5..d212c87 100644 --- a/js/app.js +++ b/js/app.js @@ -164,12 +164,21 @@ function applyFilters() { const selectedPriority = priorityFilter.value; let filtered = checks.filter((check) => - check.owner.toLowerCase().includes(searchTerm), - ); // Intentional bug: search should include title, category, priority, status, and owner. + [ + check.title, + check.category, + check.priority, + check.status, + check.owner, + ] + .join(" ") + .toLowerCase() + .includes(searchTerm), + ); if (selectedStatus !== "All") { - filtered = filtered.filter((check) => check.priority === selectedStatus); - } // Intentional bug: status filter compares against priority. + filtered = filtered.filter((check) => check.status === selectedStatus); + } if (selectedPriority !== "All") { filtered = filtered.filter((check) => check.priority === selectedPriority); From abe39a7936db70a8a7592289f662b03d6d443332 Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:03:48 +0530 Subject: [PATCH 04/12] Bug #5 is fixed in app.js: the status filter now compares check.status === selectedStatus instead of incorrectly matching check.priority. --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index d212c87..1159cb9 100644 --- a/js/app.js +++ b/js/app.js @@ -1,6 +1,6 @@ const STORAGE_SAVE_KEY = "launchdesk-v1-items"; const STORAGE_LOAD_KEY = "launchdesk-v1-items"; - +// fixed const demoChecks = [ { id: 201, From 9e5860df7d6a8e20a57bb69e1a74dfa72335e15a Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:04:48 +0530 Subject: [PATCH 05/12] Fixed bug #6: status classes now slugify multi-word values like In Progress in app.js. Co-authored-by: Copilot --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 1159cb9..cd989a6 100644 --- a/js/app.js +++ b/js/app.js @@ -200,7 +200,7 @@ function renderRows(list) { const rows = list.map((check) => { const priorityClass = `priority-${check.priority.toLowerCase()}`; - const statusClass = `status-${check.status.toLowerCase()}`; // Intentional bug: "In Progress" needs a slug class. + const statusClass = `status-${check.status.toLowerCase().replaceAll(" ", "-")}`; return ` From dc99828e1cb8ce1edb0ca9372a5ada2ec9faefac Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:10:54 +0530 Subject: [PATCH 06/12] Fixed bug #7: updateMetrics() now counts check.status === "Fixed" in app.js. Co-authored-by: Copilot --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index cd989a6..9a63930 100644 --- a/js/app.js +++ b/js/app.js @@ -240,7 +240,7 @@ function renderRows(list) { function updateMetrics() { const total = checks.length; - const fixed = checks.filter((check) => check.status === "Complete").length; // Intentional bug: valid fixed status is "Fixed". + const fixed = checks.filter((check) => check.status === "Fixed").length; const criticalOpen = checks.filter( (check) => check.priority === "Critical" && check.status !== "Fixed", ).length; From 82b9288e5bf576a5eb6a3ceed8d53457eafd795b Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:11:37 +0530 Subject: [PATCH 07/12] Fixed bug #8: updateMetrics() now counts items due within 7 days in app.js Co-authored-by: Copilot --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 9a63930..932fe5e 100644 --- a/js/app.js +++ b/js/app.js @@ -244,7 +244,7 @@ function updateMetrics() { const criticalOpen = checks.filter( (check) => check.priority === "Critical" && check.status !== "Fixed", ).length; - const dueSoon = checks.filter((check) => daysUntil(check.dueDate) > 7).length; // Intentional bug: this should count items due within 7 days. + const dueSoon = checks.filter((check) => daysUntil(check.dueDate) <= 7).length; const score = total === 0 ? 0 : Math.round((fixed / total) * 100); totalCount.textContent = total; From b6feae1098c0b700931742b9cbc5289e1b2e38a0 Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:12:17 +0530 Subject: [PATCH 08/12] Fixed bug #9: handleTableClick() now matches the delete button's data-remove-id attribute in app.js. Co-authored-by: Copilot --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 932fe5e..10bffa2 100644 --- a/js/app.js +++ b/js/app.js @@ -256,13 +256,13 @@ function updateMetrics() { } function handleTableClick(event) { - const deleteButton = event.target.closest("[data-delete-id]"); // Intentional bug: button uses data-remove-id. + const deleteButton = event.target.closest("[data-remove-id]"); if (!deleteButton) { return; } - const id = Number(deleteButton.dataset.deleteId); + const id = Number(deleteButton.dataset.removeId); const removed = checks.find((check) => check.id === id); checks = checks.filter((check) => check.id !== id); saveChecks(); From ce47cb2d2aedd0c84dfdb0032f5e761f8b7bdbcd Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:13:12 +0530 Subject: [PATCH 09/12] Fixed bug #10: handleStatusChange() now saves changes, reapplies filters, and refreshes metrics in app.js. Co-authored-by: Copilot --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 10bffa2..ab65a50 100644 --- a/js/app.js +++ b/js/app.js @@ -285,9 +285,9 @@ function handleStatusChange(event) { } check.status = statusSelect.value; - renderRows(currentView); + saveChecks(); + applyFilters(); logActivity(`Changed "${check.title}" to ${check.status}.`); - // Intentional bug: status changes should save, update filters, and refresh metrics. } async function resetDemoData() { From 031ac8e91c414b10a98c364e46b23b4b95d5900b Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:13:43 +0530 Subject: [PATCH 10/12] Fixed bug #11: resetDemoData() now fetches the correct JSON file in app.js. Co-authored-by: Copilot --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index ab65a50..7ab7d98 100644 --- a/js/app.js +++ b/js/app.js @@ -294,7 +294,7 @@ async function resetDemoData() { formMessage.textContent = ""; try { - const response = await fetch("data/launch-seed.json"); // Intentional bug: real file is data/launch-checks.json. + const response = await fetch("data/launch-checks.json"); if (!response.ok) { throw new Error(`Demo data request failed with ${response.status}`); From 06948f22cef61b1ebe8a97f8612362a8008c9cd8 Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:14:17 +0530 Subject: [PATCH 11/12] Fixed bug #12: exportCsv() now exports check.title instead of check.name in app.js. Co-authored-by: Copilot --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 7ab7d98..1970d7b 100644 --- a/js/app.js +++ b/js/app.js @@ -321,7 +321,7 @@ function exportCsv() { "Due Date", ]; const rows = currentView.map((check) => [ - check.name, // Intentional bug: property should be check.title. + check.title, check.category, check.priority, check.status, From f9d316a10103700a5d68f012499f1723ff62b5cd Mon Sep 17 00:00:00 2001 From: shathulan Date: Sat, 9 May 2026 23:31:57 +0530 Subject: [PATCH 12/12] fix:final version all done and dusted --- js/app.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/js/app.js b/js/app.js index 1970d7b..c064b19 100644 --- a/js/app.js +++ b/js/app.js @@ -1,6 +1,6 @@ const STORAGE_SAVE_KEY = "launchdesk-v1-items"; const STORAGE_LOAD_KEY = "launchdesk-v1-items"; -// fixed + const demoChecks = [ { id: 201, @@ -91,7 +91,7 @@ const activityLog = document.getElementById("activityLog"); let checks = loadChecks(); let currentView = checks; -form.addEventListener("submit", (event) => handleAddCheck(event)); +form.addEventListener("submit", (event) => handleAddCheck(event)); // Intentional bug: misspelled function name. searchInput.addEventListener("input", applyFilters); statusFilter.addEventListener("change", applyFilters); priorityFilter.addEventListener("change", applyFilters); @@ -163,17 +163,13 @@ function applyFilters() { const selectedStatus = statusFilter.value; const selectedPriority = priorityFilter.value; - let filtered = checks.filter((check) => - [ - check.title, - check.category, - check.priority, - check.status, - check.owner, - ] - .join(" ") - .toLowerCase() - .includes(searchTerm), + let filtered = checks.filter( + (check) => + check.title.toLowerCase().includes(searchTerm) || + check.category.toLowerCase().includes(searchTerm) || + check.priority.toLowerCase().includes(searchTerm) || + check.status.toLowerCase().includes(searchTerm) || + check.owner.toLowerCase().includes(searchTerm), ); if (selectedStatus !== "All") { @@ -244,7 +240,10 @@ function updateMetrics() { const criticalOpen = checks.filter( (check) => check.priority === "Critical" && check.status !== "Fixed", ).length; - const dueSoon = checks.filter((check) => daysUntil(check.dueDate) <= 7).length; + const dueSoon = checks.filter((check) => { + const days = daysUntil(check.dueDate); + return days >= 0 && days <= 7; + }).length; const score = total === 0 ? 0 : Math.round((fixed / total) * 100); totalCount.textContent = total;