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

Proposal: Narrow search results by type #1765

Closed
zachdaniel opened this issue Sep 10, 2023 · 10 comments
Closed

Proposal: Narrow search results by type #1765

zachdaniel opened this issue Sep 10, 2023 · 10 comments

Comments

@zachdaniel
Copy link
Contributor

zachdaniel commented Sep 10, 2023

In this very poor mockup, I show an example UI that would allow for selecting the types of things you would like to search. I would imagine that by default they would all be checked, so we could also add a little "only" button next to each one to instantly select only that one.

CleanShot 2023-09-10 at 14 55 36@2x

This could be put behind a configuration of some kind, but to me it sounds generally useful enough to be done automatically. If this is something we would be interested in I'm happy to take a stab at it.

@zachdaniel
Copy link
Contributor Author

zachdaniel commented Sep 10, 2023

For some context, I'm trying to find ways to get hex docs to cover the cases that we need to (ideally) get rid of ash-hq.org (not the whole website, just the reference documentation features). Multi-package search is one major issue, but we have some strategies to help with that (leave our ash-hq multi-package search up, but have it link to hex. The other major issue is search ability of DSLs within hex. Worst case scenario we can't get rid of ash-hq.org, but will still have improved experience for those users who prefer to use hex :)

@josevalim
Copy link
Member

Hi Zach! We are exploring multi package search, which will require a UI redesign, then I think it is a good time to revamp this discussion.

something we could do right now though is to allow you to specific a type via keywords, something like: change type:function, but that’s not very discoverable. If you want to explore this, a PR is welcome.

@zachdaniel
Copy link
Contributor Author

Keywords sound like a good idea, and potentially are a good first solution, as any UI can be built on top of them and ultimately end up modifying the search string, even if it is hidden from the user. I will look at it now 👍

@zachdaniel
Copy link
Contributor Author

It also looks like lunr is used under the hood which already has keyword search. It may be as simple as exposing the key in some way :)

@josevalim
Copy link
Member

Closing in favor of PR.

@zachdaniel
Copy link
Contributor Author

@josevalim I'm not sure if this is something that I've screwed up or not, but if I point ex_doc at the main branch on the repo, I get some kind of strange javascript error that prevents me from scrolling the sidebar. I can't see any new js errors in the console either. Just letting you know.

@zachdaniel
Copy link
Contributor Author

Nope :) Happens on commits before you merged the changes from my PR, so this must just be a side effect of trying to use ex_doc from GitHub. I will wait for a release :)

@josevalim
Copy link
Member

Related to #1773 perhaps? Can you post your git sha in there and how you can reproduce the failure?

@zachdaniel
Copy link
Contributor Author

Yep! So the ex_doc_behavior branch on ash has this reproduced. Running mix docs yields a page w/ the sidebar not scrollable/extending off of the screen. I've tested in safari and chrome, on an M1 Mac.

ash-project/ash@2235c60

@josevalim
Copy link
Member

Fixed by #1776.

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

No branches or pull requests

2 participants