Closed KasraF closed 1 year ago
The 65684ae327a910c1c422a9b87771132e5ffdda9b commit (fixed further in 140cb52af02214291dc7fe7f89ce3211f04b2b4f) should reduce the risks for now, though it still doesn't fully address it.
Basically, the user can't cancel out/restart in the middle of drawing the panel. But if they are doing it while waiting for the OpenAI request (i.e. most of time) we gracefully handle it.
If they cancel out, Leap remains closed. If they use Ctrl/Cmd+Enter
we automatically restart the Leap request with a new prompt instead.
@rlisahuang What do you think of this interaction flow? If it looks good (and it works for you as well) please close the issue. :)
Works nicely for me. Closing as completed.
Right now, if we hit
Ctrl/Cmd+Enter
repeatedly, there's a race condition between the many promises trying to get a list of completions and drawing the panel. Similarly, if we cancel out by pressingEsc
before requests are finished, it will show and draw the panel anyway.We need to actually cancel previous promises, not just hide the panel.
Related to #3.