Repository navigation
fix(docsite): keep the template preview header inside the dialog - #6276
Merged
Merged
Conversation
On a phone the preview dialog opened with its whole surface pushed off to the side: the title, the commands and the close button were all cut off and no amount of scrolling brought them back. The header laid its command rows and the primary action out on one line. That line's min-content width is far wider than a phone (~976px at the canary target, which shows two command rows), so the header pushed the dialog body past the viewport. The body is clipped with `overflow: hidden`, which is still programmatically scrollable: initial focus landed on a control in the overflowing area, the browser scrolled it into view, and the clipped box stayed scrolled with no way for a user to scroll it back. Make the header fit instead: - fullscreen (phone) stacks the command rows and a full-width primary action, with the close button still pinned to the corner; - the standard header wraps when the actions no longer fit beside a 240px title block, which also fixes the same overflow at tablet widths; - command rows shrink and truncate before the buttons do, and the header row is capped at 100% width so it can never widen the dialog again. Verified in a real browser at 320, 393, 834, 1024 and 1440 CSS px across dashboard, table, settings, chat, gallery and documentation templates: no element renders outside the dialog and no clipped container is left scrolled.
ernestt
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
September 12, 2026 05:01
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
Contributor
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
4 tasks done
3 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User impact
Anyone opening a template preview from
/templateson a phone gets an unusabledialog: the preview surface and the whole header (title, install commands, Open
in Playground, close) are pushed sideways out of view, and nothing scrolls them
back — the only way out is Escape or a reload.
Repro: load the templates gallery at 393 x 660 CSS px (iPhone 14 Pro), tap any
card. The dialog opens already scrolled ~295px to the side.
Expected behavior and authority
The gallery passes
variant="fullscreen"on mobile precisely so the preview isedge-to-edge and self-contained; a fullscreen dialog's own chrome must stay
inside the viewport it fills. The file header for this component already states
the intent ("Dialog variant — pass 'fullscreen' on mobile for edge-to-edge
preview"), and Dialog's fullscreen variant sizes itself to the dynamic viewport.
Smallest restoration
The header laid the command rows and the primary action on a single line. Its
min-content width is ~976px at the canary target (two command rows), far wider
than a phone, so the header — not the template — pushed the dialog body past the
viewport. The body is clipped with
overflow: hidden, which is stillprogrammatically scrollable: initial focus landed on a control inside the
overflowing area, the browser scrolled it into view, and the clipped box stayed
scrolled with no user-reachable scrollbar to undo it.
The fix makes the header fit rather than overflow:
the close button stays pinned to the top-inline-end corner;
block — the same overflow reproduced at tablet width (834px), where the
actions previously ran ~250px past the dialog edge;
capped at 100% width so it can never widen the dialog again.
No new API, no new affordance, no change to what the header offers.
Evidence
Measured in Chromium via Playwright, reading live geometry inside the open
dialog (elements rendered outside the viewport, and clipped containers left with
scrollLeft > 0).Reproduction before the change — 393 x 660, Grouped Table:
Result after the change — same page, same template:
Also clean at 320 x 568 and 393 x 660 across Analytics Dashboard, Grouped Table,
Settings Panels, AI Chat Conversation, Product Gallery, Documentation Technical,
IDE and Kanban Board; and at 834, 1024 and 1440 CSS px.
Representative unchanged path: at 1440 x 900 the standard dialog is unchanged —
1400px wide, title left, command rows centre, Open in Playground and close
right, nothing offscreen, nothing scrolled. At 834px the actions now wrap onto a
second row instead of colliding with the title.
Regression-sensitive proof: the probe fails if any element inside the dialog
renders outside the viewport or any clipped container is left scrolled;
reverting the header changes reproduces the 976px min-content width and the
scrolled clipped body.
Scope
Testing
tsc --noEmit(apps/docsite) andeslinton the changed file — clean.focus on open (the state that triggered the scroll); command truncation; close
button reachable; Open in Playground reachable and full width on phones.
Follow-up (not in this PR)
Dialog's inner body usesoverflow: hidden, which stays programmaticallyscrollable — that is what turned "content too wide" into "content permanently
off-screen".
LayoutContentalready usesoverflow: clipfor itsnon-scrollable case. Switching Dialog's inner wrapper to
clipwould containthis class of bug for every dialog, but it touches core and belongs in its own
change.