-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The webterm frontend should do some tricks to improve the perceived responsiveness of the system.
When a user hits a key for the first time in a while, the frontend should immediately send that to the backend as it does now, but it should also set a debounce timer for maybe 300ms. All keystrokes during that time should be enqueued on the frontend and only sent to the backend once the timer elapses, with one exception: hitting the return key should fire off the request immediately and clear the timer. This exception is carved out because the return key completes a command, which should be run on the backend as soon as possible. Perhaps we'd want the tab key to do the same thing, since that triggers an autocomplete request.
Optimistic display should also be added, if it doesn't already work that way. When the user types a keystroke, its result should show up on the screen immediately, without waiting for the request to the server to be sent and acknowledged.
The combination of these two features should keep the perceived latency of the system very low, even if communication with the backend is laggy.