Skip to content

London | 26-ITP-May | Gideon Defar | Sprint 2 | Book Library - #558

Open
gideondefar wants to merge 5 commits into
CodeYourFuture:mainfrom
gideondefar:coursework/book-library-debugging
Open

London | 26-ITP-May | Gideon Defar | Sprint 2 | Book Library#558
gideondefar wants to merge 5 commits into
CodeYourFuture:mainfrom
gideondefar:coursework/book-library-debugging

Conversation

@gideondefar

Copy link
Copy Markdown

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

In this PR, i have fixed all the bugs in script.js and refactored the script to be more efficient. I have also validated the html code to ensure it's free of errors.

@gideondefar gideondefar changed the title London | 26-ITP-May | Gideon Defar | Sprint 2 |Book Library London | 26-ITP-May | Gideon Defar | Sprint 2 | Book Library Aug 15, 2026
@gideondefar gideondefar added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Flows The name of the module. Core This is a core task and should be completed by all trainees labels Aug 15, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to https://validator.w3.org/, there are errors in your index.html. Could you fix these errors?

Other changes look good. You did your homework!

Comment thread debugging/book-library/script.js Outdated
Comment on lines 9 to 14
bookForm.addEventListener("submit", addBook);

window.addEventListener("load", function (e) {
populateStorage();
render();
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could consider placing all code that runs once on page load in a single function. For example, you could put it inside the page load callback or create a function named init() or setup() and call it once when the page loads.

This makes it easier to locate and manage all the code that runs once when the app starts.

Comment thread debugging/book-library/script.js Outdated
myLibrary.splice(i, 1);
render();

alert(`You've deleted title: ${deletedTitle}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

alert() is a blocking function call. As a result, invoking it prevents the browser from updating the UI until the dialog is dismissed.

If time permits, research for approaches that allows the UI to update before displaying the alert dialog. (This is an optional change).

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.

Allow the browser to update the UI before showing the blocking alert

@cjyuan cjyuan 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 15, 2026
@gideondefar gideondefar added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 15, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good. Well done.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 15, 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. Core This is a core task and should be completed by all trainees Module-Data-Flows The name of the module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants