Skip to content

fix(site): stop /install code blocks widening the page on phones - #103

Merged
siracusa5 merged 1 commit into
mainfrom
c/install-mobile-overflow
Aug 7, 2026
Merged

fix(site): stop /install code blocks widening the page on phones#103
siracusa5 merged 1 commit into
mainfrom
c/install-mobile-overflow

Conversation

@siracusa5

Copy link
Copy Markdown
Collaborator

Summary

The /install page overflows ~1100px horizontally at a 375px viewport — confirmed identical on production, so it predates the typography PR (#102). The shared CodeBlock component already scrolls internally; the bug is the classic grid min-content trap: grid items default to min-width: auto, so unbreakable shiki lines widened the track instead of scrolling inside their box.

Changes

  • Add min-width: 0 to the activation-steps grid items (.step-copy, .step-proof, .result-preview) and to the .source-route/.resolver-proof grid items. The second source route was the subtle one: .cli-alternative is a plain <details> grid item that passes its nested code block's min-content through, flooring the stacked 1fr track at 482px even though the code block itself is a scroll container.
  • 14 inserted lines, all CSS; no markup, copy, or component changes.

Test Plan

  • document.documentElement.scrollWidth === clientWidth on /install at 375px and 320px, with every <details> expanded
  • All six code blocks scroll internally (scrollWidth up to 1442px inside 341px boxes)
  • /packs (the other CodeBlock consumer) verified at 375px, no overflow
  • Desktop layout unchanged
  • cd apps/site && npm run build exits 0 (incl. install-page postbuild verifier)
  • CI checks pass

Notes

🤖 Generated with Claude Code

At a 375px viewport the install page overflowed ~1100px horizontally
(identical on production, pre-existing). CodeBlock already scrolls
internally, but the grids holding it floored their tracks at min-content:
grid items default to min-width auto, so an unbreakable shiki line widened
.step-copy/.result-preview (activation steps) and .cli-alternative — a
plain <details> grid item that passes its nested code block's min-content
through — widened the second .source-route to 482px.

Zero the min-width on the activation-step and source-route/resolver-proof
grid items so wide commands scroll inside their own boxes, per the site's
wide-content rule. Verified scrollWidth === clientWidth at 375px and 320px
with every <details> expanded; all six code blocks scroll internally;
packs page (the other CodeBlock consumer) unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
@siracusa5 siracusa5 added the bug Something isn't working label Aug 7, 2026
@siracusa5
siracusa5 merged commit cce20fd into main Aug 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant