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

Move information to the sidebar, enforce max width #447

Merged
merged 4 commits into from
Nov 9, 2020

Conversation

zbynek
Copy link
Contributor

@zbynek zbynek commented Nov 1, 2020

This PR

  • moves some elements from the header to the sidebar
  • sets max-width (and slightly increases the font size) to make sure the documentation easier to read
  • changes wording in a few places to make text more concise
  • makes the graph smaller and removes y-axis labels; together with the current number of installs this should provide enough info (the values are still available on mouseover).
  • removes a duplicated GitHub link

image

Most of these changes are inspired by NPM.

@zbynek zbynek requested a review from a team as a code owner November 1, 2020 01:20
@@ -5,7 +5,7 @@ function PluginReadableInstalls({currentInstalls}) {
if (!currentInstalls) {
return <>No usage data available</>;
}
return <>{currentInstalls}</>;
return <>{new Intl.NumberFormat('en-US').format(currentInstalls)}</>;
Copy link
Member

Choose a reason for hiding this comment

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

I've never used this util. If you specify the format does it only do it for us style numbers? Is possible to let the browser pick the locale?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we omit the locale name, the browser locale will be used. But when formatting dates we are also using US locale and almost all the texts are in English, so I thought this is more consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yea totally a good plan. I was just curious how it worked.

I think I started separating dates into its own components for that reason, so we could eventually fix it. I just didn't go far enough

Copy link
Member

@halkeye halkeye left a comment

Choose a reason for hiding this comment

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

Lgtm.

@timja timja requested a review from daniel-beck November 1, 2020 07:54
Copy link
Contributor

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Especially de-emphasizing the (often outdated) maintainers list is a good idea.

The graph takes some getting used to, but I can see it being there to only show the trend, and it should be fine for that. Glad we got the y=0 integrated before this 😉

Curious why we're lot putting all the metadata to the side, in a "Current Release" section? (Except for ID, which applies to all releases. That one may be best above the tabs, next to the label.)

const calculateMinMax = (data) => {
const maxValue = Math.max(...data);
// calculate a dynamic value to center the graph
const scaleDifference = Math.pow(10, maxValue.toString().length-1);
return {
min: 0,
max: parseInt((maxValue/scaleDifference)+1)*scaleDifference // plus 1 to add more space in the top
max: Math.ceil((maxValue/scaleDifference) + 0.25)*scaleDifference // plus 0.25 to add more space in the top
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be done much more simply if we're getting rid of the Y axis labels, as the only thing this seems to accomplish having no weird (non-even, differently spaces) outlier as the max Y value.

Just use maxValue*1.2 or so as the max?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the last commit.

@daniel-beck
Copy link
Contributor

Thanks for the review request @timja !

@zbynek
Copy link
Contributor Author

zbynek commented Nov 1, 2020

Curious why we're not putting all the metadata to the side, in a "Current Release" section? (Except for ID, which applies to all releases.)

I didn's see a strong reason to move those and NPM is also not putting this information in the sidebar. But it can be moved of course. If we'd that, where should the ID go?

@daniel-beck
Copy link
Contributor

But it can be moved of course. If we'd that, where should the ID go?

My suggestion would be to try below display name and above tabs.

@zbynek
Copy link
Contributor Author

zbynek commented Nov 8, 2020

@daniel-beck I moved the version to the right; the ID is in a floating block that's either below the title or to the right, depending on ID length and screen size.

in a "Current Release" section

Currently the version number itself is used as a heading to some space.

Copy link
Contributor

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

This looks great 😻

@zbynek
Copy link
Contributor Author

zbynek commented Nov 8, 2020

Given the approvals I'll merge this in 24 hours if there is no negative feedback.

Copy link
Contributor

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

Re-:+1:

@zbynek zbynek merged commit 54c698f into jenkins-infra:master Nov 9, 2020
@zbynek zbynek deleted the sidebar-layout branch April 12, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants