v2.ocaml.org icon indicating copy to clipboard operation
v2.ocaml.org copied to clipboard

Improve Documentation manual searchbar

Open Ndipbanyan opened this issue 3 years ago • 9 comments

Issue Description

The search bar in /api/index can be improved to look better

Fixes #1410

Changes Made

I made changes to the api/index.html file to include a div and change the position of a span element I also added a style id api_search_container to the style.css file of site api directory

Before

Screenshot 2021-04-07 at 17 47 43

After

Screenshot 2021-04-07 at 17 48 33
  • Please check if the PR fulfills these requirements
  • [x] PR is descriptively titled and links the original issue above
  • [x] Before/after screenshots (if this is a layout change)
  • [ ] Details of which platforms the change was tested on (if this is a browser-specific change)
  • [ ] Context for what motivated the change (if this is a change to some content)

Ndipbanyan avatar Apr 07 '21 16:04 Ndipbanyan

To give some context here: @patricoferris and @Octachron have been talking about drafting this PR here to see how it looks like on staging, but ultimately back port it to the compiler (see #1410).

pitag-ha avatar Apr 09 '21 14:04 pitag-ha

This goes wrong in a fun way on the staging site... :-) https://staging.ocaml.org/releases/4.12/api/index.html

https://user-images.githubusercontent.com/53164/114734509-2fc57380-9d3c-11eb-812b-e552f94b0c77.mov

avsm avatar Apr 14 '21 15:04 avsm

I'm just turning this into a draft PR until the issue above is fixed (it helps me sort the outstanding PRs). Feel free to mark it ready for review when you push a fix.

avsm avatar Apr 14 '21 16:04 avsm

So this is what it currently looks like on the site

https://user-images.githubusercontent.com/67186679/114852426-ac0e9400-9dda-11eb-822b-6210e31c9a5b.mp4

So I just moved the (search values, type signatures, and descriptions - case sensitive) (which is a span) as a placeholder in the search bar while still retaining the styling it had while outside the search bar. However, I can take it ((search values, type signatures, and descriptions - case sensitive) back to where it was originally (outside of the search bar).

@avsm I will like to know what you think about this. Thanks.

Ndipbanyan avatar Apr 15 '21 10:04 Ndipbanyan

@Ndipbanyan I think the problem is that the font size of the dropdown appears to change as you move the mouse in the videos. That's unexpected... it should be a constant font size.

avsm avatar Apr 19 '21 19:04 avsm

@avsm I will fix that and will mark it ready for review.

Ndipbanyan avatar Apr 20 '21 07:04 Ndipbanyan

This is almost mergeable, but not quite; the font size of the help text is significantly smaller than the ones below it in the main text, and so hard to read. Also, there needs to be a little left padding on the hint text inside the box to avoid it going too flush to the left I think. @pitag-ha @Octachron are you ok with merging after these suggestions (with a future backport to the main repository)? For reference the staging page is at https://staging.ocaml.org/releases/4.12/api/index.html

image

avsm avatar Apr 21 '21 07:04 avsm

This is almost mergeable, but not quite; the font size of the help text is significantly smaller than the ones below it in the main text, and so hard to read. Also, there needs to be a little left padding on the hint text inside the box to avoid it going too flush to the left I think. @pitag-ha @Octachron are you ok with merging after these suggestions (with a future backport to the main repository)? For reference the staging page is at https://staging.ocaml.org/releases/4.12/api/index.html

image

@avsm I made changes to effect the suggestions you raised above and pushed. This is what it looks like now Screenshot 2021-04-21 at 09 36 58

Ndipbanyan avatar Apr 21 '21 08:04 Ndipbanyan

I think that the help, being automatically displayed when typing, hides a large part of the screen, and prevents from seeing results on-the-fly (which was the main interest of this widget, imho). Previously the help would display only when you hover the text on the right, outside of the search box, and the help grew bigger (easier to read) when you hovered it. Not very pretty, I agree, but convenient.

sanette avatar Apr 21 '21 09:04 sanette