Skip to content

Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library - #560

Open
Motorcycle-lab wants to merge 8 commits into
CodeYourFuture:mainfrom
Motorcycle-lab:book-library
Open

Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library #560
Motorcycle-lab wants to merge 8 commits into
CodeYourFuture:mainfrom
Motorcycle-lab:book-library

Conversation

@Motorcycle-lab

@Motorcycle-lab Motorcycle-lab commented Aug 17, 2026

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

The book project

Questions

If I can self learn all backend and frameworks by myself, build a porfolio by myself and become a full-stack engineer.

@github-actions

This comment has been minimized.

@Motorcycle-lab Motorcycle-lab added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@Motorcycle-lab Motorcycle-lab added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-lab Motorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed 📅 Sprint 2 Assigned during Sprint 2 of this module labels Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-lab Motorcycle-lab changed the title Glasgow | 25-ITP-May |Chan Yat Long |Sprint 2 | Book library Glasgow | 26-ITP-May |Chan Yat Long |Sprint 2 | Book Library Aug 17, 2026
@github-actions

This comment has been minimized.

@Motorcycle-lab Motorcycle-lab added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected labels Aug 18, 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.

@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 18, 2026
@Motorcycle-lab Motorcycle-lab 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 18, 2026
@cjyuan

cjyuan commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Did you push your changes to GitHub?

@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 18, 2026
@Motorcycle-lab

Copy link
Copy Markdown
Author

Sorry sir. I am a bit confusing because If you clicked on my file change, I have already updated the file.

@Motorcycle-lab Motorcycle-lab 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 19, 2026
@cjyuan

cjyuan commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Could you go through the "general feedback" document again to see what else you could also improve?

@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 19, 2026
@Motorcycle-lab Motorcycle-lab added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 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. 🏕 Priority Mandatory This work is expected labels Aug 19, 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.

Have you also checked `index.html for errors or possible improvements?

Comment thread debugging/book-library/script.js Outdated
Comment thread debugging/book-library/script.js
Comment thread debugging/book-library/script.js Outdated
Comment thread debugging/book-library/script.js
@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 20, 2026
@Motorcycle-lab Motorcycle-lab 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 20, 2026
Comment thread debugging/book-library/script.js Outdated
Comment on lines 95 to 97
alert("Are you sure you want to delete the book ?");
myLibrary.splice(i, 1);
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.

alert() won't let a user choose Yes or No. Besides, this message is not quite the same as the original message.
The intent of the original message is to inform the user which book was deleted.

Comment thread debugging/book-library/script.js Outdated
Comment on lines +56 to +61
const table = document.getElementById("display");
table.innerHTML = "";
let rowsNumber = table.rows.length;
//delete old table
for (let n = rowsNumber - 1; n > 0; n-- {
table.deleteRow(n);
}
const tobody = table.querySelector("tbody") || table;
tobody.innerHTML = "";

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 clear both <table> and <tbody>?

  • Where is rowsNumber used?

  • Where is tobody used?

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. Can you fix these errors?

Comment thread debugging/book-library/index.html Outdated
Comment on lines +30 to +31
<div id="demo" class="collapse">
<form id="bookform">

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.

Good idea to introduce <form>. Why not use a formatter to keep the code consistently formatted?

Comment thread debugging/book-library/index.html Outdated
Comment on lines 48 to 53
<input
type="number"
class="form-control"
id="pages"
name="pages"
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.

  • Why remove required?

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

Comment thread debugging/book-library/index.html Outdated
Comment on lines 54 to 61
@@ -61,13 +59,9 @@ <h1>Library</h1>
value=""
/>Read
</label>

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.

Currently 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.

Comment thread debugging/book-library/index.html Outdated
class="btn btn-primary"
onclick="submit();"
/>
<button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button>

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 look up the trade off between

  • Assigning event listener in HTML
  • Assigning event listener in JS using .addEventListener()

Comment thread debugging/book-library/index.html Outdated
Comment on lines +64 to +62
<input
type="submit"
value="Submit"
class="btn btn-primary"
onclick="submit();"
/>
<button type="button" class="btn btn-primary mt-3" onclick="processbook()">Submit</button>

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.

Changing the submit button to a regular button means the browser won't check the constraints such as required when the user clicks the button. If your intention is to prevent the browser from submitting the form, which would cause the page to reload, you can call .preventDefault() on the event object passed to the event listener.

@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
@Motorcycle-lab Motorcycle-lab 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 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants