fix(www): break long URLs in tutorial prose, and widen the sideways-scroll guard - #858
Merged
Conversation
…croll guard Three provider pages dragged the whole document sideways on a narrow phone, and the guard that exists to catch exactly this reported green on every run. THE DEFECT. Tutorial prose is authored per provider in `lib/tutorials.ts` and routinely carries a bare URL — "POST to https://api.calendly.com/webhook_subscriptions with url, events…". Under the default `overflow-wrap: normal` a URL is one unbreakable token: it does not wrap, it runs past the paragraph, and the document widens with it. `/test/calendly` held 381px of content in a 360px viewport, `/test/github` 372px, and `/test/notion` 345px at 320px. The terminal blocks on these pages are correctly `overflow-x-auto` and scroll inside their own box; the paragraphs had nothing. WHY NOTHING CAUGHT IT. `no page scrolls sideways on a phone` ran at exactly one viewport — the mobile project's Pixel 5 default of 393px — and all three pages happen to fit there. A viewport-sensitive assertion pinned to a single viewport is not a guard against layout, it is a guard against one phone. It now runs at 320 / 360 / 393px, which is 111 checks instead of 37, and is red on all three pages before this fix (5 failures: three at 320px, two at 360px) while still green at 393px — the blindness, demonstrated rather than asserted. THE FIX. `break-words` on the shared `body` prose class. Not `break-all`: `overflow-wrap: break-word` breaks a long token only when it cannot fit a line of its own, so ordinary sentences still wrap at their spaces. The event-name chips in the same file already carry it, for the same reason. The "Worth knowing first" paragraph spelled the same class string out by hand instead of using `body`, so it would have been left behind. It now uses the constant — that duplication is precisely how one of two identical paragraphs ends up without the fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012gEktpYFKUo4FweY9BeuzU
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.
Follow-up to #857, found by extending that PR's mobile sweep across every marketing route at 320 / 360 / 375 / 393px.
The defect
Three provider pages dragged the whole document sideways on a narrow phone:
/test/calendly/test/github/test/notionTutorial prose is authored per provider in
lib/tutorials.tsand routinely carries a bare URL — "POST tohttps://api.calendly.com/webhook_subscriptionswith url, events…". Under the defaultoverflow-wrap: normala URL is one unbreakable token: it doesn't wrap, it runs past the paragraph, and the document widens with it. The terminal blocks on these pages are correctlyoverflow-x-autoand scroll inside their own box; the paragraphs had nothing.Why nothing caught it
no page scrolls sideways on a phonealready existed — and reported green on every run. It ran at exactly one viewport, the mobile project's Pixel 5 default of 393px, which all three pages happen to fit.A viewport-sensitive assertion pinned to a single viewport is not a guard against layout; it is a guard against one phone. This is the same shape as the bug in #857, where the check was blind because the hero section is
overflow-hidden.The guard now runs at 320 / 360 / 393px — 111 checks instead of 37. Before this fix it is red on all three pages (5 failures: three at 320px, two at 360px) and still green at 393px — the blindness demonstrated, not asserted.
The fix
break-wordson the sharedbodyprose class.break-all.overflow-wrap: break-wordbreaks a long token only when it cannot fit a line of its own, so ordinary sentences still wrap at their spaces.break-words, with a comment giving the same reasoning. This is that idiom, applied to the prose.body, so it would have been left behind. It now uses the constant — hand-copying a shared class string is exactly how one of two identical paragraphs ends up without the fix.Test plan
mobile— 191 passed (was 117; +74 from the widened guard)chromium— 138 passedapps/wwwvitest — 562 passedpnpm lint(eslint + all repo guards, incl.content-dup-guardover the 16 sibling tutorial pages) ✓ ·typecheck✓ ·format:check✓test:seo✓ ·test:anchors✓ ·test:orphans✓ ·test:links✓ ·check:export✓Human verification
Lower risk than #857 — this is a wrapping rule on body copy, no layout or control moved. Worth a glance at
/test/calendlyon a phone to confirm the long URL now wraps mid-token rather than running off, and that surrounding sentences still break at spaces.🤖 Generated with Claude Code
https://claude.ai/code/session_012gEktpYFKUo4FweY9BeuzU