Repository navigation
Fix horizontal overflow on the behavioral responses page at 375px - #55
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
MaxGhenis
force-pushed
the
fix-behavioral-mobile-overflow
branch
from
October 14, 2026 13:43
c7c2a76 to
82c633a
Compare
MaxGhenis
force-pushed
the
fix-behavioral-mobile-overflow
branch
from
October 14, 2026 13:49
82c633a to
310a42e
Compare
At a 375px viewport /us/model/behavioral had scrollWidth 450. The elasticity table's 400px min-width was the cause. Its overflow-x:auto wrapper still passed that width up as its min-content size. The mobile <main> has mx-auto in a column flexbox and no width, so it sized to fit and widened the page. The table's own min-content width is about 250px, so the min-width is dropped and all four columns now fit at 320px and wider. contain: inline-size on the wrapper guards against anything wider widening <main> again. The concepts cards and budget-constraint chart now stack below md (tw:grid-cols-1 tw:md:grid-cols-2). Once the page fits 375px, a two-column grid would squeeze the chart to 98px. scrollWidth now equals the viewport at 320, 375 and 390px. The geometry of every element in <main> is unchanged at 768, 1024 and 1440px, checked on both dev servers and production builds. A class-level regression test guards both changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
force-pushed
the
fix-behavioral-mobile-overflow
branch
from
October 14, 2026 14:43
310a42e to
9a002a6
Compare
MaxGhenis
marked this pull request as ready for review
October 14, 2026 14:45
This branch was successfully deployed
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.
At a 375px viewport,
/us/model/behavioralhaddocument.documentElement.scrollWidth450, so the page scrolled sideways on phones.Cause and fix (
src/components/theory/BehavioralResponses.tsx)min-w-[400px]inside anoverflow-x-autowrapper, and a scroll container's min-content width still comes from its contents. On mobile,AppShell's<main>hasmx-autoinside a column flexbox and no width, so it sizes to fit its content. It widened to 400 + 2px border + 48px padding = 450px. Even with the overflow contained, a 400px table would hide its "Upper" column at 375 and cut off "Central" at 320. The table's own min-content width is about 250px.min-w-[400px], so all four columns fit at 320 and wider.tw:[contain:inline-size]on the wrapper (the same pattern as Show current TAXSIM comparison results on the validation page #47 and Fix the UK model pages: pipeline, calibration, validation, behavioural responses, and rules #51), so nothing wider can widen<main>again.tw:grid-cols-1 tw:md:grid-cols-2, so they stack below 768px.Verification
I measured in the built-in browser using same-origin iframes of fixed width, with
scrollbar-width: noneto match a phone's overlay scrollbars, after a 2.5s settle. For desktop I hashed the geometry (tag plus rounded x/y/width/height) of every element in<main>. Each comparison runs master and this PR on the same kind of server (dev against dev, production against production)./uk/model/behavioralon master renders the same component: 450 → 375 at 375px, identical at 1024 and 1440. The UK behavioural page from Fix the UK model pages: pipeline, calibration, validation, behavioural responses, and rules #51 (UkBehaviouralResponses.tsx) is not touched.?embed=true(the app-v2 iframe): the behavioral section now stacks and its table fits. The US embed page as a whole still measures 674px at 375 on both master and this PR, because ofDataPipeline's stage row; Fix the UK model pages: pipeline, calibration, validation, behavioural responses, and rules #51 fixes that.@media (min-width:48rem){.tw\:md\:grid-cols-2{…}},.tw\:grid-cols-1and.tw\:\[contain\:inline-size\].bun run test: 139/139 pass. On a merge with current master (Use ui-kit logos instead of hotlinked logo URLs #53), 155/155 pass.bun run lint,tsc --noEmitandbun run buildexit 0.git merge-treeis clean against the open PRs Fix the UK model pages: pipeline, calibration, validation, behavioural responses, and rules #51 and Correct the US overview's program count and behavioral-response claims #54.src/test/behavioralMobileLayout.test.tsxguards the stacked grid, the table having no fixed min-width, and the contained wrapper. It is class-level, since jsdom can't measure layout. It fails against both master's component and an earlier draft that kept the 400px min-width.Review
Two separate Opus 5.5 reviews looked at this.
First review, four rounds. Round 1 requested changes:
Both were reproduced and fixed, and rounds 2–4 approved. The later rounds tightened the regression test and collapsed the branch into one commit with an accurate message.
Second review (read-only, no shell). It approved. It also corrected my chart-width wording: on master the chart was 135px on a page that was 450px wide, and 98px is what a two-column grid would give once the page fits. That wording is fixed here and in the commit.
Not in this PR (queued separately)
?compare=allview overflows at 375px (behavioral 1058, overview 1200, coverage 1200, calibration 893, pipeline 588, validation 706)./data/pipelineand/data/calibrationoverflow by default. The root cause is the mobile<main>inAppShell, which lacks thew-fullthe desktop<main>has.axiom: n/a: layout-only UI change
🤖 Generated with Claude Code