Aedif / TokenVariants

GNU General Public License v3.0
18 stars 12 forks source link

Add option to search on request (disable queueing) #142

Open pinkflumph opened 1 year ago

pinkflumph commented 1 year ago

Issue: This may be due to a large number of cached image files, but after typing more than 3-4 letters into the search bar, adding more letters creates a new queue. At that point making any edits to the search query only makes things worse: by the time you type anything in, the first queued search completes, this resets the search bar to whatever that search was and worst of all moves the cursor. Then the next queued search loads in, which again resets the search bar contents, etc.

Example: I am looking for "fish_golden" from Forgotten Adventures:

  1. Typing "fis..." -> Search is loading, creates a queued search at "fis"
  2. Keep typing "fish_g" -> Creates queued search for "fish_g", previous queued search completes, replaces the search bar with "fis", resets cursor to beginning
  3. If you don't notice, you keep typing "oldfis" instead of "fish_gold" -> Creates queued search for "oldfis", previous completes, replaces search bar with "fish_g", resets cursor, etc.

At any point a new queued search can be created or completed and chaos ensues until the entire queue is either done loading or cancelled. The final result is that searching for anything requires the following procedure: Type "fis", clear queue, keep typing "fish_g", clear queue, etc.

Possible solutions: I can see several solutions. One is to have the search bar only edited by the user, i.e., have any completed queued searches show the results, but not the query that yielded them. I am fairly certain that the search bar resetting is a bug, so this would be the ideal fix

A possibly simpler solution might be to have a toggle to disable "live" search altogether and add a "search/enter/go" button to the search bar. This would slow down the search process somewhat, but it is infinitely better to wait a little and get a complete search than go through the process described above.

Aedif commented 1 year ago

What version of the module are you on? This was supposed to be resolved in one of the alter releases.

https://github.com/Aedif/TokenVariants/releases/tag/4.56.3

pinkflumph commented 1 year ago

What version of the module are you on? This was supposed to be resolved in one of the alter releases.

https://github.com/Aedif/TokenVariants/releases/tag/4.56.3

I have version 4.57.1, which I believe is the most recent one. Using Foundry v11.308