Skip to content

Conversation

@i786m
Copy link

@i786m i786m commented Nov 7, 2025

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

Implemented the countdown timer and flashing background

Questions

I am having some issues with getting the tests to pass have made changes to code which makes a previously passed test fail. Please advise on changes I can make. Is there anything in particular I should take into consideration when ensuring I'm meeting tdd requirements when my outputs and expected outputs are a second off either way?

@i786m i786m added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 7, 2025
@illicitonion illicitonion 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 Nov 12, 2025
Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This is generally looking good, but there's a slight expectations mismatch. I expect when I press the "start timer" button, for it to instantly show the time I'm counting down from. But yours waits a second before it does so. That's probably also why your tests are getting off-by-one-second issues. Can you think how to give this effect?

Comment on lines 11 to 13
timeRemaining.textContent = `Time Remaining: ${String(
minutes
).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
Copy link
Member

Choose a reason for hiding this comment

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

This works, but it's quite hard to read what this line of code is doing. Generally any time a string interpolation runs across multiple lines, it's quite hard to read. Can you think how to make this easier to follow at a glance?

Copy link
Author

Choose a reason for hiding this comment

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

I have extracted the updating of the time remaining to its own function and made some changes to better increase readability.

Copy link
Member

Choose a reason for hiding this comment

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

Much clearer! Good job!

@illicitonion illicitonion 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 Nov 12, 2025
…wn to attempt pause functionality- still unfinished
@i786m i786m 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 Nov 17, 2025
@i786m
Copy link
Author

i786m commented Nov 17, 2025

I have added a countdown.js file in order to attempt the pause button of the stretch tasks but I was running into some issues, which I will come back to in the future. If possible, please have a look and see if there's anything glaringly obvious that I am missing.

@i786m i786m requested a review from illicitonion November 17, 2025 06:44
@illicitonion
Copy link
Member

I have added a countdown.js file in order to attempt the pause button of the stretch tasks but I was running into some issues, which I will come back to in the future. If possible, please have a look and see if there's anything glaringly obvious that I am missing.

I tried running it locally (after adding a pause button to the page), and everything seemed to work as I'd expect?

Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Looking good, well done!

Comment on lines +3 to +4
const alarmTimeInSeconds = alarmTimeInput.value;
let totalSeconds = parseInt(alarmTimeInSeconds);
Copy link
Member

Choose a reason for hiding this comment

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

These are much clearer names, but now I'm not sure the difference between alarmTimeInSeconds and totalSeconds - can you differentiate these better too? :)

Comment on lines 11 to 13
timeRemaining.textContent = `Time Remaining: ${String(
minutes
).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
Copy link
Member

Choose a reason for hiding this comment

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

Much clearer! Good job!

@illicitonion illicitonion 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 Nov 17, 2025
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