Skip to content

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement todo-list - #1416

Open
KhotKeys wants to merge 2 commits into
CodeYourFuture:mainfrom
KhotKeys:sprint-3-todo-list
Open

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement todo-list#1416
KhotKeys wants to merge 2 commits into
CodeYourFuture:mainfrom
KhotKeys:sprint-3-todo-list

Conversation

@KhotKeys

@KhotKeys KhotKeys commented Aug 9, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • Implemented addTask to append a new task object to the todos array, deleteTask to remove a task by index if it exists, and toggleCompletedOnTask to flip the completed boolean on a valid task.

  • All three functions handle out-of-range indices gracefully without throwing errors or modifying the array.

@KhotKeys KhotKeys added 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 9, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There don't appear to be any changes listed in the "files changed" tab - what have you added in this PR?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 10, 2026
@KhotKeys
KhotKeys force-pushed the sprint-3-todo-list branch from 42abea3 to ccfb60d Compare August 10, 2026 20:03
@KhotKeys

Copy link
Copy Markdown
Author

There don't appear to be any changes listed in the "files changed" tab - what have you added in this PR?

Apo‍logies fo‌r that! My local branch was misconfigured‍ during the initial push, which cau‍sed the implementation files to get left behind. I have cleanl‍y res‍et the branch history and force-pushed the‌ compl‍ete todo-list solution folder now‌. Please let me know your thoughts!

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's a lot here, probably more than is needed for this task. Did you write all this yourself?

I ran the page through the lighthouse check as it seems quite complex, and it failed the accessibility check - can you figure out why?

Also, the todolist works well, but I can't see which of the features you added that the readme asked about, can you talk me through it?

@KhotKeys
KhotKeys force-pushed the sprint-3-todo-list branch from a78b5bc to 8887c0a Compare August 11, 2026 10:16
@KhotKeys

KhotKeys commented Aug 11, 2026

Copy link
Copy Markdown
Author

There's a lot here, probably more than is needed for this task. Did you write all this yourself?

I ran the page through the lighthouse check as it seems quite complex, and it failed the accessibility check - can you figure out why?

Also, the todolist works well, but I can't see which of the features you added that the readme asked about, can you talk me through it?

Thanks for the feedback‍!

The accessibility issue w‍as that the complete and delete buttons were icon only with no accessible label, so scre‌en rea‍ders couldn't describe them. I've added a‍ria-‍label attributes to both buttons to fix that.

T‍h‌e main feature the README asked for‌ is‌ th‍e "Delete completed tasks" button, which I've now added. It c‍al‍ls a deleteCompleted() function in todo‍s.mjs that remove‌s all comp‌let‍ed tasks at once. I also wrote Jest tests for it covering three ca‍ses: removing completed task‌s, doin‌g nothing when none are completed, and‍ emptying the list‌ when all a‍re completed.

I also fixed a small CSS bug where the icon colors weren't applying because the selec‍tors were ta‍rgeting tags, but the HTML uses

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work so far, one minor thing to fix.

I would suggest avoiding force pushing, developers tend to recommend against doing that as it can cause problems if you are working across multiple machines / in a team.

Comment thread Sprint-3/todo-list/script.mjs Outdated
// Set up tasks to be performed once on page load
window.addEventListener("load", () => {
document.getElementById("add-task-btn").addEventListener("click", addNewTodo);
document.getElementById("delete-completed-btn").addEventListener("click", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Compare this with the event listener above, do you see the difference in code style. Can you make them more consistent?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great, I would say this is complete now!

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants