Repository navigation
feat(check): warn when a line break cuts a Korean word in two - #7409
wonjangcloud9 wants to merge 1 commit into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
miguel-heygen
left a comment
There was a problem hiding this comment.
Looks good, thanks for the clear repro.
- The detector only measures characters in text nodes that contain Hangul and span more than one line box, and it stops at 2000 characters, so the cost stays off non-Korean text.
- Comparing glyph centres rather than counting client rects is the right call: same-line font-fallback fragments and small rotations stay quiet, and the Chromium cases cover both.
- Joining
PERSISTENCE_TIERED_CODESkeeps typewriter reveals caught mid-word at info. - Docs and the captions reference line match the behaviour, and the skills manifest hash is in sync.
CI is green at 873e669. The one Windows engine lane failure (frameCapture-verifyArming.browser.test.ts timing out at 5000ms) is outside this change and passed on rerun.
Inline-block-per-syllable components can be a follow-up if anyone hits them.
miguel-heygen
left a comment
There was a problem hiding this comment.
The code is good to go, and the approval at 873e669 still stands. The only thing blocking the merge is that main requires verified commit signatures, and the merge queue won't accept this PR until its commit is signed ("Commits must have verified signatures").
Could you sign the commit and force-push? With a GPG or SSH signing key added to your GitHub account:
git commit --amend -S --no-edit
git push --force-with-leaseSetup docs: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
Once the commit shows as "Verified", I'll look over the new head and queue it. Thanks for the fix!
Head branch was pushed to by a user without write access
873e669 to
6b4db7e
Compare
|
Thanks for the review! I signed the commit with an SSH signing key and force-pushed: the new head |
6b4db7e to
05bc2f4
Compare
|
Rebased onto |
Korean puts spaces between words, but under the default `word-break: normal` Chrome may end a line between any two Hangul syllables, so a wrapped caption renders "줄바꿈되는 / 지" and `check` passed it with 0 layout issues. The layout audit now reports `text_word_split` (warning) when two adjacent characters of a Korean word sit on different lines: two Hangul syllables, or a Hangul particle and the Latin word or number it is attached to. The fix hint asks for `word-break: keep-all`, or for more room when keep-all is already set. Persistence-tiered like the other text findings, so a one-sample transient demotes to info. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
05bc2f4 to
17cffcf
Compare
|
Rebased onto That should cover the commit-signing request from the Nov 8 review — could you take another look when you have a moment? Thanks! |
What
checknow reportstext_word_split(warning) when a line break lands inside a Korean word: between two Hangul syllables, or between a Hangul particle and the Latin word or number it is attached to (HyperFrames|로). The fix hint asks forword-break: keep-all, or for more room when keep-all is already set. The captions reference gets one line telling agents to set keep-all on Korean captions, and the CLI docs describe the code.Why
Korean separates words with spaces, but Chrome's default
word-break: normallets a line end between any two Hangul syllables. A wrapped Korean caption renders a word cut in half, andcheckpasses it.Repro: a 900 px wide, 64 px Noto Sans KR caption reading "구독자 여러분 안녕하세요 오늘은 한국어 자막이 어떻게 줄바꿈되는지 확인해보겠습니다" renders its second line as "한국어 자막이 어떻게 줄바꿈되는" and its third as "지 확인해보겠습니다": the word 줄바꿈되는지 ("whether it wraps") loses its last syllable to the next line.
npx hyperframes checkonmain:With this branch:
After adding
word-break: keep-allto the caption, the render keeps 줄바꿈되는지 whole at the start of line 3 andcheck --no-cachereports 0 layout issues.Related work
No existing issue (searched for word-break, keep-all, Hangul, mid-word). #5885 is the Arabic counterpart: script-specific breakage that
checkandlintdo not report. #3353 handled CJK in transcripts and deliberately left Hangul out because Korean uses spaces; the same reasoning applies here, which is why only Korean is checked and Chinese/Japanese line breaks between characters stay quiet.How
layout-audit.browser.js: for each text element's direct text nodes that contain Hangul and span more than one line box, walk adjacent pairs of word characters where at least one is Hangul, measure each character with aRange, and report the first pair whose centres sit more than half a glyph apart vertically. Comparing centres instead of counting client rects keeps a same-line font-fallback fragment (a Latin face with Korean fallback) quiet, and a small caption tilt still reads as one line. Text without Hangul and single-line text nodes return before any per-character measuring; the scan stops at 2000 characters.warning, and the code joinsPERSISTENCE_TIERED_CODES, so a one-sample transient (a typewriter reveal caught mid-word) demotes to info like the other text findings.Test plan
layout-audit.browser.test.ts(split between syllables, Latin word and particle split, break at a space, no Hangul, keep-all already set). Turning the detector off fails the three positive cases.layout-audit.chromium.test.ts, real line breaking: syllable split, the same underrotate(-4deg), Latin word and particle split are reported; keep-all wrapping at spaces, Arial with Korean fallback wrapped at spaces, a single line,<br>, wrapped English, wrapped Japanese are not. Ran both layout audit files withPUPPETEER_EXECUTABLE_PATHset to chrome-headless-shell 152: 316/316 pass.layoutAudit.test.ts,check.test.tsandcheckBrowser*tests (298 pass);bun run lint,bun run lint:skills, typecheck and the pre-commit hooks pass.hyperframes renderbefore and afterkeep-alland compared frames; rancheck --no-cacheon both (output above).docs/packages/cli.mdx,skills/hyperframes/references/captions.md.🤖 Generated with Claude Code