lfe / lfe.github.io

The LFE Landing Site / Home Page
https://lfe.io/
28 stars 19 forks source link

Search doesn't work as expected #100

Closed mwgkgk closed 1 year ago

mwgkgk commented 4 years ago

Drop-down suggestions do work.

Entering a query into top-right and pressing Go!, redirects to https://lfe.io/? which does nothing.

Entering https://lfe.io/?query also does nothing.

Likely this is not news for the contributors, but sounds like something that deserves tracking.

oubiwann commented 4 years ago

So, this works for me ...

Have you tried typing something like "Erlang" into the search field?

mwgkgk commented 4 years ago

Typing "Erlang" leads to exactly the described behavior, under Linux, with

$ chromium --version
Chromium 85.0.4183.121 Arch Linux

$ firefox --version
Mozilla Firefox 81.0.1

Drop-down thingie works, search does nothing. Weird.

oubiwann commented 4 years ago

@mwgkgk when you say "search does nothing" could you be more specific? I'm searching okay, and I know others are as well -- what are the exact, detailed steps you are taking? And which one of those steps doesn't work? (as in: what action did you perform, what did you expect, and what did you get ...)

I think we're just having a semantics mis-fire here :-) And explicit steps should clear that up!

mwgkgk commented 4 years ago

Probably a case of "not working on my computer". Everything I said before seems to not have any other meaning than the obvious.

https://lfe.io/?Erlang displays the exact same page as https://lfe.io/

Entering Erlang into the topright search box and pressing Enter, redirects to https://lfe.io/?, which displays the same page as https://lfe.io/.

Still reproducible on both Firefox and Chromium.

mwgkgk commented 4 years ago

Not sure why I thought https://lfe.io/?Erlang or https://lfe.io/?query should do anything, that's not how url's work.

Main thing is that entering text in search box, and pressing the corresponding button, or Enter, redirects to https://lfe.io/? on both browsers, which is the same page as https://lfe.io.

mwgkgk commented 4 years ago

Entering Erlang into the search field, and pausing for a brief moment, enables the drop-down results to pop up. Pressing Enter or Go! does nothing, clicking on the drop-down items works as expected.

oubiwann commented 4 years ago

Super! Thanks for the notes!

We'll see if we can talk @stevenproctor into more hacking on the search :-D (he's fixed some of it already ...)

stevenproctor commented 4 years ago

I might be able to take a spike at this issue this weekend....

Did a preliminary scan of the code.

Had a couple of thoughts:

First Thought:

Disable the "Go!" button. That button makes one think there is an action to go to. I know I have been bit by this by habit. Search and hit enter/return, a couple of times until I slow down to see/get reminded that it is a "hovering" results listing.

So if we disable the Go! button, and don't do action on the form when enter is pressed, it forces the user to stay on the page and therefore wait the second or two for the results.

Second Thought:

Create a "SearchResults" page that the Go! button navigates to passing the query string to that page, and then do some results building in JS on that page (with maybe eventually a 'more results') using the same manner as done in the "hovering" search results box, but have that list be "on the page" instead of "over" the page.

So if I type "Erlang" and hit enter out of habit before the results pop up, I go to the search results page (with an input field?) and then below that is the results of the elasticlunr search. This would give the user a page where they can play with that search box and have the results get re-built without going anywhere.

End of Thoughts

Putting on the user hat I would lean towards a search results page, but for resolving the issue quicker (and with less work/maintenance) thought number one does have some appeal.

@oubiwann Your thoughts on how you might like to see this working?

oubiwann commented 4 years ago

Yeah, glad you're leaning that way too ... I was never too enamoured of the popup-style of search results.

As it so happens, I'm doing a ton of work on the site to get the blog integrated with the same content generator, so I'm very fresh on the templating and the Zola static site generator right now -- which means I should be able to answer any questions you may have about it :-)

No pressure, btw -- if you just want to spend your open-source/LFE time this weekend on getting familiar with the templates and chatting about a search template on Slack, that'd be great progress in my book :-D

oubiwann commented 1 year ago

Just a heads-up: with site refresh in progress (see https://staging.lfe.io/), I'm going to be ditching the JS-powered search ... maybe we can do another one in the future that works better? Dunno. For now it's easier if I just disable it.