Skip to content

London | 26-ITP-May | Vito Moratti | Sprint 2 | Book-library - #570

Open
vmoratti wants to merge 19 commits into
CodeYourFuture:mainfrom
vmoratti:feature/book-library
Open

London | 26-ITP-May | Vito Moratti | Sprint 2 | Book-library#570
vmoratti wants to merge 19 commits into
CodeYourFuture:mainfrom
vmoratti:feature/book-library

Conversation

@vmoratti

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

I fixed all the "bugs" and also run it through the Lighthouse tool for accessibility with 94% success.

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

Could you also 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.

Comment thread debugging/book-library/index.html Outdated
Comment on lines 37 to 40
id="title"
name="title"
required
/>

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.

The browser checks the input elements against the specified constraints only when a user submits a form.
Without <form>, the browser won't enforce the "required" constraint.

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.

I have addressed that

Comment thread debugging/book-library/index.html Outdated
Comment on lines 49 to 56

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.

Why not make this input element to accept only positive whole number?

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.

done

Comment thread debugging/book-library/index.html Outdated
Comment on lines 57 to 64

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.

This checkbox is not showing.

The issue is related to Bootstrap 4.4.1. Could you use AI to find a way to fix the issue? Mentioning "Bootstrap 4.4.1" might help.

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.

done

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.

I have also run the HTML code through the validator and there are no red flags now.
I also added delay for the deletion message to show after the deletion of book.

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

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.

A common practice is to exclude local configuration files, which typically differ between developers, from a PR branch unless the configuration is required for the changes to work.

To ignore a tracked file such as .vscode/settings.json locally, use:

git update-index --skip-worktree path/to/file

And if you ever need undo the operation in order to track it again, use:

git update-index --no-skip-worktree path/to/file

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.

thank you, that file snuck in into commit, and i wasn't sure if it's needed to be pushed. So, does it mean that by doing:
git update-index --no-skip-worktree path/to/file
i have undone it now?

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.

That only tells git not to track the file but the changes made before will still remain on the branch.

For this PR, it's ok to leave it there. You could practice that in future PRs.

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.

Thank you.

Comment thread debugging/book-library/script.js Outdated
Comment thread debugging/book-library/script.js Outdated
Comment thread debugging/book-library/script.js Outdated
Comment on lines +43 to +44
titleInput.value.trim(),
authorInput.value.trim(),

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.

What f titleInput.value is " "? Could a book title or author's name be an empty string?

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.

I got it. trimming() before the condition checking

Comment thread debugging/book-library/script.js Outdated
setTimeout(function () {
alert(`You've deleted title: ${deletedTitle}`);
}, 0.5);
}, 3);

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.

Why 3 (or 0.5) ? What difference does it make?

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.

Sorry, of course it's milliseconds. I've changed it to 300 now.

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.

Not much , as it's in milliseconds. So, i have changed now.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 21, 2026
@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 21, 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.

authorInput.value.trim(),
title,
author,
Number(pagesInput.value),

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: It's a safer practice to also check the input in JS. (Someone could have accidently changed the constraints in the HTML later).

Comment thread debugging/book-library/script.js Outdated
Comment on lines +113 to +127
setTimeout(function () {
alert(`You've deleted title: ${deletedTitle}`);
}, 3);
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.

Why remove the setTimeout()? You could set the delay to 0 (instead of some magic number). Because of the way JS queues a task with setTimeout(), it could prevent alert() from blocking the page from being updated.

@cjyuan cjyuan removed the Reviewed Volunteer to add when completing a review with trainee action still to take. label Aug 21, 2026
@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 21, 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