Open IoannisNezis opened 3 months ago
Maybe debouncing the search would be nice
I played around a bit with different highlighting options:
background | underline |
---|---|
I personally prefer the underline option, any opinions?
@IoannisNezis This is awesome! It's live on https://qlever.cs.uni-freiburg.de for some time now and I use it for almost every example query. The underlining looks great. A minor suggestion for further improvement: When one clicks on the Example
button, the focus should be in the search field so that one can start typing right away without first clicking into the search field
@IoannisNezis This looks great now.
Another small request, which occurred to me already when trying this out the first time and still occurs to me now every time I used the new feature:
When selecting a query using the "Example" button one has to:
For Step 4, there is the Shortut Ctrl+Return, which I always use to execute a query (after you type the query, you can just continue typing in instead of having to switch to the mouse again just for a single click).
But with the workflow above, I have to click, type, click, click
It would be awesome if one could select the query with either TAB or arrow-up / arrow down and then select it via Return (and another Ctrl+Return would then execute it). Interestingly, when pressing TAB once, one already gets to "Add new example", and then Return takes you to the corresponding page. So maybe realizing this with TAB is relatively little additional work.
@hannahbast I actually already started working on this, initially this is a bit of a pain. I did not look into the tabindex direction yet, thanks for the idea.
At this point it might be worth mentioning that i am re-implementing parts of this library: https://select2.org/ which i initially choose not to use.
If there is a good reason not to use this library i would be really happy (sunken cost fallacy is kicking in really badly). One reason might be: being able to search for multiple keywords of one example.
I implemented the keyboard control. It should now be possible to search, select and execute an example query while only clicking once.
I decided against the tabulator option and implemented the selection with arrow keys.
I want to implement 2 further improvements:
The list of possible examples is a bit long.
i want to make the list scrollable, instead of showing everything.
Currently one can select a example with the mouse and the arrow keys.
I want to change this so that if one hovers an example only this example is highlighted.
If the arrow key is used after a element is hovered with the mouse it should propagate from this element.
@hannahbast In the last 2 commits I implemented the formatting changes we discussed (typo, line-length, ...).
A few things:
What is the procedure for closing threads in PR's? Should only the reviewer close them or can the assignee also close threads if its reasonable?
In a previous comment i suggested two further improvements. I would like to address them in separate PR's to keep this one at a manageable size.
This PR adds a keyword-search to filter the example querys (by name).
Each whitespace sperated word needs to appear in the result.
The search matches the keyword also
infix
When no result matches the query, a message is displayed.