Type on the left. The “receiver” on the right decides whether to show typing…
using a time threshold Δ + simulated network delay/jitter. This is the same idea used by chat apps to avoid flicker.
Play with sliders • Open DevTools if you want
Sender (you)
Just type like normal
Try typing slowly… then pause. Change Δ and see what feels “right”.
Okay. I’m typing now
Tip: Set Mode = Naive to see flicker. Then switch back to Debounced.
Receiver
Decision logic lives here
I’m watching for typing events…
typing…
When events stop arriving for Δ milliseconds, I hide “typing…”.
last_event_time: —now - last_event: — ms
Threshold Δ (ms)
Small Δ = responsive but flickery. Bigger Δ = smoother but “sticks” longer.
Network delay (base ms)
Network jitter (± ms)
Mode
Event log (what arrived, and when)
event stream
The simple rule behind the scenes is:
show typing if (now − last_event) < Δ