ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

[RFC] Keyboard selection #88

Closed bgamari closed 9 years ago

bgamari commented 9 years ago

Here is a simple implementation enabling keyboard navigation of results as is done by, e.g., rustdoc.

I still don't consider this finished work as I worry that it might interfere too strongly with scrolling (which is more likely to be needed in hoogle results than with rustdoc) and the styling could be improved.

Thoughts?

ndmitchell commented 9 years ago

I didn't have a chance to actually try it, but I suspect a scroll into view is required after each key press - certainly it's missing on the rust version. I'm not super happy with the current Hoogle web interface, so if you're able to help drive it forward I'd welcome any help. I'm certainly open to the principle of up/down to move through the items (although I don't really have a preference on it myself - I wouldn't do it, but I would accept a patch), as long as it doesn't make it harder for people to get started with (I don't think it would).

bgamari commented 9 years ago

I would be happy to contribute to the web interface effort although I think the frontend itself is quite usable. What in particular would you like to improve? The styling could probably be cleaned up a bit (namely eliminating px dimensions) and the maintenance surface area might be reduced a bit by using an off-the-shelf templating engine. Other than that it seems like things are in pretty good shape.

ndmitchell commented 9 years ago

I haven't found the custom templating to be a burden, since it's not a very multi-page app. I'm not too fussed about px, since that hasn't really meant pixel in years, it just means cross-platform small unit of measure.

My thoughts were:

Part of these are dependent on other changes in Hoogle, but that's the general direction I was thinking.

bgamari commented 9 years ago

@ndmitchell I've rebased the branch as well as added scrolling support. Let me know what you think. It would be great to get this in.

ndmitchell commented 9 years ago

I like it, I'll probably merge in a few days. I'm currently experimenting with some other changes on a branch, so I'll most likely pull your stuff into that branch, check it works nicely, and then merge this patch (in a few days), and then merge my stuff back on top (perhaps in a few weeks).

ndmitchell commented 9 years ago

Thanks for the patch, it works nicely. After applying your patch the amount of whitespace between elements got reduced to zero, and I've put that back with a follow up commit.

I've also merged your changes into the https://github.com/ndmitchell/hogle repo, which is where I'm developing a new from-scratch version of Hoogle. I expect to have a test deployment of that working in about a week. Given my development focus is on the hogle repo (which will eventually be merged into Hoogle, in some manner) I'll likely not redeploy Hoogle with your fix, and push it out with Hogle (and rename Hogle).