-
Notifications
You must be signed in to change notification settings - Fork 8
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
New HexDocs home page #49
Comments
Once we submit the search, we should go to a page like this: https://claude.site/artifacts/3324d578-85b1-411c-accd-c002f37f301b I am currently in touch with Livebook's designer so he can mockup the new home page plus search. @paulo-valim made himself available to implement the designs as HTML + Tailwind. We already have endpoints in Hex for:
We will just need someone to implement the front-end bits. I will post all future updates here. |
@ruslandoga I am wondering: should we also index the most recent versions of packages as |
Another potential feature we want to borrow from ExDoc is using
|
@ruslandoga @ericmj @wojtekmach @supersimple I just want to share with you the new designs for the home page: And the package search functionality: We will work on converting those to HTML, then I will let you know once that's ready :) |
Hello everyone! @ghivert may be able to help out here with the frontend with Gleam+Lustre. P.S. Love the design there, the homepage especially looks really nice. |
Hi everyone! @lpil told me about a potential rewrite with Lustre in Gleam. If I understand everything correctly, the backend part is already written, so the main task is only to implement the mockup as a real web app? Is there some requirements like SSR, or anything else? In case you have a Figma/Sketch/whatever format for the mockups, maybe it could directly translate into a Lustre + Tailwind? |
Oh! Being to able to keep it within the BEAM community would be fantastic, thanks for chiming in @lpil and @ghivert!
Yes, the backend is existing Hex APIs and the newly added Search API. Our goal is also to serve a static page, so no SSR. We probably want the homepage (the first screen) to be indexable though but I guess that should be doable. And I was told most engines index using a JS engine anyway?
We do have one. We also have someone who can do the translation from Figma mockup to HTML + Tailwind. Or would you rather tackle it too? This is very exciting! |
I'm really happy to be able to help!
What we could do is performing some SSG in that case: no full-fledges SSR, but the HTML statically served contains the initial render. So it could be nicely indexed by search engines, and client-side runtimes will then take care of rendering the content after that (with hydration). I think it makes sense at least for the homepage to be pre-rendered, to improve search engine indexing. I think the SSR question is also related to the support of the Open Graph Protocol for Hex. Without SSR, it's not possible to have proper Open Graph tags. With OG tags, we could provide nice displays on some applications, like Discord or Slack when linking HexDocs URL. I'm not sure it's really useful, and it will be more work. I think it's possible to start with a first implementation entirely client-side, and potentially migrate server-side later if needed (if things like OG tags are required).
To be fully transparent on that point, Tailwind is not my favorite tech. If you have someone who's expert with (or at least used to), I think it can be a way to gain some time, but they're too much busy, I can tackle it too. 🙂 Talking about time, do you have some deadline for a working implementation? |
We are open to alternatives, if you have any mind. :) I suggested Tailwind because it is most likely others will be familiar with it. @paulo-valim made himself available to translate to Tailwind but that will probably only happen within a month. We don't have a deadline per se, given it is all open source. |
Correction, @paulo-valim has already started working on HTML + Tailwind, so we should have something as base sooner than later. :) |
I'm on the pure CSS side of the force! I consider CSS simpler than any framework, but as any take, it's highly debatable 😉 If @paulo-valim started working on it, I'd suggest to wait for him to finish, and then implement the HTML in the Lustre code. That will be less work UI-related and more time to properly implement the flows! Thanks for your answers about the deadlines. |
Perfect. We will work on getting the API descriptions for you before the weekend (hopefully tomorrow!). |
Thanks ! No worry though, if you need some time, I can still postpone experimentation (I thought API descriptions were already written). Do not crush for me! 🙂 |
Hey everyone, some updates:
etc.
This will be relevant when based on list of selected packages we'll generate a "short ink" for I'll post here once 1. and 2. are done. Hopefully this is enough information to iterate on the frontend that will consume those endpoints, let me know otherwise! |
Oh, the short links API requires a user token? So let's remove this functionality from the proof of concept for now. So overall:
Please let us know if you have any questions @ghivert! |
Hi! I started playing with the different API. I implemented a quick PoC with Lustre, that you can find here. That first draft is made of two pages:
Because a demo is always nice, here's two short videos to illustrate the possible actions: Details
https://github.com/user-attachments/assets/878ecc3f-0da1-460e-ae99-598eb2e4308b Because I was unsure of the user flows we desired for HexDocs homepage, I prefered to stay simple and implement the different parts of the logic to be able to reuse them later with the different screens and flow. Nowadays the code is living in a separate repo for the PoC, but I suppose it should also integrate HexDocs repo directly? In that case I think it's wiser to let you tell me where to integrate and how, but I can also take a look and find an appropriate location. 😄 Everything here is a bit rough and needs more polishing. Here's how I understand the user flows from the two screenshots above:
Is it OK? Is there anything I'm missing? |
👋 @ghivert Just a note: https://github.com/ghivert/hexdocs-search seems to be private :) Or maybe it's something else but it returns 404 for me right now. |
Oh ! Thanks for warning ! I changed the visibility ! |
Hi @ghivert! First off, no need to apologize, we are all working on our free time, so any contributions and updates are really welcome! ❤️ The demos are nice and it is an exciting preview of what is to come! I will talk a bit about the flows but that's what I have on my mind and I am very open to suggestions. Home pageThe home page should work as a search engine. You join the website, the input is focused, and you start typing. If you type
Once you type something, you can submit the search by clicking the button or pressing enter. Doing so takes you to search page. Search pageThe search page converts the query from the previous page into something a bit more structured. Any package that you added to your input goes to the sidebar. If no version is specified, we automatically pick the latest. New packages can be added at any time, which triggers a new search. If you do a search with no packages, we should probably show a warning asking them to add packages to filter the results. StructureI believe the application is a SPA. As you perform queries and add packages, they should automatically change the URL, so we can easily share results with someone else. WDYT? Just one note, I am a Gleam noob, what is the best way to run the project? Perhaps we can add the steps in the README? I tried what is there and it didn't work. Thanks and have a great weekend! |
Today's home page is fully done in the client, we should probably mirror that here.
Overall, the main feature we want to have is full-text search across (at least) one or more packages. You can add packages by typing
#
which will trigger an autocomplete, such as#phoenix_live_view
. You can then press:
to autocomplete a given version, otherwise the latest is picked from the hex.pm API. If the search only has the package information, such as#ecto
or#ecto:1.0.0
, and no search term, we go to the particular package (+ version).Anything else we could do when it comes to search? /cc @ericmj @ruslandoga @wojtekmach
I will work on a mockup to the new homepage. The
mix hex.search
andExDoc
can come later.The text was updated successfully, but these errors were encountered: