Skip to content

Break Japanese and Chinese store-hero headlines between phrases - #7

Merged
RyanEwen merged 1 commit into
mainfrom
cjk-phrase-breaks
Nov 28, 2026
Merged

RyanEwen merged 1 commit into
mainfrom
cjk-phrase-breaks

Conversation

@RyanEwen

Copy link
Copy Markdown
Collaborator

Japanese and Chinese store-hero headlines could start a line with a particle or split a verb from its ending, for example "すべてのプリンター / とプロジェクトを、" and "プリンターを選 / んで造形を送信". This change keeps those breaks between phrases.

  • For ja and zh-Hans and zh-Hant, a break between two CJK words is allowed only where Google's BudouX phrase model also puts a boundary. It only removes break points, never adds them. If no size fits with phrase breaks, fitText falls back to the old word breaks, so a headline that fitted before never starts failing.
  • wrapText and fitText keep their signatures and stay synchronous.
  • Latin-script output is unchanged: 5,186 listing and manifest strings from every app repo render identically old against new, and the committed en-US example heroes re-render byte-identical.
  • Japanese headlines can come out a little smaller, because phrases are longer than words. Of the existing app heroes, only ChatMixr ja-JP changes; it goes through screenshot approval at its next bump.
  • budoux 0.10.4 (Apache-2.0) is pinned exactly. It is devkit's first runtime dependency and is loaded only by devkit-store-hero and text.mjs. The exact pin is deliberate: heroes are checked pixel for pixel, so a model update must be a deliberate bump that re-renders and re-approves the affected heroes.
  • The 0.32.0 release notes gain three bullets for this change, next to the Paseo removal already on main.

Tests: npm run validate passes (336 tests, 335 pass, 1 skipped as before).

AI disclosure: this comment and the related code were written with the assistance of AI.

ICU word segmentation let a line start with a particle or split a verb from its ending ("すべてのプリンター / とプロジェクトを、", "選 / んで"). For ja and zh, a break between two CJK words is now allowed only where Google's BudouX phrase model also puts a boundary, so breaks can only be removed, never added; if no size fits that way, fitText falls back to the old word breaks so a headline that fitted never starts failing. Latin-script output is byte-identical (5,186 listing and manifest strings across the app repos compared old against new).

budoux is pinned exactly at 0.10.4, devkit's first runtime dependency: heroes are checked pixel for pixel by devkit-store-hero --check, so a model update must be a deliberate bump that re-renders and re-approves the affected heroes, not a silent drift. It is used as a package rather than vendored so its licence (Apache-2.0) and updates stay traceable.
@RyanEwen
RyanEwen merged commit c67f256 into main Nov 28, 2026
1 check passed
@RyanEwen
RyanEwen deleted the cjk-phrase-breaks branch November 28, 2026 16:04
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