Open brprice opened 5 years ago
Happy to use autofocus. I was doing setting the focus with script, but I guess that failed to work for you? Moving it to an attribute is better, and I've done that now. Will be deployed in about 4 hours.
Happy to take a patch for labels etc, but I guess we should also be labelling the dropdown and Search? To test locally do hoogle generate
then hoogle server
. You probably want to edit html/index.html
to add the labels.
I tend to use the keyboard and avoid the mouse as much as possible. For this workstyle it would be helpful if the search box was autofocused (as it is on Hackage). I don't see any downsides for other users, since pretty much every use of hoogle requires filling this field in (but please correct me if I'm wrong!).
A similar idea is to improve the link hinting that Vimium does (follow links/focus text boxes via the keyboard) by adding a label to the search box. However I have no idea how this interacts with other browser extensions or users.
My HTML knowledge is pretty slim, but I think these could be accomplished by:
autofocus
attribute to the "Search for..." input element<label for="hoogle">Query</label>
immediately before the input element. This label could also be made hidden, to not change the rendered page.I haven't tested the first or made a merge request with the changes as I don't understand how to locally deploy a modified version of hoogle. An example of making the second change to the live page (using Firefox's developer tools) is: before: to select the search box one can type "19" after: now one can also type "qu" (or "2")