fix(web): stop horizontal overflow on mobile landing sections - #9
Merged
Merged
Conversation
Three landing grids used `grid lg:grid-cols-[...]` with no base `grid-cols-1`, so the implicit column sized to max-content and wide children (a long tab label, a long code line, the event-log panel) inflated the page to ~622px on mobile, forcing horizontal scroll. - HookTabs: add base grid-cols-1; make the tab nav scroll (min-w-0 max-w-full overflow-x-auto) and keep buttons from compressing (shrink-0 whitespace-nowrap). The nav is a flex item of Basecoat's .tabs, so min-w-0 is required for overflow-x-auto to engage. - AnnotatedFigure: add base grid-cols-1 so the <pre> scrolls instead of inflating its card to 529px. - CacheDeck: add base grid-cols-1 so the event-log panel fits. - architecture-section: `truncate` -> `sm:truncate` so the layer API list wraps on mobile instead of ellipsizing the content away. Desktop (lg) layouts are unchanged. Verified at 390/360/320px: document scrollWidth now equals the viewport (no horizontal scroll), and `bun run build` passes.
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
Several components on the homepage caused horizontal overflow on mobile — the whole page was ~622px wide, forcing horizontal scroll at 390/360/320px.
Root cause
Three landing grids use
grid lg:grid-cols-[…]without a basegrid-cols-1, so the implicit column sized tomax-contentand wide children (a long tab label, a long code line, the event-log panel) inflated the entire grid past the viewport.Changes
landing/v1/HookTabs.astro— add basegrid-cols-1; make the tab<nav>scroll horizontally (min-w-0 max-w-full overflow-x-auto) and stop the buttons compressing (shrink-0 whitespace-nowrap). The nav is a flex item of Basecoat's.tabs, somin-w-0is required foroverflow-x-autoto actually engage. (card was 602px → now 358px)landing/v3/AnnotatedFigure.astro— add basegrid-cols-1so the<pre>scrolls instead of inflating its card. (529px → 390px)landing/v2/CacheDeck.astro— add basegrid-cols-1so the event-log panel fits. (overflowed ~72px @320)landing/architecture-section.astro—truncate→sm:truncateso the layer API list wraps on mobile instead of being ellipsized away (still truncates ≥640px).Verification
Rendered the homepage in a headless browser at 390 / 360 / 320px:
document.scrollWidthnow equals the viewport at every width (was 622) —hasHScroll: false.bun run buildpasses.Desktop (
lg) layouts are unchanged — every fix only affects the mobile base layer or is inert when content already fits.