Skip to content

fix: keep header nav on one line on mobile - #117

Merged
wavekat-eason merged 1 commit into
mainfrom
fix/provider-2talk-mobile-layout
Jul 5, 2026
Merged

fix: keep header nav on one line on mobile#117
wavekat-eason merged 1 commit into
mainfrom
fix/provider-2talk-mobile-layout

Conversation

@wavekat-eason

Copy link
Copy Markdown
Contributor

Problem

On a narrow (mobile) viewport, the header nav pills got squeezed by the flex row until the CJK labels broke between characters语音语/音, 简体中文简体/中文 — because CJK text has no word boundaries. Every two-character pill wrapped to two lines, so the header looked broken on all localized pages (spotted on /zh/voice/providers/2talk/, but it affects every non-Latin locale's header).

Before After
pills ~44px tall, 语/音 stacked pills 26px, 语音 on one line

Fix

  • Add whitespace-nowrap to the header nav pills and the language-switcher trigger, so labels never break mid-word.
  • Add flex-wrap + gap-y-3 to the header so the (now incompressible) nav group drops to its own line under the wordmark on narrow screens, instead of overflowing. Mirrors how the Voice sub-nav already wraps.

Shared-chrome fix (Header.astro, LanguageSwitcher.astro) — benefits every localized page, so it targets main directly rather than the provider-page branch where it was noticed.

Verification

Rendered via Playwright at 390px and 360px (zh + en) and 1024px desktop:

  • No horizontal overflow at any width.
  • All nav pills single-line (26px) in every locale.
  • Desktop header unchanged (single 36px row).
  • npm run build ✓ · npm run check:links

🤖 Generated with Claude Code

https://claude.ai/code/session_01CPiqbog4hc3vgGapv7Qq1t

On a narrow viewport the header flex row squeezed the nav pills until the
CJK labels (语音, 文档, 简体中文) broke between characters — CJK text has no
word boundaries — so each two-character pill wrapped to two lines. Add
whitespace-nowrap to the nav pills and the language-switcher trigger, and
let the header wrap the nav group to its own line (flex-wrap) so the pills
stay intact instead of overflowing. Latin locales were unaffected;
desktop is unchanged (single row when everything fits).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CPiqbog4hc3vgGapv7Qq1t
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@wavekat-eason
wavekat-eason marked this pull request as ready for review July 5, 2026 03:21
@wavekat-eason
wavekat-eason merged commit 0b3a8af into main Jul 5, 2026
2 checks passed
@wavekat-eason
wavekat-eason deleted the fix/provider-2talk-mobile-layout branch July 5, 2026 03:21
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