Skip to content

fix: resolve multiple core logic and UI bugs in launch readiness checker#7

Open
Madushan Sandakelum (CillianCoder) wants to merge 10 commits into
codezelaca:mainfrom
CillianCoder:main
Open

fix: resolve multiple core logic and UI bugs in launch readiness checker#7
Madushan Sandakelum (CillianCoder) wants to merge 10 commits into
codezelaca:mainfrom
CillianCoder:main

Conversation

@CillianCoder
Copy link
Copy Markdown

@CillianCoder Madushan Sandakelum (CillianCoder) commented May 11, 2026

This PR addresses several intentional bugs identified in the application, improving data persistence, search functionality, and UI consistency.

Key Changes:

Data Persistence: Fixed the STORAGE_LOAD_KEY to match the save key, ensuring user data persists across sessions.

Search & Filtering: Updated applyFilters to include all relevant fields (title, category, priority, status, and owner) and corrected the status filter logic.

UI/UX Logic: * Fixed the status badge CSS class mapping for "In Progress" items.

Corrected the "Fixed" status check and "Due Soon" date calculation in the metrics dashboard.

Fixed the delete button and reset button functionality.

Bug Fixes: Resolved function name typos (e.g., handleAddCheck) and form validation logic to ensure required fields are handled correctly.

Environment: Updated package.json scripts to use the standard Python command for the local dev server.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed checklist persistence and loading
    • Corrected status filtering for accurate item matching
    • Fixed delete button functionality
  • New Features

    • Enhanced search now matches across multiple fields (owner, category, priority, status, title)
    • Status changes now persist automatically
  • Improvements

    • Updated "due soon" metrics to count items due within 7 days
    • Improved status label styling

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Multiple behavioral corrections across a checklist application including localStorage persistence alignment, form validation fixes, expanded search filtering, status filter correction, CSS class slugification, UI attribute alignment, metrics calculation adjustments, status persistence flow, data import path updates, and CSV export field mapping.

Changes

Checklist Persistence and Feature Corrections

Layer / File(s) Summary
Data Persistence Load Key
js/app.js
LocalStorage load key is aligned to match the save key for consistent persistence behavior.
Form Input Validation and Event Wiring
js/app.js
Form submit handler is wired to the correct add-check function, and validation is corrected to reject when either title or category is missing.
Search and Filter Logic
js/app.js
Free-text search now matches across multiple checklist fields (owner, category, priority, status, title), and status filter is corrected to compare against each item's status value.
Row Rendering and UI Attributes
js/app.js
Status CSS class generation slugifies spaces (e.g., "In Progress" to valid class), and delete button uses corrected data-delete-id attribute instead of previous key.
Metrics Display Calculation
js/app.js
"Fixed" count is derived from status === "Fixed", and "due soon" count is updated to count items due within 7 days.
Status Change Persistence
js/app.js
Status changes now save checks and re-apply filters immediately rather than re-rendering directly.
Data Import and Export Operations
js/app.js
Demo reset fetches from updated JSON path (data/launch-checks.json), and CSV export reads title from check.title instead of check.name.
Development Tooling Configuration
package.json
Dev and start scripts updated to use python instead of python3 for HTTP server invocation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Our checks now persist with matching keys,

Search spans wide, filters fix with ease,

CSS slugs smooth the status display,

