fix: tune playground preview heights and embedded iframe layout IX-4305#252
fix: tune playground preview heights and embedded iframe layout IX-4305#252alexkaduk wants to merge 5 commits into
Conversation
✅ Deploy Preview for industrial-experience ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds iframe load-time normalization in ChangesPlayground iframe normalization and doc height corrections
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adjusts the heights of various playground components across multiple documentation files and introduces a helper function, normalizeEmbeddedPreviewDocument, to normalize the styles of embedded preview documents within the Playground component. The reviewer suggests adding a defensive check in the apply callback to ensure doc.documentElement exists before accessing its style property to prevent potential runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
💡 What is the current behavior?
On component Code pages, inline Playground previews often clip demo content or show unwanted vertical scroll inside the iframe:
height="Xrem"values were too small for content at the docs column width (e.g. flip tiles wrapping into multiple rows, layout-grid body scroll exceeding IX bounding boxes).<Playground>blocks inmodal/code.mdxusedheight={props.height}, which is undefined outside autogenerated playground MDX — previews fell back to the browser default iframe height (~150px).html/bodyto100vh, causing spurious overflow/scrolling in embedded previews.🆕 What is the new behavior?
Playground: on iframe load (and afterixInitPromise), normalize the embedded document — resethtml/bodytoheight: auto, clear forced inlineoverflow, setbody min-height: 0. If an MDX height is too small, content remains reachable via iframe scroll instead of silent clipping.height={props.height}→ 15rem (room for opened modal)Test plan
pnpm start.docs— spot-check updated pages at 100% zoom15rem, notprops.height👨💻 Help & support
Summary by CodeRabbit
Documentation
Chores