fix(ui): stop Tabs from wrapping and overflowing its track on mobile - #62
Merged
Conversation
The Tabs track rendered as `inline-flex` with no width floor, so inside a horizontally scrollable parent it shrank to the viewport instead of overflowing it. On a 390px screen the B20 demo's tab labels wrapped to multiple lines and the active pill — measured from the button's box — spilled past the rounded track's right edge. - `w-max` on the track so it takes its natural width and the `overflow-x-auto` parent scrolls instead of compressing it - `shrink-0 whitespace-nowrap` on each tab to keep labels on one line - scroll the selected tab into view in `measure()`, since a scrollable row can otherwise leave the active tab off-screen with no indication. Done by hand rather than via `scrollIntoView`, which would also scroll the page vertically. Verified at 390x844 on /demos/b20. Checked /upgrades, /snapshots, and /demos/account at the same width — their tab sets never overflow, so the change is inert there. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
🟡 Heimdall Review Status
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
On mobile, the B20 demo's tab row renders broken: "Create a token" wraps to three lines and the active white pill spills past the rounded gray track's right edge.
Cause
The
Tabstrack rendered asinline-flexwith no width floor. The B20 demo wraps it inoverflow-x-auto, but an inline-flex box shrinks to fit available width rather than overflowing it — so at 390px the flex items got squeezed: labels wrapped, the track grew tall, and the pill (measured from the button's box) landed outside the track.Fix
w-maxon the track — it takes its natural content width and genuinely overflows, letting theoverflow-x-autoparent scroll instead of compressing it.shrink-0 whitespace-nowrapon each tab — labels stay on one line, buttons keep their intrinsic width.measure()— with the row now scrollable, the active tab could sit off-screen with nothing indicating it. AdjustsscrollLefton the nearest horizontally-scrollable ancestor; done manually rather than withscrollIntoView, which would also scroll the page vertically.Testing
Verified at 390x844 on
/demos/b20: single-line row, pill inside the track, and selecting "Create a token" scrolls it into view.Checked the other
Tabsconsumers at the same width for regressions —/upgrades,/snapshots, and/demos/accountall render normally; their tab sets are short enough that they never overflow, so the change is inert there./tipsalso usesTabsbut is internal-only and 404s in the external build, so I could not check it in a browser. Its two tabs ("Blocks", "Rejected Transactions") are wide enough that the same overflow was likely present and should now be fixed the same way — worth a look from someone on an internal build.npm run typecheckclean,npm test114/114 pass. Lint shows only pre-existing<img>warnings in unrelated files.After

Before
