From 0c6d6bd24c825299f6f18b11a63e81b3dbfef534 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:01:06 +0530 Subject: [PATCH 01/12] Fix Typo in handleAddCheck --- js/app.js | 2 +- package-lock.json | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/js/app.js b/js/app.js index 5dc8d87..ccb58a5 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)); // Intentional bug: misspelled function name. searchInput.addEventListener("input", applyFilters); statusFilter.addEventListener("change", applyFilters); priorityFilter.addEventListener("change", applyFilters); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6a2d5d9 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,12 @@ +{ + "name": "launchdesk-debugging-lab", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "launchdesk-debugging-lab", + "version": "1.0.0" + } + } +} From 2c3f38cbd3b4eaeecde276fda88d0b5ba8f1fcc8 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:07:23 +0530 Subject: [PATCH 02/12] Fixed Validation Condition --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index ccb58a5..991345e 100644 --- a/js/app.js +++ b/js/app.js @@ -132,7 +132,7 @@ function handleAddCheck(event) { const owner = ownerInput.value.trim() || "Unassigned"; const dueDate = dueDateInput.value || new Date().toISOString().slice(0, 10); - if (!title && !category) { + if (!title || !category) { // Intentional bug: validation should stop when either required field is missing. formMessage.textContent = "Please enter a check title and choose a category."; From 34e52e234dccf52a32520db285630f22af6e5dbc Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:13:33 +0530 Subject: [PATCH 03/12] change to data-remove-id and removeId in handleTableClick func. --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 991345e..4b831f4 100644 --- a/js/app.js +++ b/js/app.js @@ -247,13 +247,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]"); // Intentional bug: button uses 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 723f47c9a1ff875ea6f56ad9206f46cbf5429b9f Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:21:57 +0530 Subject: [PATCH 04/12] Fixed search issue in status filter --- js/app.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/app.js b/js/app.js index 4b831f4..b939fc7 100644 --- a/js/app.js +++ b/js/app.js @@ -164,11 +164,15 @@ 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.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") { - filtered = filtered.filter((check) => check.priority === selectedStatus); + filtered = filtered.filter((check) => check.status === selectedStatus); } // Intentional bug: status filter compares against priority. if (selectedPriority !== "All") { @@ -278,6 +282,9 @@ function handleStatusChange(event) { check.status = statusSelect.value; renderRows(currentView); logActivity(`Changed "${check.title}" to ${check.status}.`); + saveChecks(); + applyFilters(); + updateMetrics(); // Intentional bug: status changes should save, update filters, and refresh metrics. } From 5de4790516d81e97fa292a382a632ae093f758ec Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:34:03 +0530 Subject: [PATCH 05/12] Changed json file name correctly --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index b939fc7..3794cc1 100644 --- a/js/app.js +++ b/js/app.js @@ -292,7 +292,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"); // Intentional bug: real file is data/launch-checks.json. if (!response.ok) { throw new Error(`Demo data request failed with ${response.status}`); From 2074f7822944fefec07293716b87d93c47e00871 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Sun, 10 May 2026 23:36:18 +0530 Subject: [PATCH 06/12] Property changed to check.title --- js/app.js | 2 +- launchdesk-checks (1).csv | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 launchdesk-checks (1).csv diff --git a/js/app.js b/js/app.js index 3794cc1..c585e5b 100644 --- a/js/app.js +++ b/js/app.js @@ -319,7 +319,7 @@ function exportCsv() { "Due Date", ]; const rows = currentView.map((check) => [ - check.name, // Intentional bug: property should be check.title. + check.title, // Intentional bug: property should be check.title. check.category, check.priority, check.status, diff --git a/launchdesk-checks (1).csv b/launchdesk-checks (1).csv new file mode 100644 index 0000000..f4f47d7 --- /dev/null +++ b/launchdesk-checks (1).csv @@ -0,0 +1,7 @@ +"Title","Category","Priority","Status","Owner","Due Date" +"Contact form tested","Frontend","Critical","Pending","Naveen","2026-05-04" +"Homepage meta title added","SEO","High","Fixed","Amani","2026-05-02" +"Mobile navigation checked","QA","High","In Progress","Dilan","2026-05-03" +"SSL certificate verified","Security","Critical","Blocked","Mira","2026-05-01" +"Image compression pass complete","Performance","Medium","Pending","Raveen","2026-05-05" +"Privacy policy linked in footer","Content","Low","Fixed","Ishara","2026-05-06" \ No newline at end of file From da7489810a7eb2888e8c25fdf9ed11c591e10fbb Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 00:08:57 +0530 Subject: [PATCH 07/12] Changed name to Fixed instead of Complete --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index c585e5b..27afc6e 100644 --- a/js/app.js +++ b/js/app.js @@ -235,7 +235,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; // Intentional bug: valid fixed status is "Fixed". const criticalOpen = checks.filter( (check) => check.priority === "Critical" && check.status !== "Fixed", ).length; From 8a7c5b4d9c4c3dd2666b37f9a734a0fcef9d676a Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 00:13:06 +0530 Subject: [PATCH 08/12] Fixed count items due within 7 days --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 27afc6e..37f3b3b 100644 --- a/js/app.js +++ b/js/app.js @@ -239,7 +239,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; // Intentional bug: this should count items due within 7 days. const score = total === 0 ? 0 : Math.round((fixed / total) * 100); totalCount.textContent = total; From aea78eb95a38329f5b3cffda9061d7f95c5020cd Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 00:45:21 +0530 Subject: [PATCH 09/12] Fixed LocalStorage keys mismatch --- js/app.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/app.js b/js/app.js index 37f3b3b..56e0140 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. +// Fixed:Intentional bug: this key should match STORAGE_SAVE_KEY. const demoChecks = [ { @@ -91,7 +91,7 @@ const activityLog = document.getElementById("activityLog"); let checks = loadChecks(); let currentView = checks; -form.addEventListener("submit", (event) => handleAddCheck(event)); // Intentional bug: misspelled function name. +form.addEventListener("submit", (event) => handleAddCheck(event)); // Fixed:Intentional bug: misspelled function name. searchInput.addEventListener("input", applyFilters); statusFilter.addEventListener("change", applyFilters); priorityFilter.addEventListener("change", applyFilters); @@ -104,7 +104,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_SAVE_KEY); if (!saved) { return [...demoChecks]; @@ -133,7 +133,7 @@ function handleAddCheck(event) { const dueDate = dueDateInput.value || new Date().toISOString().slice(0, 10); if (!title || !category) { - // Intentional bug: validation should stop when either required field is missing. + // Fixed:Intentional bug: validation should stop when either required field is missing. formMessage.textContent = "Please enter a check title and choose a category."; return; @@ -173,7 +173,7 @@ function applyFilters() { if (selectedStatus !== "All") { filtered = filtered.filter((check) => check.status === selectedStatus); - } // Intentional bug: status filter compares against priority. + } // Fixed:Intentional bug: status filter compares against priority. if (selectedPriority !== "All") { filtered = filtered.filter((check) => check.priority === selectedPriority); @@ -195,7 +195,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()}`; // Fixed:Intentional bug: "In Progress" needs a slug class. return ` @@ -235,11 +235,11 @@ function renderRows(list) { function updateMetrics() { const total = checks.length; - const fixed = checks.filter((check) => check.status === "Fixed").length; // Intentional bug: valid fixed status is "Fixed". + const fixed = checks.filter((check) => check.status === "Fixed").length; // Fixed:Intentional bug: valid fixed status is "Fixed". 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; // Fixed:Intentional bug: this should count items due within 7 days. const score = total === 0 ? 0 : Math.round((fixed / total) * 100); totalCount.textContent = total; @@ -251,7 +251,7 @@ function updateMetrics() { } function handleTableClick(event) { - const deleteButton = event.target.closest("[data-remove-id]"); // Intentional bug: button uses data-remove-id. + const deleteButton = event.target.closest("[data-remove-id]"); // Fixed:Intentional bug: button uses data-remove-id. if (!deleteButton) { return; @@ -285,14 +285,14 @@ function handleStatusChange(event) { saveChecks(); applyFilters(); updateMetrics(); - // Intentional bug: status changes should save, update filters, and refresh metrics. + // Fixed:Intentional bug: status changes should save, update filters, and refresh metrics. } async function resetDemoData() { formMessage.textContent = ""; try { - const response = await fetch("data/launch-checks.json"); // Intentional bug: real file is data/launch-checks.json. + const response = await fetch("data/launch-checks.json"); // Fixed:Intentional bug: real file is data/launch-checks.json. if (!response.ok) { throw new Error(`Demo data request failed with ${response.status}`); @@ -319,7 +319,7 @@ function exportCsv() { "Due Date", ]; const rows = currentView.map((check) => [ - check.title, // Intentional bug: property should be check.title. + check.title, // Fixed:Intentional bug: property should be check.title. check.category, check.priority, check.status, From 90a8d99d3f368c669a26d8b60ad9e18de81b7eb5 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 00:53:01 +0530 Subject: [PATCH 10/12] Fixed status class break for In progress & Due soon calculation bug --- js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 56e0140..2de8c14 100644 --- a/js/app.js +++ b/js/app.js @@ -195,7 +195,7 @@ function renderRows(list) { const rows = list.map((check) => { const priorityClass = `priority-${check.priority.toLowerCase()}`; - const statusClass = `status-${check.status.toLowerCase()}`; // Fixed:Intentional bug: "In Progress" needs a slug class. + const statusClass = `status-${check.status.toLowerCase().replace(" ", "-")}`; // Fixed:Intentional bug: "In Progress" needs a slug class. return ` @@ -239,7 +239,11 @@ function updateMetrics() { const criticalOpen = checks.filter( (check) => check.priority === "Critical" && check.status !== "Fixed", ).length; - const dueSoon = checks.filter((check) => daysUntil(check.dueDate) <= 7).length; // Fixed: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; // Fixed:Intentional bug: this should count items due within 7 days. + const score = total === 0 ? 0 : Math.round((fixed / total) * 100); totalCount.textContent = total; From ae59a9263f03c2f53dea9ca2d772840ca9b6f664 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 01:20:16 +0530 Subject: [PATCH 11/12] Modified - Date calculations affected by timezones --- js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/app.js b/js/app.js index 2de8c14..e0afa7e 100644 --- a/js/app.js +++ b/js/app.js @@ -360,7 +360,11 @@ function logActivity(message) { function daysUntil(dateValue) { const today = new Date(); + today.setHours(0, 0, 0, 0); + const target = new Date(dateValue); + target.setHours(0, 0, 0, 0); + const difference = target.getTime() - today.getTime(); return Math.ceil(difference / 86400000); } From 21e699d67832a7c7dab3fe06f15d2378ea241ef3 Mon Sep 17 00:00:00 2001 From: CharithGDR Date: Mon, 11 May 2026 14:32:41 +0530 Subject: [PATCH 12/12] Fixed my mistake in the code --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index e0afa7e..6f739ce 100644 --- a/js/app.js +++ b/js/app.js @@ -365,7 +365,7 @@ function daysUntil(dateValue) { const target = new Date(dateValue); target.setHours(0, 0, 0, 0); - const difference = target.getTime() - today.getTime(); + const difference = target - today; return Math.ceil(difference / 86400000); }