From 57785cf335ee678eab6dc0deebcfbca73dfb8c8f Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 18:36:45 +0530 Subject: [PATCH 01/12] fix: correct typo in submit event handler function name. --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 5dc8d87..dae025b 100644 --- a/js/app.js +++ b/js/app.js @@ -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 ad5da6d904b22af2de2c4cec5f55655540f8ed23 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 18:44:52 +0530 Subject: [PATCH 02/12] fix: require both title and category before submitting. --- js/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index dae025b..febbc4f 100644 --- a/js/app.js +++ b/js/app.js @@ -132,8 +132,7 @@ 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) { formMessage.textContent = "Please enter a check title and choose a category."; return; From ab9c6bffcd75032e633e609d451c272f228fee49 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:11:39 +0530 Subject: [PATCH 03/12] fix: search across all fields instead of owner only. --- js/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index febbc4f..23b5304 100644 --- a/js/app.js +++ b/js/app.js @@ -163,7 +163,11 @@ function applyFilters() { const selectedPriority = priorityFilter.value; let filtered = checks.filter((check) => - check.owner.toLowerCase().includes(searchTerm), + check.owner.toLowerCase().includes(searchTerm) || + check.title.toLowerCase().includes(searchTerm) || + check.category.toLowerCase().includes(searchTerm) || + check.priority.toLowerCase().includes(searchTerm) || + check.status.toLowerCase().includes(searchTerm), ); // Intentional bug: search should include title, category, priority, status, and owner. if (selectedStatus !== "All") { From ae8ceca0918ba3c292f952e92a616a1d9dc74fd1 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:14:44 +0530 Subject: [PATCH 04/12] fix: compare status field instead of priority in status filter. --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 23b5304..b677faf 100644 --- a/js/app.js +++ b/js/app.js @@ -168,10 +168,10 @@ function applyFilters() { check.category.toLowerCase().includes(searchTerm) || check.priority.toLowerCase().includes(searchTerm) || check.status.toLowerCase().includes(searchTerm), - ); // Intentional bug: search should include title, category, priority, status, and owner. + ); if (selectedStatus !== "All") { - filtered = filtered.filter((check) => check.priority === selectedStatus); + filtered = filtered.filter((check) => check.status === selectedStatus); } // Intentional bug: status filter compares against priority. if (selectedPriority !== "All") { From 55d51f0d57875dd50653bd76b8d6cad8a4becedc Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:27:38 +0530 Subject: [PATCH 05/12] fix: replace spaces with hyphens in status badge class names. --- js/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index b677faf..6324224 100644 --- a/js/app.js +++ b/js/app.js @@ -194,8 +194,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 a9a5935d5be0c3b8a69645d5e9388095738a4a55 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:36:04 +0530 Subject: [PATCH 06/12] fix: count Fixed status correctly in readiness score calculation. --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 6324224..80ff5d6 100644 --- a/js/app.js +++ b/js/app.js @@ -172,7 +172,7 @@ function applyFilters() { if (selectedStatus !== "All") { filtered = filtered.filter((check) => check.status === selectedStatus); - } // Intentional bug: status filter compares against priority. + } if (selectedPriority !== "All") { filtered = filtered.filter((check) => check.priority === selectedPriority); @@ -233,7 +233,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 caa44cfa5c9a261468119e6bb66f1dee816fa262 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:43:51 +0530 Subject: [PATCH 07/12] fix: fix Due This Week filter to count items due within 7 days. --- js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 80ff5d6..2122f1b 100644 --- a/js/app.js +++ b/js/app.js @@ -237,7 +237,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; // Intentional bug: this should count items due within 7 days. + 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; From dddf292c616fb362da0feb71e2b977ffc786a73e Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 20:51:08 +0530 Subject: [PATCH 08/12] fix: align JS data attribute selector with HTML data-remove-id --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 2122f1b..8578c25 100644 --- a/js/app.js +++ b/js/app.js @@ -252,13 +252,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 50939c8227f23664d6dcf74b12a4428c988943ce Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 21:00:36 +0530 Subject: [PATCH 09/12] fix: persist and re-evaluate full app state on status change. --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 8578c25..efa9d20 100644 --- a/js/app.js +++ b/js/app.js @@ -281,9 +281,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 e6b14dfd8b742188de01106457910d2dbd21e79f Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 21:09:17 +0530 Subject: [PATCH 10/12] fix: unify save and load keys to prevent data loss on refresh. --- js/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index efa9d20..f2f0e0a 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,4 @@ -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_KEY = "launchdesk-v1-items"; const demoChecks = [ { @@ -104,7 +103,7 @@ renderApp(); logActivity("Demo data loaded. Start by testing the checklist workflows."); function loadChecks() { - const saved = localStorage.getItem(STORAGE_LOAD_KEY); + const saved = localStorage.getItem(STORAGE_KEY); if (!saved) { return [...demoChecks]; @@ -119,7 +118,7 @@ function loadChecks() { } function saveChecks() { - localStorage.setItem(STORAGE_SAVE_KEY, JSON.stringify(checks)); + localStorage.setItem(STORAGE_KEY, JSON.stringify(checks)); } function handleAddCheck(event) { From 4e967b876f6dcfd3fbdb127883a5887cc50aedb4 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 21:13:16 +0530 Subject: [PATCH 11/12] fix: correct fetch path for reset demo from wrong filename to launch-checks.json. --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index f2f0e0a..00c62d3 100644 --- a/js/app.js +++ b/js/app.js @@ -289,7 +289,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 6debec3e64a5a919a3168ed81523ec2bd1b51872 Mon Sep 17 00:00:00 2001 From: Pamindu Virunjith Date: Tue, 12 May 2026 21:16:34 +0530 Subject: [PATCH 12/12] fix: use correct property name for Title column in CSV export. --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 00c62d3..3fe10d1 100644 --- a/js/app.js +++ b/js/app.js @@ -316,7 +316,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,