Skip to content

London | 26-ITP-May | Chinwe Chukwuma | Sprint 3 | Alarm Clock - #1354

Open
ChinweP wants to merge 18 commits into
CodeYourFuture:mainfrom
ChinweP:module-data-groups/sprint-3/alarmclock
Open

London | 26-ITP-May | Chinwe Chukwuma | Sprint 3 | Alarm Clock#1354
ChinweP wants to merge 18 commits into
CodeYourFuture:mainfrom
ChinweP:module-data-groups/sprint-3/alarmclock

Conversation

@ChinweP

@ChinweP ChinweP commented Jul 31, 2026

Copy link
Copy Markdown

Learners, PR Template

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

Sprint 3/Alarm clock coursework completed following readme instructions.

@github-actions

This comment has been minimized.

@ChinweP ChinweP 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. Module-Data-Groups The name of the module. labels Jul 31, 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 Jul 31, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

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

  • Code works fine if a user only clicks the "Set Alarm" button once.
    However, if the user enters a time and then clicks the "Set Alarm" button multiple times, the countdown clock will not display properly.

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

    Consider introducing a dedicated reset function to return the app to a clean initial state 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
return `${mm}:${ss}`;
}

heading.innerText = `Time Remaining: ${formatTime(remainingSeconds)}`;

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 time displaying code is used on lines 17, 23, and 25. As such, should the presentation logic changes in the future (e.g., change of wording), you would have to modify the code at three different places.

Why not implement a function to keep the time displaying code in once place?

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment on lines +33 to +35
function stopFlashingBackground() {
document.body.classList.remove("flash");
}

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 function is never used.

  • Could consider design the function to take a Boolean parameter so that the function can be used to turn the flashing background on/off.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
const input = document.getElementById("alarmSet");
const heading = document.getElementById("timeRemaining");

let remainingSeconds = Number(input.value);

@cjyuan cjyuan Aug 6, 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.

What input should the app reject to prevent the app from behaving abnormally?

@ChinweP ChinweP added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 7, 2026
@ChinweP

ChinweP commented Aug 7, 2026

Copy link
Copy Markdown
Author

Hi @cjyuan, thank you for the helpful feedback. I've applied all the suggested changes and updated the implementation accordingly.

@ChinweP
ChinweP requested a review from cjyuan August 7, 2026 18:40

@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. Just one more change needed.

Comment on lines +32 to +37
function resetAlarm() {
clearInterval(intervalId);
intervalId = null;
updateDisplay(0);
setFlashingBackground(false);
}

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 user may not click the "Stop" button first before starting a new count down. What else should also be reset?

Hint: When the "Stop" button is clicked, what action is performed?

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 7, 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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants