Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This pull request is waiting on an engineering owner's decision, and it needs three fixes either way.
component:Text FR4 and component:Heading FR4 currently say a truncated single line defaults to wordBreak="break-all", and this change rewrites both to break-word. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so if they are an engineering owner), and approval waits on it.
Required fixes:
- Heading's Chinese and dense prop docs (
Heading.doc.mjslines 209 and 287), theTextWordBreakblock template (line 28) and the Text "Word Break Variants" story (Text.stories.tsxline 423) still saybreak-allis the single-line default, soastryx component Heading --denseand--zhnow describe the opposite of what ships. - The changeset should be tagged
[feat]and name the old and new default plus thewordBreak="break-all"opt-in, as the release rules ask for an intentional typography default change. - The title's scope
fix(Text)leaves out Heading, whosewordBreakdefault also changes, so retitle itfix(Text, Heading): …or list both components under a## Scopeheading.
The behavior itself checks out: the new tests fail on main and pass here, and the default one-line ellipsis renders identically.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the default
wordBreakbecomesbreak-wordfor single-line and multi-line truncation in Text and Heading. Verified:Text.tsx:260,Heading.tsx:249, Chromium computed styles. - Claim: an explicit
wordBreak="break-all"still splits inside words. Verified:text.stylex.ts:283-285, Chromium computed styles. - Claim: unit tests cover the default single-line clamp and restored wrapping. Verified:
Text.test.tsx:253-272,Heading.test.tsx:325-348; they fail onmainand pass here. - Claim: the Chromium reflow contract checks the computed
normal/break-wordpair. Verified by readingTextReflow.a11y.chromium.spec.ts:114-126; not run here, the same values were measured in Chromium. - Claim: the component API descriptors and both specs are updated, with a patch changeset. Partly false: the English descriptors and both FR4 rows are updated; Heading's Chinese and dense descriptors are not.
- Claim: the old default was invisible under
nowrap, and the default ellipsis is unchanged. Verified: the Single Line Truncation story renders pixel-identical. - Claim: computed styles move from
break-all/normaltonormal/break-word. Verified in Chromium. - Claim: the two test files pass (90 tests), Core typecheck passes, targeted ESLint and Prettier pass. Verified. The repository check and the Chromium contract run were not repeated.
- Changeset claim: single-line Text and Heading keep words whole when wrapping is restored. Verified in Chromium; the tag and wording fall short as noted above.
.changeset/single-line-word-break.md: finding (tag and wording).docs/specs/components/Heading/Heading.spec.md: FR4 rewrite awaits the owner decision.docs/specs/components/Text/Text.spec.md: FR4 rewrite awaits the owner decision.packages/core/src/Heading/Heading.test.tsx: clear.packages/core/src/Heading/Heading.tsx: finding (outside the title scope); default awaits the owner decision.packages/core/src/Text/Heading.doc.mjs: finding (Chinese and dense entries still give the old default).packages/core/src/Text/Text.doc.mjs: clear.packages/core/src/Text/Text.test.tsx: clear.packages/core/src/Text/Text.tsx: default awaits the owner decision.packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts: clear.
|
Addressed the review follow-up in : updated Heading dense/Chinese descriptors, the TextWordBreak template, and the Word Break Variants story; changed the changeset to with the old/new default and explicit opt-in. The engineering-owner decision on the FR4 record remains intentionally open. |
|
Addressed the review follow-up in ea12305: updated Heading dense/Chinese descriptors, the TextWordBreak template, and the Word Break Variants story; changed the changeset to [feat] with the old/new default and explicit wordBreak="break-all" opt-in. The engineering-owner decision on the FR4 record remains intentionally open. |
There was a problem hiding this comment.
This pull request is waiting on an engineering owner's spec decision; the fixes from the earlier review are all in.
component:Text FR4 and component:Heading FR4 currently say a truncated single line defaults to wordBreak="break-all", and this change intentionally rewrites both to break-word. An engineering owner settles it by commenting /approve-spec <full head SHA> on this pull request to approve the new FR4 text (the author may do so if they are an engineering owner); if the owner keeps break-all for maxLines={1}, the one-line default and both FR4 rows go back.
Otherwise the change checks out: the new tests fail on main and pass here, and the default one-line ellipsis renders identically.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim: Text and Heading default
wordBreaktobreak-wordfor single-line and multi-line truncation. Verified:Text.tsx:260,Heading.tsx:249, Chromium computed styles. - Claim: an explicit
wordBreak="break-all"still splits inside words. Verified:text.stylex.ts:283-285, Chromium shows the same split lines onmainand here. - Claim: unit tests cover the default single-line clamp and restored wrapping. Verified:
Text.test.tsx:253-272,Heading.test.tsx:325-348; they fail onmainand pass here. - Claim: the Chromium reflow contract checks the computed
normal/break-wordpair. Verified by readingTextReflow.a11y.chromium.spec.ts:114-126; not run here, and the same values were measured in Chromium. - Claim: the component API descriptors and both specs are updated, with a patch changeset. Verified:
Text.doc.mjs:121,Heading.doc.mjs:85,:209,:287, both FR4 rows, patch bump. - Claim: the old single-line default was invisible under
nowrap, andnowrapand the ellipsis are unchanged. Verified: the Text and Heading single-line truncation stories render pixel-identical. - Claim: computed styles move from
break-all/normaltonormal/break-word, and words stay whole oncewhite-space: normalis restored. Verified in Chromium. - Claim: the two test files pass (90 tests), Core typecheck passes, targeted ESLint and Prettier pass. Verified. The repository check and the Chromium contract run were not repeated.
- Changeset claim: the single-line default changes from
break-alltobreak-word, withwordBreak="break-all"as the opt-in, released as a patch[feat]. Verified against the code; the release-note rules for a typography default are met. - Author follow-up claim: Heading's dense and Chinese descriptors, the block template, the story and the changeset were updated. Verified.
.changeset/single-line-word-break.md: clear.apps/storybook/stories/Text.stories.tsx: clear.docs/specs/components/Heading/Heading.spec.md: FR4 rewrite awaits the owner decision.docs/specs/components/Text/Text.spec.md: FR4 rewrite awaits the owner decision.packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx: non-blocking note (template rubric C, unchanged frommain).packages/core/src/Heading/Heading.test.tsx: clear.packages/core/src/Heading/Heading.tsx: default awaits the owner decision.packages/core/src/Text/Heading.doc.mjs: clear.packages/core/src/Text/Text.doc.mjs: clear.packages/core/src/Text/Text.test.tsx: clear.packages/core/src/Text/Text.tsx: default awaits the owner decision.packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts: clear.
|
Thanks for this! I ran an independent check on head ea12305: Verdict: approve. No defect found. In real browsers, the one-line ellipsis renders pixel-identical with the new default in every layout I tried. Once a rule lets the line wrap again, the old default split words and the new one splits none. This is evidence for the pending FR4 decision: keeping What I ranScratch clone, Node 24.22.1,
* One Firefox pair (Chinese in the plain block) differed on the first run with the same box. Four repeated shots showed the old rule's own rendering varying between runs (a font-fallback load), and the last old and new shots matched byte for byte. The Notes (non-blocking)
|
PR Analysis Report🔎 Preview ·
|
What changed
wordBreakbehavior forTextandHeadingtruncation tobreak-wordfor bothmaxLines={1}and multi-line truncation.wordBreak="break-all"escape hatch unchanged for callers that intentionally split inside words.whiteSpace: 'normal'.normal/break-wordpair.Why
The previous single-line default was
word-break: break-all. It was invisible while the component's ownwhite-space: nowrapwas active, but an application that restored wrapping could split ordinary words at arbitrary letters. The default now follows the same word-preserving behavior already used by multi-line truncation.Before / after
Before, the default computed styles for a single-line clamp were:
After, they are:
The default
white-space: nowrapand ellipsis are unchanged. When a caller setswhiteSpace: 'normal', words now remain intact instead of being split by the component's default.Verification
pnpm exec vitest run packages/core/src/Text/Text.test.tsx packages/core/src/Heading/Heading.test.tsx— 90 tests passed.pnpm -F @astryxdesign/core typecheck— passed.pnpm check:repo— passed; the existing temporary-status messages are warnings only.The browser contract writes local evidence screenshots under
test-results/text-reflow-evidence/; the defaultnowrapstate is visually unchanged, so no misleading screenshot is embedded here.Closes #11790