Skip to content

Support wait statements between commands in a sequence #4

@devoreofox

Description

@devoreofox

Problem/Opportunity Space

The current configurable delay applies uniformly between every command in a sequence. There is no way to add a longer pause at a specific point in a sequence. This limits use cases that require variable timing.

Acceptance Criteria

  • Users can insert a wait entry at any position in a command sequence
  • Wait duration is configurable per entry in milliseconds
  • Wait entries are visually distinct from command entries in the UI
  • The global delay setting still applies between all entries including after waits

Suggested solution

Extend CommandEntry with a type discriminator - either Command or Wait. Wait entries have a duration field instead of a command string. CommandHandler.ExecuteAsync checks the entry type and calls Task.Delay with the specified duration instead of executing a command.

Suggested design

  • Add a Type enum to CommandEntry with values Command and Wait
  • Add a WaitDuration int field to CommandEntry used when Type is Wait
  • Update CommandHandler.ExecuteAsync to branch on entry type
  • Update EditWindow to show a duration input for Wait entries instead of a command input
  • Add an Insert Wait button alongside Add Command in EditWindow
  • Wait entries displayed with a distinct visual style such as a clock icon or different row colour

Testing Considerations

Happy path

  • Wait entry pauses execution for the specified duration
  • Execution resumes correctly after the wait
  • Multiple wait entries in a sequence all fire in order
  • Global delay still applies after the wait entry completes

Sad path

  • Wait duration of 0 is handled gracefully
  • Extremely large wait duration does not cause issues
  • Wait entry at the start of a sequence works correctly
  • Wait entry at the end of a sequence works correctly
  • Sequence with only wait entries and no commands completes without errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions