scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Scaladoc: New UI design

Open pikinier20 opened this issue 1 year ago • 18 comments

Big thanks to all people involved in this initiative. Especially, I would like to thank @fanixus96 for implementing majority of these changes

pikinier20 avatar Jul 18 '22 08:07 pikinier20

Where can we see the result?

sjrd avatar Jul 18 '22 08:07 sjrd

Where can we see the result?

https://scala3doc.virtuslab.com/pr-new-ui/scala3/index.html

pikinier20 avatar Jul 18 '22 08:07 pikinier20

Anchor links don’t seem to work well: https://scala3doc.virtuslab.com/pr-new-ui/scala3/api/scala.html#List-0 (I had to scroll up to see the definition of type List[A].

julienrf avatar Jul 18 '22 09:07 julienrf

Screenshot from 2022-07-18 11-25-52

I am not sure about the spacing here. I find that there is too much space in between the members, and too much padding within each member. The text “Attributes” looks too big to me. There is an overlapping issue in the “Throws” section. Last, I don’t think we should use a monospace font for descriptions.

Also, case class fields are not shown in the members' list.

For comparison, this is how it looks like before the PR:

Screenshot from 2022-07-18 11-34-42

And, with Scaladoc of Scala 2:

Screenshot from 2022-07-18 11-35-56

julienrf avatar Jul 18 '22 09:07 julienrf

@julienrf We already had a conversation about space between members and we decided to implement some switch with "concise" view

pikinier20 avatar Jul 18 '22 09:07 pikinier20

On mobile, when you open the burger menu there is no way to close it.

julienrf avatar Jul 18 '22 09:07 julienrf

Minor: h1 cut:

image

Due to:

#content>div:first-child {
  overflow: hidden;
}

And the line-height being set in .body-medium with an absolute px value that is too small for h1.

mbovel avatar Jul 18 '22 10:07 mbovel

Screenshot from 2022-07-18 11-25-52

Also about this: please don't use a monospace font for normal text. Reserve that for code.

sjrd avatar Jul 18 '22 12:07 sjrd

Somewhat on the same topic: compare Awaitable.ready (with link) to ExecutionContext (without link): image They look pretty different, although both are inline code snippets. Consider making them look more similar to each other (while still keeping a distinction for the clickable one) and more different from the normal text.

sjrd avatar Jul 18 '22 12:07 sjrd

Anchor bug: go to https://scala3doc.virtuslab.com/pr-new-ui/scala3/api/scala/concurrent/Future.html, then click on the name andThen (the very fist member) -> the whole section disappears. (If you then reload, with the updated URL, you get the expected result.) Reproducible on Firefox and Chrome.

sjrd avatar Jul 18 '22 12:07 sjrd

I am looking at scala.quoted.Quotes and it suggests there are quite a few "deprecated extension methods", including matches, but In the source only valueOrError is deprecated - not sure of the cause here, perhaps annotations are copied between extensions?

Screenshot 2022-07-18 at 14 58 51

bishabosha avatar Jul 18 '22 13:07 bishabosha

image IMO we should not use a font with ligatures in documentation. When you read it there, you have no idea how to type it in your editor. (and copy-pasting is often more annoying than necessary because it's also a link)

sjrd avatar Jul 18 '22 13:07 sjrd

I am looking at scala.quoted.Quotes and it suggests there are quite a few "deprecated extension methods", including matches, but In the source only valueOrError is deprecated - not sure of the cause here, perhaps annotations are copied between extensions?

Screenshot 2022-07-18 at 14 58 51

This bug is not related to the new UI - https://dotty.epfl.ch/api/scala/quoted/Quotes.html#

pikinier20 avatar Jul 27 '22 09:07 pikinier20

In https://scala3doc.virtuslab.com/pr-new-ui/scala3/api/scala/collection/immutable/List.html the code samples are not fully visible without horizontal scrolling: Screenshot_20220804_111231 Compared with https://www.scala-lang.org/api/2.13.8/scala/collection/immutable/List.html and http://dotty.epfl.ch/api/scala/collection/immutable/List.html, the font size is bigger and the width of the main content of the page is smaller in the new design. I don't mind a fixed width but I think a bigger one would work better here. Compare also with https://doc.rust-lang.org/std/macro.matches.html

smarter avatar Aug 04 '22 09:08 smarter

"Run" buttons need to add package import first, but it still might not be enough to compile the more complex examples:

image

vs

image

arturopala avatar Aug 04 '22 09:08 arturopala

image

I've got the horizontal scroll but it might be related to some browser's compatibility with used CSSes. I've used Chrome + Safari

pikinier20 avatar Aug 04 '22 11:08 pikinier20

"Run" buttons need to add package import first, but it still might not be enough to compile the more complex examples:

image

vs

image

There's some work to do in terms of retrieving nested objects and importing them correctly. I think we can do it after merging the new UI.

pikinier20 avatar Aug 04 '22 11:08 pikinier20

In https://scala3doc.virtuslab.com/pr-new-ui/scala3/api/scala/collection/immutable/List.html the code samples are not fully visible without horizontal scrolling: [...] I don't mind a fixed width but I think a bigger one would work better here. Compare also with https://doc.rust-lang.org/std/macro.matches.html

Related to this, I've noticed that when the window is small, the width of the #content > div:first-child is bigger (this width is acceptable): image

and when I maximize the window it gets smaller (too small): image

I presume that this is because of:

@media (max-width: 1436px)
#content > div:first-child {
  width: auto;
}
@media (max-width: 1920px)
#content > div:first-child {
  width: calc(90 * var(--base-spacing)); /* this should be larger */
}

I've tested

@media (max-width: 1920px)
#content > div:first-child {
  width: 980px; /* on Firefox it's almost the perfect value, YMMV */
}

and it seemed quite good at avoiding the sudden shrinking of the central div :)

TheElectronWill avatar Aug 05 '22 14:08 TheElectronWill

Are all the issues which were raised in this PR planned to be addressed? Should we open new issues to track them?

smarter avatar Aug 17 '22 09:08 smarter

Are all the issues which were raised in this PR planned to be addressed? Should we open new issues to track them?

I think that if some bug wasn't addressed and is still present then we should have a separate issue for it.

pikinier20 avatar Aug 17 '22 10:08 pikinier20