Skip to content
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

Show languages in the docs sidebar #2859

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

AndreasArvidsson
Copy link
Member

So far our implementation of scope facets have been lacking and therefore we made the decision to hide languages in the docs sidebar. Now our support for scope facets in the most common languages is quite good so I would like to show languages.

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner February 19, 2025 08:22
@pokey
Copy link
Member

pokey commented Feb 19, 2025

I don't think these pages are particularly helpful in their current form. I don't think we can expect users to know how to read these raw facet ids. We should probably organise them by scope, and then make the names easier to read / show descriptions. As it stands I think they'll be more confusing than useful

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Feb 19, 2025

I think my initial intent was to add them to the developer section of the docs. It's still really useful for a developer to be able to see what is missing from a particular language. It's hard in the source code to see which keys are missing since we have so many.

Grouping them by scope and showing description shouldn't be any problems though. I can definitely do that.

@pokey
Copy link
Member

pokey commented Feb 19, 2025

Grouping them by scope and showing description shouldn't be any problems though. I can definitely do that.

Yeah and maybe splitting on . and removing scope name to make the names look a bit more human-readable

Also I'd prob hide the unknown ones in a details expander. And unsupported I wonder how useful to show to users. If we do we should probably make not too prominent and link to contributor docs if they wanna roll up their sleeves

@AndreasArvidsson
Copy link
Member Author

Sounds good. I start working on that.

@AndreasArvidsson
Copy link
Member Author

@pokey I have now updated the scope facets with expandable cards and grouped scopes.

@@ -0,0 +1,3 @@
export function capitalize(str: string) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ludicrous that this is not part of the javascript standard.

@@ -28,3 +28,19 @@
.hidden {
display: none;
}

.card {
Copy link
Member Author

@AndreasArvidsson AndreasArvidsson Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I could tell we don't have a css library for the docs page? I didn't want to add one for this simple use case.

function prettifyFacet(facet: ScopeSupportFacet): string {
const parts = facet.split(".").map(camelCaseToAllDown);
if (parts.length === 1) {
return capitalize(parts[0]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some facets just have the same name as the scope. In that case I just keep it.

image
image

@pokey
Copy link
Member

pokey commented Feb 21, 2025

I would try to avoid extra css. I would just put the list of scopes directly under Scope facets heading, and then use a <details> element to hide the rest.

I would also rename Scope facets to Scopes

And I wouldn't bother explaining what a facet is. I don't think it matters. We just want to list the scopes and the places they're supported

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Feb 21, 2025

When I try details I don't get the same formatting as in the examples

image

Probably because we're using react. When I try to put the details tag directly in markdown it works.

@AndreasArvidsson AndreasArvidsson requested a review from pokey March 29, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants