Skip to content

Conversation

@sedazam
Copy link

@sedazam sedazam commented Aug 3, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

📋 Summary

This PR improves form validation, enhances core library functionality, and fixes several bugs to ensure smoother user interaction and better data handling.


✅ Form Validation Improvements

  • Added strict empty-field checks for Title, Author, and Pages.
  • Used .trim() to prevent whitespace-only submissions.
  • Validated Pages input to accept only positive integers.
  • Improved error messaging for clearer, more user-friendly feedback.

🎯 Core Functionality Fixes

  • Completed render() to display books in a properly formatted table.
  • Fixed Delete button functionality with correct array index handling and confirmation prompts.
  • Added toggle read status with dynamic button styles and state management.
  • Implemented viewReadBooks() to filter and show only books marked as read.

🐛 Bug Fixes

  • Fixed table row insertion order (books now display in the correct order).
  • Resolved array index issues when deleting books.
  • Corrected type handling for Pages (stringnumber).
  • Fixed form submission event handling to prevent unintended page reloads.

Questions

Ask any questions you have for your reviewer.

sedazam added 24 commits August 2, 2025 07:58
…library interface; update CSS for better button alignment
@sedazam sedazam added 📅 Data Flows Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Aug 3, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

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/cjyuan/Module-Data-Flows/blob/book-library-feedback/debugging/book-library/feedback.md

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

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 8, 2025
sedazam added 20 commits August 12, 2025 12:24
…nd update createDeleteButton for improved functionality and accessibility
…lity and maintainability; enhance accessibility features for buttons and forms
…and efficiency; remove redundant code for resetting input fields
@sedazam sedazam added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 13, 2025
@sedazam
Copy link
Author

sedazam commented Aug 13, 2025

This update fixes all the original bugs.
Books now display correctly when the page loads, titles and authors are handled properly, read status is saved accurately, and the delete button works as expected.

On top of that, I went beyond the requirements by improving form validation.
This includes trimming whitespace, enforcing positive numbers for page counts, and preventing incomplete submissions.
I also added clear alerts for both errors and successes so users get immediate feedback.

New features include a dynamic toggle for read status with instant visual updates and a viewReadBooks() filter to quickly show only completed books.
Overall, the library is now faster, cleaner, and much easier to use.

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Changes look good.

Sorry that I don't have time to go over the extra features you have implemented.

library.push(book);
render();
function addBook() {
console.log("Add book button clicked!");
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a best practice, when submitting code for review, to remove all non-essential code (including that used for debugging) to keep the codebase clean.

Copy link
Author

Choose a reason for hiding this comment

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

Removed the console.log

I want to thank you for all your effort, reviews, and valuable suggestions about the code.

@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 Aug 13, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check its title is in the correct format, and update it.

Reason: Sprint part (Module-Data-Flows) doesn't match expected format (example: 'Sprint 2', without quotes)

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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants