Skip to content

Conversation

@theodore-s-beers
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the delay mechanism from an HTTP-request-specific delay that occurred before requests to a more general sleep that occurs after any step execution. The name change from DelayRequestByMs to SleepAfterMs reflects this behavioral change.

Key changes:

  • Moved delay functionality from HTTP request actions to the step level
  • Changed timing from "delay before request" to "sleep after step"
  • Added UI rendering for sleep steps with appropriate time formatting

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
version/version.go Refactored const declarations to use grouped syntax
render/render.go Grouped var declarations and added handler for new SleepMsg to display wait status
messages/messages.go Added new SleepMsg type for communicating sleep duration
cmd/login.go Added blank line for improved formatting
client/lessons.go Removed HTTPActions struct and DelayRequestByMs field; added SleepAfterMs field to CLIStep
checks/checks.go Removed HTTP-specific delay logic and implemented step-level sleep after each step execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@squashd squashd left a comment

Choose a reason for hiding this comment

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

One change needed (I think). I'd recommend adding these changes to lessons in a course and testing whether it looks right in the CLI and on the frontend.

Comment on lines +178 to +181
if step.SleepAfterMs != nil && *step.SleepAfterMs > 0 {
ch <- messages.SleepMsg{DurationMs: *step.SleepAfterMs}
time.Sleep(time.Duration(*step.SleepAfterMs) * time.Millisecond)
}
Copy link
Member

@squashd squashd Dec 22, 2025

Choose a reason for hiding this comment

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

this needs to be moved up or it'll hit the default error case, no? e.g. if a step is solely -sleepAfterMs

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Will fix that.

@squashd
Copy link
Member

squashd commented Dec 22, 2025

I think we need to do a version bump too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants