Skip to content

fix(website): wrap preview tab strip on mobile, align selected tab with body - #8

Merged
raelldottin merged 1 commit into
mainfrom
fix/product-preview-mobile-tabs
Sep 7, 2026
Merged

raelldottin merged 1 commit into
mainfrom
fix/product-preview-mobile-tabs

Conversation

@raelldottin

Copy link
Copy Markdown
Contributor

Summary

The Product Preview tab strip (PreviewTabs in src/app/page.tsx) used flex gap-1 overflow-x-auto with whitespace-nowrap labels, which produced a horizontal scrollbar on narrow screens and clipped the later tabs.

It also had a consistency bug: the first tab (Overview) was visually highlighted via first:bg-brand/10 first:text-brand, while the rendered body was tabs[1].body (Formation).

Change

  • Replace the tab row's overflow-x-auto with flex-wrap so all labels stay visible without side-scrolling on mobile (desktop appearance is unchanged when there's enough width).
  • Introduce activeTabIndex = 1 and drive both the highlight and the rendered body from it, so the selected tab matches the preview.
  • Keep this a static marketing preview — no interactive tab switching introduced.

Validation

All ladder steps pass locally:

  • bun install --frozen-lockfile ✓
  • bunx tsc --noEmit ✓
  • bunx oxlint ✓ (only pre-existing warnings in vitest.config.mts / sonner.tsx)
  • bun run test ✓ (12/12)
  • bun run build ✓ (static export → out/index.html)
  • git diff --check ✓

Closes #7

…th body

The PreviewTabs row used overflow-x-auto with nowrap labels, producing a
horizontal scrollbar on narrow screens and clipping later tabs. The first
tab was also visually highlighted while tabs[1].body was rendered.

Replace overflow-x-auto with flex-wrap so all labels stay visible without
scrolling, and drive both the highlight and the rendered body from a single
activeTabIndex so the selected tab matches the preview.

Closes #7
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
alepes-website decf083 Sep 07 2026, 11:11 AM

@raelldottin raelldottin left a comment

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.

Self-review (solo-maintainer exception)

Scope: single-file fix to src/app/page.tsx (PreviewTabs), +10/−4.

Correctness findings:

  • Root causes confirmed: row used overflow-x-auto + nowrap labels → horizontal scrollbar / clipped tabs on mobile; first:bg-brand/10 first:text-brand highlighted Overview while tabs[1].body rendered Formation.
  • Fix removes overflow-x-auto in favor of flex-wrap (labels wrap, no side-scroll, desktop unchanged where width allows), and drives both the highlight and the rendered body from a single activeTabIndex = 1 — selected tab now matches the preview.
  • Deliberately keeps the preview static (no fake interactive tab switching), consistent with the repo's read-only marketing scope.

Verification: full validation ladder passed locally — bun install --frozen-lockfile, tsc --noEmit, oxlint (only pre-existing warnings), bun run test (12/12), bun run build (emits out/index.html), git diff --check. CI green on exact head.

Material findings: none.

Reviewed-by self per the recorded exception; merging with a normal merge commit (not squash).

@raelldottin
raelldottin merged commit e61d2ae into main Sep 7, 2026
2 checks passed
@raelldottin
raelldottin deleted the fix/product-preview-mobile-tabs branch September 7, 2026 11:37
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.

Product Preview tab strip: horizontal scrollbar cuts off later tabs on mobile

1 participant