From bec387a56b76a0adbb8da114dbe69a1c323c1baf Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 18 Aug 2026 11:35:47 -0700 Subject: [PATCH] [eric] streaming: the gesture stamp starts at -Infinity; zero read as mid-gesture for the app's first 350ms --- frontend/src/shared/interactionPriority.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/shared/interactionPriority.ts b/frontend/src/shared/interactionPriority.ts index eacd707d..bff40b5c 100644 --- a/frontend/src/shared/interactionPriority.ts +++ b/frontend/src/shared/interactionPriority.ts @@ -4,7 +4,8 @@ // Capture-phase listeners keep a decaying "interacting" stamp; stream dispatch consults it and // falls back to the 1Hz buffer during the gesture. Smoothness beats token immediacy for ~a second. const DECAY_MS = 350; -let p_lastInteraction = 0; +// -Infinity, not 0: performance.now() is near 0 at process start, so 0 would read as 'mid-gesture' for the app's first 350ms. +let p_lastInteraction = Number.NEGATIVE_INFINITY; export function markInteraction(): void { p_lastInteraction = performance.now();