Skip to content

Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint 2 | Book Library - #606

Open
salahalsabhi wants to merge 2 commits into
CodeYourFuture:mainfrom
salahalsabhi:feature/book-library
Open

salahalsabhi wants to merge 2 commits into
CodeYourFuture:mainfrom
salahalsabhi:feature/book-library

Conversation

@salahalsabhi

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

Task code

CYF-1122

Changelist

Book Library – Bug Fixes and Improvements

Fixed the known bugs and improved the Book Library application.

Bug Fixes

  • Fixed the initial book rendering issue.
  • Fixed the book submission error.
  • Corrected the author field assignment.
  • Fixed the delete button functionality.
  • Corrected the Read / Unread status.
  • Added validation for required fields.
  • Prevented zero, negative, non-numeric, and decimal page counts.

Improvements

  • Clear form fields after successfully adding a book.
  • Use textContent instead of innerHTML for displaying user-provided book data.
  • Store the number of pages as a Number.
  • Removed the unnecessary duplicate render() call.

Testing

  • Tested adding and deleting books.
  • Tested Read / Unread functionality.
  • Tested form validation.
  • Tested the application after refreshing the page.

Questions

No questions.

@github-actions

This comment has been minimized.

@salahalsabhi salahalsabhi changed the title Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint-2 | Book Library Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint-2 | Book-Library Nov 26, 2026
@github-actions

This comment has been minimized.

@salahalsabhi salahalsabhi changed the title Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint-2 | Book-Library Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint 2 | Book Library Nov 26, 2026
@salahalsabhi salahalsabhi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 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.

Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Flows/blob/general-review-feedback/debugging/book-library/feedback.md

Doing so can help me speed up the review process. Thanks.

@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 Nov 28, 2026
@salahalsabhi

Copy link
Copy Markdown
Author

Thanks for the general feedback link. I’ve applied the relevant improvements (form validation, cleaner render, consistent page numbers, delete flow, naming, etc.) and tested add/delete/read status and page load. Ready for another review when you have time.

@salahalsabhi salahalsabhi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 28, 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.

Great work.

Comment on lines 53 to +54
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.

Note: 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).

Comment on lines +79 to +82
titleInput.value = "";
authorInput.value = "";
pagesInput.value = "";
readCheckbox.checked = false;

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.

Note: Now that all the input elements are inside a form, we could also just call a method of the form element to reset the form.

@cjyuan cjyuan 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. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 28, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants