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] Improve ad display #21219

Merged
merged 10 commits into from
May 28, 2020

Conversation

oliviertassinari
Copy link
Member

A collection of small changes.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label May 26, 2020
@oliviertassinari oliviertassinari changed the title [docs] improve ad display [docs] Improve ad display May 26, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented May 26, 2020

No bundle size changes comparing d49be19...ca9f542

Generated by 🚫 dangerJS against ca9f542

@@ -33,17 +33,26 @@ const useStyles = makeStyles((theme) => ({
},
}));

// Persisted for the whole session
const random = Math.random();
Copy link
Member

Choose a reason for hiding this comment

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

Why do we not want to cycle through the diamond sponsors while browsing?

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 logic avoids layout jumps for a given session.

Copy link
Member

Choose a reason for hiding this comment

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

Could you include this in the comment? You're talking about re-mounting in the navbar which can be fixed. Please be specific since we don't do this for Ads.

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 have added this in the comment. Also, we will increase the display split to 25% starting next month (up from 5%).

Copy link
Member

Choose a reason for hiding this comment

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

Layout jumps where? The question you're trying to answer is why this doesn't apply to 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.

The logo doesn't reserve any space. When we decide to display it, we move the menu items down by 35px. The objective is to avoid this repeated jump down and up.

I don't see the link with the Ad component. There, we always display an Ad. We have a few random usage for increasing the cardinality of ads people see.

Copy link
Member

Choose a reason for hiding this comment

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

There, we always display an Ad.

But we cycle through them so it's not immediately clear they don't cause a layout shift as well.

I thought this variable decides which diamond sponsor we display not that we display one.

Maybe add a descriptive name for the variable so that it's obvious what this is used for? In the current form it can be used for anything "random" which is most the time the wrong semantics.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah ok, changing the name

@oliviertassinari oliviertassinari merged commit d34d0ee into mui:master May 28, 2020
@oliviertassinari oliviertassinari deleted the docs-improve-ad-display branch May 28, 2020 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants