-
Notifications
You must be signed in to change notification settings - Fork 119
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
Dart 3 class modifiers should be clearly visible in dartdocs #3392
Comments
cc @srawlins @jcollins-g, I think this is a pretty important change for Dart 3. wdyt? |
We should probably also have an |
IIRC this was an intentional decision. I don't believe we consulted UX at the time (CC @InMatrix), but some subset of the team agreed that these did not need to be prominent on the page (as I think we strayed away from the chips idea because @InMatrix has some students who pointed out that the chips are very prominent to the point of distraction in other pages, like this: But in your suggestion, there wouldn't be too many chips cluttering up the page next to the class (max of... 3?) so it could probably work. |
I had considered this, but this was also left out because there wasn't much time for a UX design pass when we needed to implement and ship this and given the historical handling of |
Showing capability chips after the class name seems OK, since there aren't other chips in that part of the page. If we do that, we can drop "abstract final` from the breadcrumb to make it easier to read. |
@InMatrix sounds reasonable. Should chips be displayed on the library pages as well with each class listed? |
I don't think the breadcrumb is even close to visible enough. I only found it as I did a CTRL-F search for the word |
It depends on what kind of user need, if any, displaying those chips on the library pages might serve. For example, do we anticipate users to look for classes with specific capabilities on a library page such as https://api.dart.dev/beta/3.0.0-417.2.beta/dart-io/dart-io-library.html? Will they decide to click into a class page based on whether that class is abstract or not? I'd not show those chips on the library pages until we identify concrete value they might provide to the user. |
The main reason to show the modifier chips is to communicate things that you can't do (like instantiate an abstract class). I think it might be sufficient to show that on the individual class pages. |
I'll take a look at adding the chips and replacing the words in the breadcrumb with those. Not currently planning to cherry pick this however. |
Why not? This seems like a major usability trap. There is no way to see in the current docs what the class capabilities are (the breadcrump is really insufficient). |
@mit-mit Mostly because I don't think it is important enough compared to the other issues being raised for cherry picks. The extra effort required to either precisely cherry-pick out of a third_party repository or mitigate any risk from other PRs landing in dartdoc seems like it'd be better spent improving more things for the next release, which isn't really that far behind 3.0. I'm open to being wrong though. And if I can get this landed quickly with minimal fuss perhaps a cherry pick is possible. |
Chatted with others about this; I will try to get a cherry pick in this week if possible, one that includes the whole set of changes since the beta cut for dartdoc including this one to mitigate the risk and effort of trying to extract individual changes. We'll also hold two large changes with higher risk that are still in the review hopper until that's done. Should for whatever reason this change not be landed by end of week, we'll not try to last-minute cherry pick it. |
SGTM |
Dart 3 apps new class modifiers (dart-lang/language#2242), and the core libraries have been updated to many cases to use these. For example, the
platform
class indart:io
is nowabstract final
.In the current DartDocs it's very hard to see these modifiers (e.g. platform). They are shown just textually near the top:
I'd like to suggest the following improvements to make class modifiers more clear:
strikethroughtext) with capability chips detailing why. From @lrhn the combinations where the constructor isn't available are: a)sealed
, b)abstract final
, and c)abstract interface
).The text was updated successfully, but these errors were encountered: