Launch Desk Debugging Lab - By Sanjoon Charles#12
Conversation
Fix bug 1 (AddCheck)
Fix bug 2 (Title and Category)
Fix bug 3 (Search)
Fix bug 4 (Status Filter)
Fix bug 5 (in-progress)
Bug fix 6 (Readiness Score)
Bug fix 7 (Due Date)
Bug fix 8 (Remove btn)
Bug fix 9 (Reset btn)
Bug fix 10 (Export csv)
Bug fix 11 (Save Check)
Bug fix 12 (STORAGE KEY)
📝 WalkthroughWalkthroughThis PR corrects launch checklist persistence, validation, filtering, metrics, delete/status interactions, demo reset, and CSV export in ChangesLaunch checklist fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
js/app.js (1)
93-93: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueStale scaffolding comment.
The handler now correctly calls
handleAddCheck, but the trailing// Intentional bug: misspelled function name.comment is now misleading. Consider stripping theIntentional bug:comments left on fixed lines (here and lines 135, 171, 175, 197, 237, 241, 253, 285, 292, 319) to avoid confusing future readers.🤖 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 93, The submit handler in the form setup is already correct, but the trailing “Intentional bug” scaffold comment is now misleading. Remove the stale comment from the `form.addEventListener` line and clean up the other fixed `Intentional bug` comments in this file near the corresponding handlers and listeners (`handleAddCheck` and the related event bindings) so the code reflects the actual behavior.
🤖 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`:
- Around line 237-241: The `dueSoon` metric in `app.js` is counting overdue
items because `daysUntil(check.dueDate) <= 7` has no lower bound. Update the
`dueSoon` filter in the checks aggregation to use a 0–7 day window so it only
counts upcoming work, keeping the existing `daysUntil` helper and surrounding
`checks.filter(...)` logic intact.
---
Nitpick comments:
In `@js/app.js`:
- Line 93: The submit handler in the form setup is already correct, but the
trailing “Intentional bug” scaffold comment is now misleading. Remove the stale
comment from the `form.addEventListener` line and clean up the other fixed
`Intentional bug` comments in this file near the corresponding handlers and
listeners (`handleAddCheck` and the related event bindings) so the code reflects
the actual behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| 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; | ||
| 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. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -nC3 -i 'due.?soon|within 7|days' docs/Repository: codezelaca/fs-se-debugging-bugs
Length of output: 2810
🏁 Script executed:
#!/bin/bash
sed -n '168,185p' docs/instructor-solution-guide.md
printf '\n---\n'
sed -n '230,245p' js/app.jsRepository: codezelaca/fs-se-debugging-bugs
Length of output: 1219
🏁 Script executed:
#!/bin/bash
python3 - <<'PY'
from pathlib import Path
text = Path('js/app.js').read_text()
for i, line in enumerate(text.splitlines(), 1):
if 230 <= i <= 245:
print(f"{i}:{line}")
PYRepository: codezelaca/fs-se-debugging-bugs
Length of output: 873
dueSoon should use a 0–7 day window.
daysUntil(check.dueDate) <= 7 also includes overdue items; bound it to non-negative days so the metric only counts upcoming work.
Proposed adjustment
- 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;📝 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.
| 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; | |
| 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 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; | |
| const dueSoon = checks.filter((check) => { | |
| const days = daysUntil(check.dueDate); | |
| return days >= 0 && days <= 7; | |
| }).length; // Intentional bug: this should count items due within 7 days. |
🤖 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` around lines 237 - 241, The `dueSoon` metric in `app.js` is
counting overdue items because `daysUntil(check.dueDate) <= 7` has no lower
bound. Update the `dueSoon` filter in the checks aggregation to use a 0–7 day
window so it only counts upcoming work, keeping the existing `daysUntil` helper
and surrounding `checks.filter(...)` logic intact.
🐞 Bug Fix Summary – All 12 Issues Resolved
This PR fixes all reported bugs in the project and improves overall functionality, consistency, and data handling across the application.
✅ Fixes Included
Fixed typo in add button function name (addChek → addCheck)
Corrected form validation logic so both title and category are required
Aligned local storage keys for consistent save/load behavior
Improved search functionality to support filtering by title, category, priority, status, and owner
Fixed status filter to correctly compare against status instead of priority
Fixed CSS handling for “In Progress” status to ensure proper styling
Updated score calculation logic by correcting status handling
Fixed due-soon counter to accurately count items due within 7 days
Fixed delete button attribute mismatch issue
Corrected demo data reset file path to launch-checks.json
Fixed CSV export mapping from name field to title
Ensured status updates properly trigger saveChecks() and applyFilters() for correct UI refresh
🔧 Improvements
Better consistency in data handling across modules
More accurate filtering and reporting logic
Improved UI reliability for status-based rendering
📌 Notes
All fixes are committed individually as required (1 bug per commit).
Summary by CodeRabbit