Metrics count true, export saves the day! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: fixing multiple core logic and UI bugs in the launch readiness checker application, which aligns with the comprehensive set of changes documented in the PR objectives and file summaries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@js/app.js`:
- Line 2: Remove the stale "Intentional bug" comments that now misdescribe
correct behavior: search for occurrences of the text "Intentional bug" and
either delete them or rewrite them to accurately describe the current code
(e.g., change the comment on STORAGE_LOAD_KEY to simply document the key name
instead of calling it an intentional bug, and update the validation comment near
validateForm/validateFields to describe what the function actually enforces).
Apply the same cleanup to other markers referencing storage keys
(STORAGE_SAVE_KEY), form validation (validateForm / validateFields), and any
other nearby symbols so comments describe present behavior rather than
historical bugs.
- Line 243: The dueSoon filter incorrectly includes overdue items because it
only checks daysUntil(check.dueDate) < 7; update the filter used by dueSoon (and
the other similar filters around the block using daysUntil) to add a lower
bound, e.g. require daysUntil(check.dueDate) >= 0 and <= 7 (or <=6 if you want
an exclusive 7th day), and also review the daysUntil(date) implementation to
return whole-day differences consistently (use floor or normalize both dates to
midnight/UTC) to remove the current asymmetry caused by Math.ceil.

In `@package.json`:
- Around line 7-8: Update the package.json npm scripts to use "python3" instead
of "python" for the "dev" and "start" script entries so the commands ("dev" and
"start") work on macOS and Linux systems where only python3 is available; locate
the "dev" and "start" script values and replace the executable name from python
to python3 while keeping the rest of the command ("-m http.server 5173")
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 49ec053d-7d8d-4209-8eff-67cdb4da90c0

📥 Commits

Reviewing files that changed from the base of the PR and between ccb0d19 and 7254ac5.

📒 Files selected for processing (2)
  • js/app.js
  • package.json

Comment thread 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"; // Intentional bug: this key should match STORAGE_SAVE_KEY.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Remove the stale // Intentional bug: comments — they now describe the fixed behavior and will mislead future readers.

After the fixes in this PR, every "Intentional bug" comment is no longer true. They were useful as bug markers in the original lab scaffold, but in the corrected code they now read as instructions to re-introduce the bug (e.g., line 136 says "validation should stop when either required field is missing" — which is exactly what the code now does, so the comment reads as a complaint about correct code). The same applies to lines 2, 94, 173, 177, 199, 239, 243, 255, 287, 294, and 321.

Sweep the file and remove (or rewrite) these markers so the remaining comments describe what the code is, not the historical bug.

♻️ Representative cleanups
-const STORAGE_LOAD_KEY = "launchdesk-v1-items"; // Intentional bug: this key should match STORAGE_SAVE_KEY.
+const STORAGE_LOAD_KEY = STORAGE_SAVE_KEY;
-form.addEventListener("submit", (event) => handleAddCheck(event)); // Intentional bug: misspelled function name.
+form.addEventListener("submit", handleAddCheck);
-  if (!title || !category) {
-    // Intentional bug: validation should stop when either required field is missing.
+  if (!title || !category) {
-  ); // Intentional bug: search should include title, category, priority, status, and owner.
+  );
-  } // Intentional bug: status filter compares against priority.
+  }
-    const statusClass = `status-${check.status.toLowerCase().replaceAll(" ", "-")}`; // Intentional bug: "In Progress" needs a slug class.
+    const statusClass = `status-${check.status.toLowerCase().replaceAll(" ", "-")}`;
-  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;
-  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 deleteButton = event.target.closest("[data-delete-id]"); // Intentional bug: button uses data-remove-id.
+  const deleteButton = event.target.closest("[data-delete-id]");
   logActivity(`Changed "${check.title}" to ${check.status}.`);
-  // Intentional bug: status changes should save, update filters, and refresh metrics.
 }
-    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");
-    check.title, // Intentional bug: property should be check.title.
+    check.title,

Also applies to: 94-94, 135-140, 173-173, 177-177, 199-199, 239-239, 243-243, 255-255, 287-288, 294-294, 321-321

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@js/app.js` at line 2, Remove the stale "Intentional bug" comments that now
misdescribe correct behavior: search for occurrences of the text "Intentional
bug" and either delete them or rewrite them to accurately describe the current
code (e.g., change the comment on STORAGE_LOAD_KEY to simply document the key
name instead of calling it an intentional bug, and update the validation comment
near validateForm/validateFields to describe what the function actually
enforces). Apply the same cleanup to other markers referencing storage keys
(STORAGE_SAVE_KEY), form validation (validateForm / validateFields), and any
other nearby symbols so comments describe present behavior rather than
historical bugs.

Comment thread js/app.js
(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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

"Due Soon" still counts overdue items.

daysUntil(check.dueDate) < 7 evaluates to true for any past-due item (negative result), so overdue checks are bundled into the "Due Soon" metric. Combined with Math.ceil in daysUntil, you also get an asymmetric boundary: an item due exactly 7 calendar days from now (depending on local time vs. the UTC midnight parsed from YYYY-MM-DD) may or may not be counted.

If the intent is "due in the next 7 days" only, add a lower bound; if "overdue or due within 7 days" is intentional, consider renaming the label so the dashboard isn't ambiguous.

🛠️ Suggested fix
-  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;

Also applies to: 356-361

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@js/app.js` at line 243, The dueSoon filter incorrectly includes overdue items
because it only checks daysUntil(check.dueDate) < 7; update the filter used by
dueSoon (and the other similar filters around the block using daysUntil) to add
a lower bound, e.g. require daysUntil(check.dueDate) >= 0 and <= 7 (or <=6 if
you want an exclusive 7th day), and also review the daysUntil(date)
implementation to return whole-day differences consistently (use floor or
normalize both dates to midnight/UTC) to remove the current asymmetry caused by
Math.ceil.

Comment thread package.json
Comment on lines +7 to +8
"dev": "python -m http.server 5173",
"start": "python -m http.server 5173"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Is python or python3 the standard executable name on macOS 14 and Ubuntu 22.04 by default in 2025?

💡 Result:

On macOS 14 (macOS Sonoma), the standard/Apple-provided executable name is python3 (e.g., /usr/bin/python3). There is no general guarantee that python (without 3) is present or points to Python 3 by default; many systems only provide python3 and recommend not relying on python. [1] On Ubuntu 22.04, the standard OS-provided executable name is also python3 by default (/usr/bin/python3 points to a specific Python 3.x via a symlink). In contrast, the python command (without 3) is typically not available as a default Python 3 interpreter unless the system admin installs/configures a compatibility package (e.g., python-is-python3) or creates alternatives/symlinks. [2][3] So, in 2025 for those defaults: prefer python3 on both macOS 14 and Ubuntu 22.04; python is not the default “standard” executable name in general. [1][2][3]

Citations:


Revert python to python3 for cross-platform compatibility.

Using python instead of python3 breaks portability. On macOS 14 and Ubuntu 22.04 (both common in contributor setups), python is not available by default—only python3 is provided. Most contributors will encounter python: command not found when running npm run dev.

Suggested change
-    "dev": "python -m http.server 5173",
-    "start": "python -m http.server 5173"
+    "dev": "python3 -m http.server 5173",
+    "start": "python3 -m http.server 5173"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dev": "python -m http.server 5173",
"start": "python -m http.server 5173"
"dev": "python3 -m http.server 5173",
"start": "python3 -m http.server 5173"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 7 - 8, Update the package.json npm scripts to use
"python3" instead of "python" for the "dev" and "start" script entries so the
commands ("dev" and "start") work on macOS and Linux systems where only python3
is available; locate the "dev" and "start" script values and replace the
executable name from python to python3 while keeping the rest of the command
("-m http.server 5173") unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant