ffont / freesound-explorer

Visual interface for exploring Freesound content and creating music in a 2-dimensional space
http://labs.freesound.org/fse/
MIT License
19 stars 3 forks source link

Immideate info about number of sounds for the entered query terms #61

Closed noVaSon closed 6 years ago

noVaSon commented 6 years ago

Here comes a direct feedback to the user for seeing the impact of his query formulation on the number of results. This Info is displayed in the system message box before submitting the query.

This is a immense improvement, as calculating the map is not abortable and firing a query takes quite long.

Cares for #64

noVaSon commented 6 years ago

This was a pretty merging-mess. I tried to squash it into fewer commits but did not succeed - however it works...

ffont commented 6 years ago

Hi, is this making a request at each key stroke? You should add some timer so the request is only made after some time has passed and no key has been pressed (150 ms for example). In this way we minimize queries to FS. Be careful that the order of query responses is not guaranteed so you should have some way to only show search results count for the last query you did.

noVaSon commented 6 years ago

Hi! Oh, you are right! I just tested a little more and got some 429 from the server. I am trying some debouncing right now to get over this. I'll leave a message when I solved it! Thanks for the warning :)

noVaSon commented 6 years ago

Ok, I successfully debounced the requests with 400 ms - this also makes responses out of order less likeley. I'd have to dig a little deeper for the order issue.

ffont commented 6 years ago

Hi, let me know when this is ready to review/merge. As far as I understand there is still the request order issue that needs to be addressed right?

noVaSon commented 6 years ago

Hi @ffont I have no idea how to solve this issue... maybe with a PromiseAll array / I think since the debounce this issue is rather minor and can be adressed in case it shows as a bug sometime. If the predicted number is wrong, there will be no harm anyway. Please correct me if I am prooving arrogance here :)

ffont commented 6 years ago

I agree the issue is minimal, I'll merge then.