scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.88k stars 1.06k forks source link

Scala3doc UI and UX improvements #11136

Closed Katrix closed 2 years ago

Katrix commented 3 years ago

Seeing as most of the things in the old issue were dealt with and the issue closed, I thought I'd go check out the state scala3doc and see what lesser things that could probably be fixed next. Hope you don't mind.

Type members:

Value members:

Misc:

Also, is there a live link to an instance of the scala3doc that shows off some stuff? The main one for Dotty doesn't expand packages, and the old ones from before this got merged in here are dead.

pikinier20 commented 3 years ago

Replying to some points of your feedback:

  1. Scala3doc adds confusing type lambdas to type signatures and we are aware of that, but it's a problem related to TASTY - it generates the same type tree for type lambda and e.g. [_ :> T] construction and it's hard to disambiguate it.
  2. It's a good idea to add source name instead of (source) text.
  3. Companion object links as well as icons from Scaladoc are planned to be ported, there's already task for that which tbh should be transfered to this repo
  4. I think we should filter some annotations like mentioned SerialVersionUID
  5. There's live link to scala3doc there and there you can see some instances of community lib docs.
Katrix commented 3 years ago

Thanks for the links to updated instances. I've noticed that packages can't be expanded anymore. Is that a deliberate design decision?

Also some more notes on the sidebar that I just found. First off, you can scroll it horizontally.

image

Also, if you expand something so that the sidebar goes from not being scrollable, to being scrollable, then the arrows move. Would be best if they didn't. If it's hard to make them not move, then maybe just show the scroll bar at all times?

BarkingBad commented 3 years ago

Type members:

Value members:

Misc:

BarkingBad commented 3 years ago

@Katrix I tried to address all of your requests, some I checked as resolved, some are just explained why I could not provide solution for now. Please assess which one would you like to implement and provide more information, and for those that are not valid for now please checkbox them as resolved.

BarkingBad commented 3 years ago

When the documentation is published via CI, the snapshot example should be available here https://scala3doc.virtuslab.com/pr-ux-fixes/index.html as a quick reference to above issues.

Katrix commented 3 years ago

Can't check the checkboxes, but I can go over what you've written at least 😄

The first paragraph of the scaladoc of a class is smaller than the rest: Seems to have been fixed.

Ill formatted Option: Tested the given source on a completely different thing of mine which uses Flexmark, and it rendered fine. It's probably either a bug, or a configuration option. I can see if I have time to look into that.

Showing class Annotations: That sounds like a wonderful solution honestly

Scaladoc member grouping: The groups the old Scaladoc does, which is not done currently here are: constructors, concrete and abstract value members For abstract and concrete, see here how old Scaladoc does it compared to how it's done currently https://scala3doc.virtuslab.com/pr-master/scala3/api/scala/concurrent/Promise.html https://www.scala-lang.org/api/current/scala/concurrent/Promise.html

Should I open seperate issues for the remaining bigger items? Name of source file Documented annotations Page width

BarkingBad commented 3 years ago

I'm working on part 2 of that issue.

BarkingBad commented 3 years ago

Current progress of issues

smarter commented 3 years ago

Scaladoc member grouping

fyi, I opened an issue about this with some suggestions a while ago: https://github.com/lampepfl/dotty/issues/10893

pikinier20 commented 2 years ago

I think all issues listed in this task are already adressed so I close it.