From 140db0ef60f0c91a558775bc05ab832b92ecb75d Mon Sep 17 00:00:00 2001 From: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:12:24 +0200 Subject: [PATCH] fix(upcycling): kill horizontal-scroll on mobile across mini-site (min-w-0 grid chains) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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
  • -
     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 
  • (grid wrapper) + its inner
    (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) --- .../upcycling/AiBrainstormSection.tsx | 22 ++++++++++++++----- .../applications/ApplicationsExperience.tsx | 10 ++++++--- .../upcycling/lenovo-l2251pwd/GuideBody.tsx | 9 ++++++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/app/[locale]/projects/upcycling/AiBrainstormSection.tsx b/src/app/[locale]/projects/upcycling/AiBrainstormSection.tsx index ee91f06cd..35ebc9f61 100644 --- a/src/app/[locale]/projects/upcycling/AiBrainstormSection.tsx +++ b/src/app/[locale]/projects/upcycling/AiBrainstormSection.tsx @@ -40,9 +40,13 @@ export function AiBrainstormSection({ section }: { section: Messages }) { return (
    + {/* min-w-0 on grid children is REQUIRED so the right column's
    +            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. */}
             
    {/* Left rail — why this exists */} -
    +
    {/* Right column — prompt cards */} -
      +
        {section.prompts.map((p, i) => ( -
      1. +
      2. +
        {/* Header: numbered title + copy action */}
        @@ -134,8 +138,14 @@ function PromptCard({
        - {/* Body: prompt text in mono surface — visually clear it's code-like, copy-paste-able */} -
        +      {/* 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. */}
        +      
                 {prompt}
               
        diff --git a/src/app/[locale]/projects/upcycling/applications/ApplicationsExperience.tsx b/src/app/[locale]/projects/upcycling/applications/ApplicationsExperience.tsx index 24f2ecb95..c49d1612f 100644 --- a/src/app/[locale]/projects/upcycling/applications/ApplicationsExperience.tsx +++ b/src/app/[locale]/projects/upcycling/applications/ApplicationsExperience.tsx @@ -136,7 +136,7 @@ function CinematicHero({
        -
        +
        {eyebrow}

        {title}

        {intro}

        @@ -284,6 +284,10 @@ function Scene({ act, idx, tier }: { act: Act; idx: number; tier: RawApplication )} >
        + {/* 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. */}
        {/* Text column */} -
        +