Skip to content

Make the landing page work on a phone - #28

Merged
cggaurav merged 1 commit into
mainfrom
landing-mobile
Sep 8, 2026
Merged

cggaurav merged 1 commit into
mainfrom
landing-mobile

Conversation

@cggaurav

@cggaurav cggaurav commented Sep 8, 2026

Copy link
Copy Markdown
Member

The nav, the hero map and three sections below it were all broken at 390px. Reproduced in headless Chrome with touch emulation, then measured element geometry rather than eyeballing screenshots.

Nav

Brand, three links and the button were one unwrappable flex row needing ~490px, so at 390px it overflowed the viewport by 18px and "Open Editor" broke onto two lines. The CTA is now a sibling of the link row instead of a child, so under 600px the nav wraps: brand and button on top, links as a second row. The link row also gains flex-wrap, which is what was breaking the footer's six links too.

Hero map

computeFitZoom returned 1 whenever it could not measure the canvas, which left the 824-unit-wide map at natural size inside a 356px frame with its labels clipped. That is the reported symptom. It now fits on whichever axis is measurable instead of falling back to natural size, and the mobile frame has a fixed height rather than a percentage that can measure zero.

The fit also reads .diagram-viewport's real padding instead of hardcoding 48/32/56, so a chrome-less embed can hand the map back the room the editor spends on its toolbar and chip rail.

Legibility needed less content, not more scale: a three-level LR map fitted into 356px puts its labels at 6px however you slice it. Phones now get a four-pillar version of the same story (code panel and map both, so the "this text makes that map" claim still holds), which fits complete and legible at 72%. Desktop is unchanged.

Also broken on mobile, also fixed

  • Roadmap diagram rendered its labels at ~5px. Now 660px wide in a swipeable box, ~11px.
  • npx skills add productscalexyz/mindmaply was clipped mid-token.
  • The demo source panel cut a line in half at max-height:280px.
  • 24px section gutters ate a word per line at 360px.

The auto-fit moves to useLayoutEffect so a big map no longer flashes at natural size on the way to its fitted scale.

Verification

No horizontal overflow at 320, 360, 390, 430, 600, 601, 768, 900 or 1280px (.landing-page scrollWidth equals the viewport at each). Desktop layout confirmed unchanged. 280 tests pass, typecheck clean.

Two follow-ups logged locally rather than fixed here: fitting to the diagram's ink instead of its padded viewBox would gain about a third more scale everywhere and would let the phone show the full three-level demo, and it would remove the need for the roadmap's sideways swipe.

🤖 Generated with Claude Code

The nav, the hero map and three sections below it were all broken at
390px.

Nav: brand, three links and the button were one unwrappable flex row
needing ~490px, so it overflowed the viewport by 18px and "Open Editor"
broke onto two lines. The CTA becomes a sibling of the link row instead
of a child, so under 600px the nav wraps to brand + button on top and
the links as a second row. The link row itself gains flex-wrap, which is
what was breaking the footer's six links too.

Map: computeFitZoom returned 1 whenever it could not measure the canvas,
which left an 824-unit-wide map at natural size inside a 356px frame,
labels clipped. It now fits on whichever axis is measurable, and the
mobile frame is a fixed height rather than a percentage that can measure
zero. The fit also reads .diagram-viewport's real padding instead of
hardcoding 48/32/56, so an embed can hand the map back the room the
editor spends on its toolbar and chip rail.

Legibility needed less content, not more scale: a three-level LR map
fitted into 356px puts its labels at 6px whatever you do. Phones get a
four-pillar version of the same story (code panel and map both, so the
"this text makes that map" claim still holds) which fits complete and
legible at 72%. Desktop is unchanged.

Also on mobile: the roadmap rendered its labels at 5px (now 660px wide
in a swipeable box), the npx install command was clipped mid-token, the
source panel cut a line in half at max-height 280px, and 24px section
gutters ate a word per line at 360px.

The fit moves to useLayoutEffect so a big map no longer flashes at
natural size before settling.

Verified at 320, 360, 390, 430, 600, 601, 768, 900 and 1280px: no
horizontal overflow at any of them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cggaurav
cggaurav merged commit 310d40e into main Sep 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant