Skip to content

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 3 | Alarm Clock#1178

Open
Seti-Jemal wants to merge 1 commit intoCodeYourFuture:mainfrom
Seti-Jemal:Sprint--3
Open

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 3 | Alarm Clock#1178
Seti-Jemal wants to merge 1 commit intoCodeYourFuture:mainfrom
Seti-Jemal:Sprint--3

Conversation

@Seti-Jemal
Copy link
Copy Markdown

@Seti-Jemal Seti-Jemal commented Apr 4, 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 have completed sprint 3 alarm clock.

@github-actions

This comment has been minimized.

@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Apr 4, 2026
@github-actions

This comment has been minimized.

1 similar comment
@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 4, 2026
@Seti-Jemal Seti-Jemal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 4, 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 4, 2026
@Seti-Jemal Seti-Jemal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 4, 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.

  • Given a countdown is still active, when the users click the "Set Alarm" button with input equals to 0, then what do you expect the app to behave?

  • While a countdown is active, does the timer display look normal to you?


Note: We should respect instructions like DO NOT EDIT BELOW HERE; it is usually there for a reason. If you are curious about why, you can ask AI Why should programmers respect "DO NOT EDIT BELOW HERE" instruction in a file? (You have made some major changes to the original code, so don't worry about that this time).

Comment on lines +15 to 18
function updateDisplay() {
const heading = document.getElementById("timeRemaining");
heading.textContent = "Time Remaining: " + formatTime(timeRemaining);
}
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 include a parameter to

  • make this function reusable (e.g. call updateDisplay(0) to reset timer display)
  • avoid using a global variable timeRemaining

?


// TRIGGER ALARM
function triggerAlarm() {
document.body.style.backgroundColor = "red";
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.

To better separate presentation logic from application logic, you can consider defining a CSS class, and use classList.toggle() to apply/remove the style. For example,

document.body.classList.toggle("alarm-activated", true);  // apply style
document.body.classList.toggle("alarm-activated", false); // remove style


// START TIMER
function startTimer() {
clearInterval(timerId);
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 when starting a new countdown, the application does not always return to a clean initial state,
which can lead to inconsistent behaviour between runs.

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

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

Labels

Module-Data-Groups The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants