the beat between steps is feedback, not decoration
the comment called it cosmetic and worth being honest about, which reads like an apology and invites the next reader to delete it as a pointless sleep. the real reason is better. some of this work is genuinely slow — pm2 start measures ~770ms — and some is effectively instant. without a pause the fast steps land in one frame, the log jumps from empty to finished, and you cannot tell 'it worked' from 'nothing happened'. the interval is what makes a step something you saw happen rather than something you found already done. only applied when something is listening, so the json path still runs flat out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,11 +41,16 @@ import type { DiscoveredPlugin } from './manifest';
|
||||
export type OnStep = (step: string) => void | Promise<void>;
|
||||
|
||||
/**
|
||||
* A beat between steps, so the log reads rather than blinks.
|
||||
* A beat between steps. Deliberate, and not decoration — do not remove it as a pointless sleep.
|
||||
*
|
||||
* Cosmetic, and worth being honest about: `pm2 start` genuinely takes a moment, but writing a row and
|
||||
* rebuilding the router do not, and four lines arriving in the same frame look like a stall followed by a
|
||||
* jump. This is small enough not to matter to a script and long enough for a person to follow.
|
||||
* Some of this work is genuinely slow (`pm2 start` measures ~770ms) and some is not: writing a row and
|
||||
* rebuilding the router are effectively instant. Without a pause the fast steps arrive in a single frame,
|
||||
* so the log jumps from empty to finished and the reader cannot tell "it worked" from "nothing happened".
|
||||
* The interval IS the feedback — it is what makes each step something you saw occur rather than something
|
||||
* you found already done.
|
||||
*
|
||||
* Small enough that a script does not care, long enough that a person can follow it. Only applied when
|
||||
* something is listening: `onStep` absent means no beat, so the JSON path runs at full speed.
|
||||
*/
|
||||
const STEP_BEAT_MS = 220;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user