Skip to content

Conversation

@i786m
Copy link

@i786m i786m commented Nov 26, 2025

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

Refactor HTML structure, enhance form validation, and improve JavaScript functionality for book library & complete code reading tasks

…ipt functionality for book library application & complete code reading tasks
@i786m i786m added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@i786m i786m added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 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 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 27, 2025
@i786m
Copy link
Author

i786m commented Nov 27, 2025

Thank you for the feedback. I'll make sure to work on the issues/suggestions you've pointed out.

Copilot AI review requested due to automatic review settings December 6, 2025 11:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the book library application by fixing multiple bugs, improving form validation, enhancing HTML semantics, and completing code reading exercises. The changes address issues with book display, form submission, author attribution, and delete functionality.

Key changes:

  • Fixed JavaScript bugs including incorrect variable references, missing parentheses, and incorrect event listener names
  • Improved HTML structure with proper input types, accessibility attributes, and semantic elements
  • Enhanced form handling by moving to button-based submission with proper event listeners

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
debugging/book-library/script.js Fixed multiple bugs including syntax errors, variable references, and improved code quality with proper comparisons and string interpolation
debugging/book-library/index.html Enhanced semantic HTML with lang attribute, proper input types, accessibility labels, and form structure
debugging/book-library/style.css Updated selectors to match HTML changes and improved styling consistency
debugging/code-reading/readme.md Added answers to scope and reference-related JavaScript questions
debugging/book-library/readme.md Documented completion of bug fixes

@i786m i786m 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 Dec 8, 2025
@i786m i786m requested a review from cjyuan December 8, 2025 20:27
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.

Excellent work.

Comment on lines +71 to +72
First console.log outputs 9 as x is passed and the f1 call doesn't alter its value outside the fn.
Second console.log prints the object {x:10} as f2 increments y.x by 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Look up the relevant technical terms, pass by value and pass by reference.

authorInput.value = "";
pagesInput.value = "";
checkInput.checked = false;
alert(`You've added ${book.title} to your library.`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Note:

alert() is not a friendly way to display messages in an app, especially non-critical messages.
It is ok to use alert() in this "exercise" app, just don't make it a habit.

Also, alert() can block the execution of the application. For example, even if you moved alert0 after render(), the rendering will still be blocked by alert(). So in both "addition" and "deletion" (lines 97-99), the updated list of books will only be rendered after the user closed the dialog box.

Copy link
Author

Choose a reason for hiding this comment

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

I was looking into Bootstrap's alert classes and realised I could have in-page messages as opposed to alerts. I will implement this as a workaround.

@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 Dec 9, 2025
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.

3 participants