Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search result suggestions in package search bar #1078

Open
DaniruKun opened this issue Nov 25, 2021 · 4 comments
Open

Add search result suggestions in package search bar #1078

DaniruKun opened this issue Nov 25, 2021 · 4 comments

Comments

@DaniruKun
Copy link

DaniruKun commented Nov 25, 2021

Currently, when inputing a search query in the package search bar, there are no suggested results:
image

It would be great if there were search result suggestions on the same page.

For example, something as basic as how it is done on rubygems.org would be sufficient:
image

Minimal PoC features

  • Suggestion datalist only on the homepage (root path)
  • Very basic rules for displaying results, re-use existing search engine and show top N results (e.g. no more than 10)
  • Just present package names initially, without extra metadata
  • Most likely a LiveView will be needed for the index page
@ericmj
Copy link
Member

ericmj commented Nov 25, 2021

If anyone is interested in implementing this let us know. I believe it could be a nice use case for LiveView.

@DaniruKun
Copy link
Author

@ericmj I am up for making a PoC, I had some experience with LiveView and search before 😊

@DaniruKun
Copy link
Author

image

After a fair bit of sweat, you are looking at the front page rendered using a LiveView 😄 now the hard part is optimising assigns, integrating the suggestions, and tying it together with the rest nicely.

@DaniruKun
Copy link
Author

image

It's a bit difficult to do much with styles in a "Bootstrapish" way since it is quite old (v 3.4), so I hacked in something like this. Will tidy it up a bit more perhaps, but I think this is good enough already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants