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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Fix layout shift ad #37694

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Jun 24, 2023

This was broken at one point, the UX is not great, there are 2 layout shifts:

Screen.Recording.2023-06-25.at.00.03.14.mov

https://mui.com/joy-ui/getting-started/overview/

It's so smooth now 馃槍 https://deploy-preview-37694--material-ui.netlify.app/joy-ui/getting-started/. I think that it matters because we want the ad to blend into the content, the less it's distinguishable, the less developers will avoid it.

@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work regression A bug, but worse scope: docs-infra Specific to the docs-infra product labels Jun 24, 2023
@mui-bot
Copy link

mui-bot commented Jun 24, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes

Generated by 馃毇 dangerJS against 002fa21

@oliviertassinari oliviertassinari force-pushed the fix-layout-shift-ad branch 3 times, most recently from 6d3ae6c to a409062 Compare June 24, 2023 22:13
Comment on lines -221 to +222
m: (theme) => theme.spacing(4, 0, 3),
mt: 4,
mb: 3,
Copy link
Member Author

Choose a reason for hiding this comment

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

Clean up

@@ -111,7 +111,7 @@ class AdErrorBoundary extends React.Component {
}
}

function Ad() {
export default function Ad() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Convention

@@ -47,7 +47,7 @@ const StyledAppContainer = styled(AppContainer, {
...(!disableAd && {
...(!hasTabs && {
'&& .description': {
marginBottom: 198,
marginBottom: 4 * 10 + 3 * 10 + 126,
Copy link
Member Author

Choose a reason for hiding this comment

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

The fix 1/2

Comment on lines 88 to 92
// TODO, remove this prop, the layout should be retained as much as possible
// between pages, to improve performance, and retain UI states, e.g. scroll
disableLayout = false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Clean up, I don't understand how the creation of AppLayoutDocsWithoutAppFrame.js would be the right thing to do.

padding: `${theme.spacing(1.5)} ${theme.spacing(1.5)} ${theme.spacing(
1.5,
)} calc(${theme.spacing(1.5)} + 130px)`,
padding: '12px 12px 12px calc(12px + 130px)',
Copy link
Member Author

Choose a reason for hiding this comment

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

Retain the same style values, after changing from spacing.unit 8px to 10px.

}, [theme]);

// TODO: remove MdThemeProvider, top level layout should render the default theme.
Copy link
Member Author

Choose a reason for hiding this comment

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

I think that this is really important, we want to show the default look in the docs.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 24, 2023
@oliviertassinari oliviertassinari force-pushed the fix-layout-shift-ad branch 2 times, most recently from 66cbb05 to 153b85a Compare June 24, 2023 23:16
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 24, 2023
@oliviertassinari oliviertassinari merged commit 8f246c1 into mui:master Jun 30, 2023
18 checks passed
@oliviertassinari oliviertassinari deleted the fix-layout-shift-ad branch June 30, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work regression A bug, but worse scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants