fix(upcycling): kill horizontal-scroll on mobile across mini-site (min-w-0 grid chains)

Audited each mini-site page at 375px viewport via Playwright. Three pages
were forcing the whole document wider than the viewport:

  /projects/upcycling                — docW 450 (vw 375), +75 px
  /projects/upcycling/applications   — docW 956 (vw 375), +581 px
  /projects/upcycling/lenovo-l2251pwd — docW 1012 (vw 375), +637 px

Root cause was the same in every case: grid children with `w-[N vw]` or
`overflow-x-auto` flex carousels inside them. Grid items refuse to
shrink below their min-content width by default, so a carousel with
`w-[85vw]` figures forces the grid wider than the viewport.

Fixes:

- AiBrainstormSection.tsx
    - `min-w-0` on the two grid columns + each <li>
    - <pre> with prompt text: `break-words` + inline `overflow-wrap: anywhere`
      so German compounds + URLs wrap instead of forcing parent wider

- ApplicationsExperience.tsx
    - `min-w-0` on hero grid's text column
    - `min-w-0` on each act's text + lamp grid columns (the SceneLampRow
      with `w-[80vw]` figures was the +581 px)

- lenovo-l2251pwd/GuideBody.tsx
    - `min-w-0` on the step <li> (grid wrapper) + its inner <div>
      (text/photos column) — the StepPhotoGroup's `w-[85vw]` photo
      buttons in `overflow-x-auto` were the +637 px

After this commit each page reads docW === vw at 375. Carousels still
scroll horizontally inside their own bounds, which is the intended
behaviour for the mobile snap-x patterns.

Verified clean: /status, /build-your-own, /gallery — already at parity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mao NakamotoandClaude Opus 4.7 committed 2026-06-09 22:12:24 +02:00
1 parent 8e40a62136
commit 140db0ef60
3 files changed
+30 -11

No files matched your search

@@ -40,9 +40,13 @@ export function AiBrainstormSection({ section }: { section: Messages }) {
return (
<section className="border-t border-subtle bg-surface-raised py-16 sm:py-20">
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
{/* min-w-0 on grid children is REQUIRED so the right column's <pre>
can shrink — without it the prompt's longest unbroken word
forces the column wider than the viewport and the whole page
scrolls horizontally on mobile. */}
<div className="grid gap-10 lg:grid-cols-[1fr_2fr] lg:items-start lg:gap-16">
{/* Left rail — why this exists */}
<div className="lg:sticky lg:top-24">
<div className="min-w-0 lg:sticky lg:top-24">
<div className="inline-flex items-center gap-2 rounded-full border border-subtle bg-surface-base px-3 py-1 text-xs uppercase tracking-[0.18em] text-text-tertiary font-mono">
<Sparkles className="h-3.5 w-3.5" aria-hidden="true" />
<span>{section.title}</span>
@@ -59,9 +63,9 @@ export function AiBrainstormSection({ section }: { section: Messages }) {
</div>
{/* Right column — prompt cards */}
<ol className="space-y-4">
<ol className="min-w-0 space-y-4">
{section.prompts.map((p, i) => (
<li key={i}>
<li key={i} className="min-w-0">
<PromptCard
index={i + 1}
title={p.title}
@@ -106,7 +110,7 @@ function PromptCard({
}
return (
<article className="overflow-hidden rounded-lg border border-subtle bg-surface-base">
<article className="min-w-0 overflow-hidden rounded-lg border border-subtle bg-surface-base">
{/* Header: numbered title + copy action */}
<header className="flex items-center justify-between gap-3 border-b border-subtle bg-surface-raised/60 px-4 py-3 sm:px-5">
<div className="flex items-baseline gap-3 min-w-0">
@@ -134,8 +138,14 @@ function PromptCard({
</button>
</header>
{/* Body: prompt text in mono surface — visually clear it's code-like, copy-paste-able */}
<pre className="overflow-x-auto whitespace-pre-wrap px-4 py-4 sm:px-5 sm:py-5 font-mono text-[13px] leading-relaxed text-text-primary">
{/* Body: prompt text in mono surface — visually clear it's code-like,
copy-paste-able. `break-words` + the inline overflow-wrap make long
German compounds / URLs / paths wrap instead of forcing the parent
wider than the viewport on mobile. */}
<pre
className="whitespace-pre-wrap break-words px-4 py-4 sm:px-5 sm:py-5 font-mono text-[13px] leading-relaxed text-text-primary"
style={{ overflowWrap: 'anywhere' }}
>
{prompt}
</pre>
</article>
@@ -136,7 +136,7 @@ function CinematicHero({
<div className="mx-auto max-w-7xl px-4 pb-16 pt-10 sm:px-6 sm:pb-24 sm:pt-16 lg:flex lg:min-h-[calc(100svh-3.5rem)] lg:flex-col lg:px-8 lg:pb-28 lg:pt-20">
<div className="flex flex-col gap-10 sm:gap-12 lg:grid lg:flex-1 lg:grid-cols-[1.05fr_1fr] lg:items-center lg:gap-16">
<div>
<div className="min-w-0">
<div className="ui-public-eyebrow">{eyebrow}</div>
<h1 className="ui-public-hero-title mt-4 text-left sm:mt-6">{title}</h1>
<p className="ui-public-hero-lede mx-0 mt-6 max-w-2xl text-left sm:mt-8">{intro}</p>
@@ -284,6 +284,10 @@ function Scene({ act, idx, tier }: { act: Act; idx: number; tier: RawApplication
)}
>
<div className="mx-auto max-w-7xl px-4 py-20 sm:px-6 sm:py-28 lg:px-8 lg:py-32">
{/* min-w-0 on grid children is REQUIRED so the lamp-row column
(which contains a flex carousel with `w-[80vw]` figures) can
shrink. Without it, the carousel pushes the grid wider than
the viewport on mobile. */}
<div
className={cn(
'grid gap-10 lg:grid-cols-2 lg:items-center lg:gap-16',
@@ -291,7 +295,7 @@ function Scene({ act, idx, tier }: { act: Act; idx: number; tier: RawApplication
)}
>
{/* Text column */}
<div className={cn(act.reverse && 'lg:col-start-2')}>
<div className={cn('min-w-0', act.reverse && 'lg:col-start-2')}>
<div className="flex items-baseline gap-4">
<span
aria-hidden="true"
@@ -318,7 +322,7 @@ function Scene({ act, idx, tier }: { act: Act; idx: number; tier: RawApplication
</div>
{/* Lamp visual column */}
<div className={cn('relative', act.reverse && 'lg:col-start-1 lg:row-start-1')}>
<div className={cn('relative min-w-0', act.reverse && 'lg:col-start-1 lg:row-start-1')}>
<SceneLampRow variant={act.variant} seeds={act.seeds} caption={tier.imageCaption} />
</div>
</div>
@@ -244,7 +244,12 @@ export function GuideBody({ data }: { data: GuideData }) {
id={`step-${step.n}`}
data-step={step.n}
ref={(el) => registerStep(step.n, el)}
className="grid sm:grid-cols-[auto_1fr] gap-3 sm:gap-6 scroll-mt-20"
// min-w-0 + the inner min-w-0 below are REQUIRED so the
// step's right column (which contains the photo carousel
// with `w-[85vw]` items) can shrink. Without it, the
// carousel's flex children force the grid wider than the
// viewport on mobile.
className="grid min-w-0 sm:grid-cols-[auto_1fr] gap-3 sm:gap-6 scroll-mt-20"
>
<span
className="font-mono text-3xl sm:text-4xl font-light tabular-nums text-text-tertiary leading-none pt-0.5"
@@ -252,7 +257,7 @@ export function GuideBody({ data }: { data: GuideData }) {
>
{String(step.n).padStart(2, '0')}
</span>
<div>
<div className="min-w-0">
<h3 className="text-lg sm:text-xl font-semibold text-text-primary">
{step.title}
</h3>