From 62ee0d1e606f97540dffeb48119d5d69d04e04bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 14 Aug 2026 22:33:53 +0000 Subject: [PATCH] the beat between steps is feedback, not decoration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/servers/plugins/install.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/servers/plugins/install.ts b/src/servers/plugins/install.ts index bef88e3b..281e3f03 100644 --- a/src/servers/plugins/install.ts +++ b/src/servers/plugins/install.ts @@ -41,11 +41,16 @@ import type { DiscoveredPlugin } from './manifest'; export type OnStep = (step: string) => void | Promise; /** - * 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;