Improve Firki preview behavior while typing
BotB Academy Bug Reports and Feature Requests
 
 
156663
Level 30 Chipist
funute
 
 
 
post #156663 :: 2022.05.24 12:44am
  
  damifortune and kleeder liēkd this
Something that I've noticed with the Firki previewer that's bothered me a bit is:

a. it makes requests to interpret for basically every key event/character typed which I imagine is fairly wasteful, and
b. given that there will be a bunch of interpret requests in flight while typing and they can finish in any order, sometimes what ends up happening is that the Firki preview doesn't actually show you the most up-to-date preview if one of the earlier interpret requests actually ends up coming back after the actual last request resolves (this is the actual bug).

To fix that, there should a) be some debounce on when the preview request gets sent while typing, and b) only be one interpret going at a time (i.e. cancel any ongoing requests if typing before it's done).

I went ahead and played around with the code and made some changes to do just that, if you don't mind: https://pastebin.com/JLjUjS8J (new lines are commented, obviously feel free to do whatever you want with those)

(also I forgot how dumb and painful non-ES6 JS is without arrow functions and all, but I wanted to stay at the same compatibility level, so here I am)
 
 
156670
Level 31 Chipist
damifortune
 
 
 
post #156670 :: 2022.05.24 7:19am
oh yeah.. this would be nice to see fixed. the "XHB series" article is so large at this point that the preview is somewhere between incredibly laggy and totally nonfunctional. granted that article is indeed huge, surely like over a thousand links by now. thanks for looking into it..!
 
 
156671
Level 31 Chipist
kleeder
 
 
 
post #156671 :: 2022.05.24 7:23am
for large posts and/or articles, i write them in a text editor and only check on firki for some parts by copypasting back and forth
 
 
157110
Level 29 Hostist
puke7
 
 
 
post #157110 :: 2022.06.02 5:26pm
  
  funute, blower5, ViLXDRYAD and damifortune liēkd this
i think we did it!! \o/
 
 

LOGIN or REGISTER to add your own comments!