fix: keep header nav on one line on mobile - #117
Merged
Conversation
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
Contributor
wavekat-eason
marked this pull request as ready for review
July 5, 2026 03:21
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 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).语/音stacked语音on one lineFix
whitespace-nowrapto the header nav pills and the language-switcher trigger, so labels never break mid-word.flex-wrap+gap-y-3to 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 targetsmaindirectly rather than the provider-page branch where it was noticed.Verification
Rendered via Playwright at 390px and 360px (zh + en) and 1024px desktop:
npm run build✓ ·npm run check:links✓🤖 Generated with Claude Code
https://claude.ai/code/session_01CPiqbog4hc3vgGapv7Qq1t