-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Fix EmbedLiveSample macro heights, part 1 #16998
Conversation
I'm not sure why we are doing this in content rather than fixing it in the platform as requested in mdn/yari#6445. How many examples are affected by this, and how many PRs are we asking people to review, by choosing to fix this in content rather than in the platform? Do these PRs check that the examples don't want to have scrollbars? Some examples do, such as https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API/Timing_element_visibility . |
There are only 603 pages to fix. Rest of the pages do not have the scrollbar in their live samples. This is nothing compared to #16255. The PR doesn't simply search and replace the heights. The script actually renders the live samples in a browser, detects the presence of the scrollbar, and computes required height to eliminate the scrollbar. Following is the basic algo:
Here is the script in action: updatescroll.mov@teoli2003 to answer your question about auto detecting heights, this is how it could be done. Yari could use a headless browser.
~600 pages(using the script mentioned above).
The point 3.2.2 in above algo covers this. Using the PR companion the reviewers have to simply open the preview links in new tabs and skim the pages to see if the scrollbars remained. |
@OnkarRuikar I think we can close this, yes? |
Though less annoying now but those scrollbars aren't completely gone after the recent yari patch. Also, we didn't have to sacrifice the padding. 😩 I was waiting for #6561 to get in... Anyway as we are not going this route lets close this. It was fun to implement the script. Let me know if such work is needed in any other areas. Like new titles for the pages for better SEO. |
Ah, right. Still I agree with closing this now.
It seems like you found lots of live sample errors with the script, so it was useful! |
Some of the
EmbedLiveSample
macro outputs got vertical scrollbars after the PR mdn/yari#5337. Due to the shortened heights, the outputs are obscured.The PR updates live samples that have vertical scrollbars due to their height falling short by small margin.
In order to include lower resolutions, the heights have been updated considering 600px wide iframe.
Note: Only the live samples with scrollbars have been targeted.