Skip to content

London | 26-ITP-Jan | Miriam Jorna | Sprint 3 | Alarmclock#1192

Open
miriamjorna wants to merge 12 commits intoCodeYourFuture:mainfrom
miriamjorna:DataGroupsSprint3
Open

London | 26-ITP-Jan | Miriam Jorna | Sprint 3 | Alarmclock#1192
miriamjorna wants to merge 12 commits intoCodeYourFuture:mainfrom
miriamjorna:DataGroupsSprint3

Conversation

@miriamjorna
Copy link
Copy Markdown

@miriamjorna miriamjorna commented Apr 11, 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

Made a working alarm clock.
The page changes colour when the alarm goes off.
I've made a colour reset provision for when the alarm is paused (=what the user perceives as turning it off).
Noticed input could be negative; have made sure only positive integers can now be used to set the time.

@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@miriamjorna miriamjorna added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 11, 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 Apr 11, 2026
@github-actions

This comment has been minimized.

@miriamjorna miriamjorna added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 11, 2026
Copy link
Copy Markdown
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.

Currently, when starting a new countdown, the application does not always return to a clean initial state, which can lead to inconsistent behavior between runs.

Consider introducing a dedicated reset function to return the app to a clean initial state, and call this function before starting a new countdown to help ensure consistency.

Hint: a user may not click the "Stop" button first before starting a new count down.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment on lines +4 to +7
if (seconds <= 0) {
alert("The number of seconds must be more than 0 please");
return;
}
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.

Indentation is off.

Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode,
as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
?


If you have enabled "Format on save" but it is not working, it is likely that you haven't assign a formatter for JS file. This could happen if you have zero or multiple extensions that can format .js file.

If you have installed "Prettier" extension. To assign it as the formatter of JS code, you can try:

  1. Use "Format document" to format the JS file. Sometimes, VSCode will ask you to choose a formatter, and you can manually select "Prettier".
  2. Edit settings.json and set Prettier as the default formatter for JS.

See: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

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.

Oh, my apologies, I inserted that and did not prettify it after doing so. Tbh I would normally have done that by hand quickly. Just forgot.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment thread Sprint-3/alarmclock/alarmclock.js
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
@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 Apr 11, 2026
@miriamjorna miriamjorna added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 14, 2026
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment thread Sprint-3/alarmclock/alarmclock.js
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 15, 2026
@miriamjorna miriamjorna added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
Copy link
Copy Markdown
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.

Indentation is a bit off. Manual indentation is a good habit but enabling auto-format can save time and help clean up trailing space. The latter is easy to miss when we format code manually.

Comment on lines -51 to -24
function pauseAlarm() {
audio.pause();
}

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 delete pauseAlarm()?

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.

Oh no! Have I been careless cleaning up the pause button issue? Not the first time I've confused the script term "pause alarm" vs. the human term "stop alarm", apologies!

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.

We can double check what we have changed in the PR by clicking the "Files changed" tab.

image

clearInterval(countdownId);
updateDisplay(0); // replaces the manual textContent line
document.body.classList.toggle("alarm-activated", false);
}
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan Apr 16, 2026

Choose a reason for hiding this comment

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

Shouldn't this function, resetAlarm() be called in setAlarm()?

You should also reset the audio because the user may not click the Stop button before starting a new countdown.

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.

Implemented. Thank you for your time!

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@miriamjorna miriamjorna added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Apr 17, 2026

Changes look good.

@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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 17, 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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants