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

[docs-infra] Allow to pass navigation bar banner from outside #36299

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Feb 22, 2023

Motivation

After a stable MUI X release, in MUI X v5 docs, a notification for v6 is needed to be shown similar to the one here for v5.

Exposing a prop from AppLayoutDocs which receives Banner component will allow to:

  • Control banner visibility directly from MUI X docs
  • Show banner only on MUI X docs (as needed for v5 because both v5.mui.com and mui.com will point to the same version of MUI Core but different of MUI X, so adding a banner like today won't do the need full.)
  • Not have to bump monorepo everytime a new banner is needed in X

This PR will be accompanied by update in docs-v5 adding banner on MUI-X stable release.

@MBilalShafi MBilalShafi added the scope: docs-infra Specific to the docs-infra product label Feb 22, 2023
@MBilalShafi MBilalShafi self-assigned this Feb 22, 2023
@mui-bot
Copy link

mui-bot commented Feb 22, 2023

Netlify deploy preview

https://deploy-preview-36299--material-ui.netlify.app/

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against 503051c

Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

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

👍

children: PropTypes.node.isRequired,
className: PropTypes.string,
disableDrawer: PropTypes.bool,
};

AppFrame.defaultProps = {
BannerComponent: AppFrameBanner,
Copy link
Member

Choose a reason for hiding this comment

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

Should we set enable_docsnav_banner to false to hide the current banner given the upcoming v6 stable release?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's a good point. By the way, do you think it will improve adaption a bit by keep showing this banner (after updating text v6-beta -> v6) on core docs for a few weeks after stable? After a short period we can remove it from core docs and only keep it in v5 X-specific docs. What do you think?

Something like:
image

Side note: I noticed that this banner is not displayed for smaller width screens i.e. < 1200px (when the sidebar disappears), this is probably to keep UI for mobile screens consistent and single liner but I feel some desktop displays also fall under the same screen resolution range.

I am not sure how much a percentage of users are on smaller displays, but adding this on smaller ones will possibly improve its visibility a bit.

Copy link
Member

Choose a reason for hiding this comment

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

do you think it will improve adaption a bit by keep showing this banner (after updating text v6-beta -> v6) on core docs for a few weeks after stable?

That's a good idea for sure!
Although we have to make sure that the v6 stable banner only appears after the release is done.
We can keep the current banner, and then update it as soon as the v6 stable is available and deploy it to production (new instructions in #36301 could be helpful for the deployment process)

I am not sure how much a percentage of users are on smaller displays

In the last 12 months, the breakdown looks like this:

  • desktop: 97.73%
  • mobile: 2.19%
  • tablet: 0.09%

https://analytics.google.com/analytics/web/#/report/visitors-mobile-overview/a106598593w187396170p184180857/_u.date00=20220223&_u.date01=20230223

I would not focus too much on adding this banner on mobile.

docs/src/modules/components/AppFrame.js Outdated Show resolved Hide resolved
@MBilalShafi MBilalShafi marked this pull request as ready for review February 23, 2023 03:52
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 will see how to make it easier in the future.

@MBilalShafi MBilalShafi merged commit 41ed0bf into mui:master Feb 23, 2023
@MBilalShafi MBilalShafi deleted the extend-banner-component branch February 26, 2023 14:18
@oliviertassinari oliviertassinari changed the title [docs] Allow to pass navigation bar banner from outside [docs-infra] Allow to pass navigation bar banner from outside Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants