Skip to content

fix(frontend): mobile horizontal overflow on address/contract pages#124

Merged
moscowchill merged 2 commits into
devfrom
fix/mobile-overflow-address
Jun 11, 2026
Merged

fix(frontend): mobile horizontal overflow on address/contract pages#124
moscowchill merged 2 commits into
devfrom
fix/mobile-overflow-address

Conversation

@moscowchill

Copy link
Copy Markdown
Contributor

Problem

On phones, opening an address page renders the layout wider than the screen (measured 959px on a wallet address page and 665px on a token contract page, against a 390px iPhone viewport), so the browser shows the page overflowed and users must zoom out to fit it.

Root cause

The main content wrapper in app/layout.tsx (flex-1 lg:ml-64 ...) is a flex item without min-w-0. Flexbox's default min-width: auto means a flex item refuses to shrink below its content's intrinsic width, so any wide <table> or long unbroken hash stretched the entire page instead of scrolling inside its own overflow-x-auto wrapper. The homepage measures a clean 390px because it has no such wide intrinsic content; every detail page with tables/hashes was affected.

Fix

  • min-w-0 on the layout's main flex wrapper (one class; this alone takes the contract page from 665 to 390 and lets every overflow-x-auto table actually scroll internally).
  • break-all + min-w-0 on the token contract view's remaining unbroken monospace strings (header address, creator address, creation tx hash) so they wrap inside their cards instead of being clipped by the card's overflow-hidden.

Verification

Headless Chromium (Playwright) at 390x844 iPhone profile against a production build:

Page scrollWidth before after
/address/ 959px 390px
/address/ 665px 390px
/tx/ - 390px

Screenshots confirm addresses wrap cleanly, tab bar and tables keep internal horizontal scroll, nothing clipped.

Gates: lint 0 errors, 114/114 tests, build green.

Risk

min-w-0 on the wrapper changes shrink behavior for all pages; desktop is unaffected (the wrapper was never narrower than its content there), and a mobile sweep of home/address/contract/tx pages shows correct rendering.

On phones, address pages forced the layout viewport to 665-959px
against a 390px screen, so the browser rendered everything overflowed
and users had to zoom out to fit the page.

Root cause: the main content wrapper in layout.tsx is a flex item
without min-w-0. Flexbox min-width:auto means it refuses to shrink
below its content's intrinsic width, so any wide table or long
unbroken hash stretched the whole page instead of scrolling inside its
own overflow-x-auto container. min-w-0 restores the intended behavior.

Also wrap the remaining unbroken monospace strings on the token
contract view (header address, creator, creation tx hash) with
break-all + min-w-0 so they wrap inside their cards instead of being
clipped by the card's overflow-hidden.

Verified with headless Chromium at 390x844 (iPhone profile):
wallet address page 959 -> 390, token contract page 665 -> 390,
tx page 390. Screenshots confirm clean rendering, addresses wrap,
tables keep their internal horizontal scroll.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces layout and styling fixes to prevent horizontal overflow and improve responsiveness on mobile viewports. Specifically, it adds min-w-0 to several flex containers (including the main layout container) and applies break-all to long unbroken strings like addresses and transaction hashes. Feedback suggests conditionally applying break-all to the address link in AddressDisplay only when the address is not truncated, preventing awkward wrapping of already shortened addresses.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

const display = truncate ? `${address.slice(0, 10)}...${address.slice(-8)}` : address;
return (
<Link href={`/address/${address}`} className="text-accent hover:text-accent-hover font-mono text-xs md:text-sm">
<Link href={`/address/${address}`} className="text-accent hover:text-accent-hover font-mono text-xs md:text-sm break-all">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Applying break-all unconditionally to the address link can cause truncated addresses (which are already short, e.g., 0x1234567890...12345678) to wrap awkwardly at arbitrary characters on narrow screens. It is better to apply break-all conditionally only when truncate is false (i.e., when displaying the full address).

Suggested change
<Link href={`/address/${address}`} className="text-accent hover:text-accent-hover font-mono text-xs md:text-sm break-all">
<Link href={"/address/" + address} className={"text-accent hover:text-accent-hover font-mono text-xs md:text-sm " + (truncate ? "" : "break-all")}>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: break-all now applies only when truncate is false (full-address rendering).

@moscowchill moscowchill merged commit cc50895 into dev Jun 11, 2026
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