Skip to content

fix(website): keep phone navigation labels from splitting mid-word - #7497

Merged
morluto merged 1 commit into
morluto:mainfrom
pirrozani:fix/website-mobile-nav-word-breaks
Oct 27, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
pirrozani:fix/website-mobile-nav-word-breaks

Conversation

@pirrozani

@pirrozani pirrozani commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #3597.

On phones, single-word navigation labels split between letters, such as "Showcase|s", "Anleitunge|n", "Руководст|ва" and "Посібник|и". This change keeps every label whole and wraps multi-word labels only at spaces.

The desktop cases in #3597 no longer reproduce on current main: a174892 reduced the header to four links and #3851 gave the navigation more room. This PR does not change desktop rules; the measurements below confirm that every edition stays on one line from 641px to 2560px.

Problem and expected behavior

Below 640px, .navigation used four minmax(0, 1fr) columns, and its links used overflow-wrap: anywhere. That combination reduced each link's minimum width to a single character, so a label longer than a quarter of the row broke mid-word. Before this change, with system fonts in Chromium, splits occurred in en, ml, ur-Latn and ro at 320px; de at 320–375px; ru at 320–390px; and uk at 320px. With a wider font, el, tr, fr, pl and es also split.

Expected: four links on one row that read cleanly in every edition.

Change and scope

At phone widths, the links are flex items with flex: 1 1 0. They share the row evenly, but the automatic minimum keeps each link at least as wide as its longest word. max-width: 100% with overflow-wrap: break-word still lets a word wider than the whole row break, so enlarged text continues to fit, as fixed by #3598. The base .navigation rule already supplies display: flex and flex-wrap: wrap. CSS only; one file.

Contribution scope: not applicable (website layout fix).

Contract and boundary impact

  • Semantic owner and earliest changed stage: website/public/assets/styles.css, phone @media (max-width: 640px) navigation rules.

  • Contribution scope fit and linked maintainer decision: not applicable.

  • CLI and MCP/tool-catalog contract: none.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

Executed with Playwright 1.64.1 and Chromium on Windows 11 against a local prepare-website.py build of all 23 editions. A script measured the header's links and boxes directly instead of comparing screenshots.

  • Tests added or updated: none. The repository has no browser layout tests; the measurement script stayed local.
  • Base reproduction: on main (570abe9), mid-word splits occurred in the languages and widths listed above.
  • After the change:
    • 23 editions × 30 widths (320–2560px) × 2 pages (home, contributors) × light and dark themes = 2,760 measurements. Each showed one navigation row, no mid-word breaks, no horizontal scroll, and no overlap between the navigation, brand and social controls.
    • Headers forced to Arial and to Verdana, as wider stand-ins for other platforms' system fonts: 690 measurements each on the home page, also with no defects. The smallest spare desktop width in the navigation column was 213px with system fonts and 115px with Verdana (pt-BR at 1280px).
    • Root text at 20, 24 and 32px: no header link leaves the viewport and no header boxes overlap. At larger sizes the navigation may use a second row. At 32px, the homepage scrolls horizontally in zh-CN, zh-TW, ja and some other editions. The overflowing elements are code samples in main, and the overflow is identical without this change.
    • Screenshots: before and after for 13 editions at 320, 360, 390 and 430px, plus desktop headers. Two are attached below.
  • Remaining proof gaps: Firefox and Safari, real macOS and Linux system fonts, and the /rea/ base path were not exercised.

Phone header at 320px, main compared with this PR (Chromium, Windows, light theme):

Phone header at 320px in English, German, Russian and Ukrainian: main splits Showcases, Fallstudien, Anleitungen, Руководства, Приклади and Посібники mid-word; this PR keeps each word whole

Header at 1280px (tightest desktop width) and 900px in all 23 editions. This PR does not change desktop CSS; these cases already pass on main after a174892 and #3851. Each header is labeled with its measured navigation row count.

Desktop headers in all 23 editions

Header at 1280px and 900px in all 23 editions, each with one navigation row

Validation performed

  • python scripts/website.py check: build, translation checks, shared HTML, sitemap and Cairo sharing-card stages completed. 21 of 25 maintenance tests passed; the 4 errors are WinError 1314 when the tests create directory symlinks on Windows without that privilege.
  • npx [email protected] --check website/public/assets/styles.css: passed.
  • git diff --check: passed.
  • Pre-push check:fast with Node 24.22.1: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Chromium on Windows 11 only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

Author readiness

Human owner: @pirrozani

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

The phone header gave each link an equal minmax(0, 1fr) column and
allowed overflow-wrap: anywhere, so single-word labels such as
"Showcases", "Anleitungen", "Руководства" and "Посібники" broke between
letters at 320-430px. Links now share the row as flex items that never
shrink below their longest word. Labels wrap only at spaces, and a word
wider than the whole row can still break, preserving the enlarged-text
fit from morluto#3598.

Refs morluto#3597
@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The CSS change appears safe to merge; no actionable issues were found.

Summary

Changes phone navigation from four fixed grid columns to wrapping flex links. Each link keeps enough room for its longest word, with a fallback for words wider than the row.

  • Phone navigation labels stay whole when their words fit.

Reviews (1) · Last reviewed commit: "fix(website): keep phone navigation labe..." · Reviewed by Greptile

@pirrozani
pirrozani marked this pull request as ready for review October 27, 2026 13:39
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto
morluto merged commit 313af71 into morluto:main Oct 27, 2026
43 of 58 checks passed
@morluto morluto added the bug Something isn't working label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Website header navigation wraps onto a second line

2 participants