Re:Server Sent Events
by marcellus23 on Monday May 15, 2023 @05:06PM
(#35954491)
That really depends on the UX you want.
[ Parent
| on HN ]
What do you have in mind? I can't think of a case where you'd want "X is typing" to persist more than a second or maybe two past the last-received message that affirmed X is, in fact, still typing. I can think of cases in which a short timeout might break down in bad ways (making the notice really jittery on high-latency connections, say) but I think those are probably just situations in which any "... is typing" message is simply gonna be bad in one way or another.
You don't want to clear it after only a second. It should persist much longer since people pause and think between words.
It's common that someone starts typing but immediately change their mind and clears the input after only a couple of characters. So if the timeout is longer you need an "ended" event.
Re:Server Sent Events
by bongobingo1 on Tuesday May 16, 2023 @10:42AM
(#35962558)
(the "ended" event is the message being sent.)
Re:Server Sent Events
by yencabulator on Wednesday May 17, 2023 @02:54PM
(#35979617)
Except for the scenario the parent is talking about:
> It's common that someone starts typing but immediately change their mind and clears the input after only a couple of characters.