Skip to content

London |ITP- Jan-2026| Ping Wang|Sprint 3 |Alarm clock#1024

Open
pathywang wants to merge 4 commits intoCodeYourFuture:mainfrom
pathywang:sprtint-3/alarm-clock
Open

London |ITP- Jan-2026| Ping Wang|Sprint 3 |Alarm clock#1024
pathywang wants to merge 4 commits intoCodeYourFuture:mainfrom
pathywang:sprtint-3/alarm-clock

Conversation

@pathywang
Copy link
Copy Markdown

@pathywang pathywang commented Mar 17, 2026

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 do feel hard at the beginning because there is communication between index.html and JavaScript.js code which i never had this experience in previous study. I need get element from html to JavaScript then use script to make html function properly with JS code. How do i do on my own without any help, it is quite overwhelming for me even now. My understanding is like proper project in real life which seemed far away from my current study but it is not. i need get on with it. To be honest, i am still not confident at the moment. I think i will get better with constant review and more practice

.Study prep twice, any questions to ask chatGpt mainly
. Read readme.md carefully in order to understand requirement for this PR
. Create my own branch Sprint-3/alarm clock from main
. Update title alarm clock App in index.html then commit to github
. complete code on alarmclock.js file then commit change to github
. did test on alarmclock.test.js file

@github-actions

This comment has been minimized.

@pathywang pathywang closed this Mar 17, 2026
@pathywang pathywang deleted the sprtint-3/alarm-clock branch March 17, 2026 06:07
@pathywang pathywang restored the sprtint-3/alarm-clock branch March 17, 2026 06:07
@pathywang pathywang reopened this Mar 17, 2026
@github-actions

This comment has been minimized.

@pathywang pathywang changed the title London | ITP- Jan-2026 | Ping Wang | Sprtint 3 |Alarm clock London |ITP- Jan-2026| Ping Wang|Sprint 3 |Alarm clock Mar 17, 2026
@pathywang pathywang added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 17, 2026
@hkavalikas hkavalikas self-requested a review March 22, 2026 11:42
@hkavalikas hkavalikas added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 22, 2026
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What will happen if we add -5 or not add anything to the timer?

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 think a negative value will trigger the alarm right away (or nearly immediately) and empty input breaks the timer unless handled. so i correct my code if (isNaN(totalSeconds) || totalSeconds <= 0) {
alert("Please enter a valid positive number.");
return;
} to make sure the code is running smoothly

Comment on lines +20 to +31
countdownInterval = setInterval(() => {
totalSeconds--;

if (totalSeconds <= 0) {
clearInterval(countdownInterval);
playAlarm();
totalSeconds = 0;
}

updateHeading();
}, 1000);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The alarm will play before the seconds remaining are set to exactly 0, how can we improve that?

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 think the alarm is triggered before the UI clearly shows 00:00, so it feels early. I amend my code in order to update the UI before triggering the final action

@hkavalikas
Copy link
Copy Markdown

Finally, let's try to add a few more details on the Changelist. The purpose of the changelist is to mention individual updates/additions/changes made for this PR, not so much to add a headline (like the title) of the changes.

@hkavalikas hkavalikas added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 22, 2026
@pathywang pathywang 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 Mar 22, 2026
@hkavalikas
Copy link
Copy Markdown

I just want to follow up on the Changelist comment, and I will review the other changes a bit later.

For the changelist, we are usually adding bullet points or some notes on the changes made in this PR, for example, I added X for Y, made updates X, used Y... and so on. Literally giving us a short overview of the changes made in this PR.

But I just wanted to quickly acknowledge your current changelist/concerns. The first few times can definitely be overwhelming, so don't get discouraged, you will be repeating these steps so many times you won't even think about them in the future. The beginning is always hardest but you have done an excellent job 👏 .

@hkavalikas hkavalikas added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 24, 2026
@hkavalikas
Copy link
Copy Markdown

PR looks great, only the changelog request is left to address.
Ref: #1024 (comment)

@hkavalikas hkavalikas added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 24, 2026
@pathywang pathywang removed the Reviewed Volunteer to add when completing a review with trainee action still to take. label Mar 24, 2026
@pathywang
Copy link
Copy Markdown
Author

Thanks Harry for encouragement while i am a bit lack of confidence at the moment. What is more, i update changelist under your instruction.

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