Skip to content

fix(Text, Heading): default single-line truncation to break-word - #11830

Open
bezabyte wants to merge 9 commits into
meta:mainfrom
bezabyte:codex/issue-11790-word-break
Open

bezabyte wants to merge 9 commits into
meta:mainfrom
bezabyte:codex/issue-11790-word-break

Conversation

@bezabyte

@bezabyte bezabyte commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Changed the default wordBreak behavior for Text and Heading truncation to break-word for both maxLines={1} and multi-line truncation.
  • Kept the explicit wordBreak="break-all" escape hatch unchanged for callers that intentionally split inside words.
  • Added unit coverage for the normal single-line clamp and for callers that restore wrapping with whiteSpace: 'normal'.
  • Extended the existing Chromium reflow contract to verify the computed normal / break-word pair.
  • Updated the component API descriptors and Text/Heading specs, with a patch changeset that names @astryxdesign/core and @astryxdesign/cli (the TextWordBreak block template ships in the CLI).

Why

The previous single-line default was word-break: break-all. It was invisible while the component's own white-space: nowrap was active, but an application that restored wrapping could split ordinary words at arbitrary letters. The default now matches multi-line truncation. Lines break where a multi-line clamp breaks them (word-break: normal): between words in English and other space-separated text, while Korean, Chinese and Japanese still break between syllables or characters. A word wider than the line breaks inside itself, and in an auto-sized box that word keeps its width and widens the box.

Before / after

Before, the default computed styles for a single-line clamp were:

word-break: break-all
overflow-wrap: inherited (normal, or anywhere inside Core's anywhere containers)

After, they are:

word-break: normal
overflow-wrap: break-word

The default white-space: nowrap and ellipsis are unchanged. When a caller sets whiteSpace: 'normal', lines break where a multi-line clamp breaks them (word-break: normal): between words in English and other space-separated text, while Korean, Chinese and Japanese still break between syllables or characters. A word wider than the line breaks inside itself, and in an auto-sized box that word keeps its width and widens the box. Pass wordBreak="break-all" to keep the old split.

Verification

  • pnpm exec vitest run packages/core/src/Text/Text.test.tsx packages/core/src/Heading/Heading.test.tsx — 110 tests passed.
  • pnpm -F @astryxdesign/core typecheck — passed.
  • pnpm check:repo — passed; the existing temporary-status messages are warnings only.
  • Chromium Text reflow contract — 4 tests passed after rebuilding Storybook.
  • Targeted ESLint and Prettier checks — passed.

The browser contract writes local evidence screenshots under test-results/text-reflow-evidence/; the default nowrap state is visually unchanged, so no misleading screenshot is embedded here.

Writing rubric results

Run over the changed lines of component:Text and component:Heading:

R1 narration: none; the compatibility lines name the former default because that section records the compatibility change.
R2 research: none.
R3 evidence: the verification cells name tests (Text.test.tsx, Heading.test.tsx long-token tests), not pull requests.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.
R7 project status: none; the remaining multi-line wordBreak default is stated as a verification gap.

Closes #11790

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 4, 2026 11:05am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 15, 2026
@astracat-bot

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Dec 4, 2026, 11:21 AM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval labels Nov 15, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mjs lines 209 and 287), the TextWordBreak block template (line 28) and the Text "Word Break Variants" story (Text.stories.tsx line 423) still say break-all is the single-line default, so astryx component Heading --dense and --zh now describe the opposite of what ships.
  • The changeset should be tagged [feat] and name the old and new default plus the wordBreak="break-all" opt-in, as the release rules ask for an intentional typography default change.
  • The title's scope fix(Text) leaves out Heading, whose wordBreak default also changes, so retitle it fix(Text, Heading): … or list both components under a ## Scope heading.

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 wordBreak becomes break-word for 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 on main and pass here.
  • Claim: the Chromium reflow contract checks the computed normal / break-word pair. Verified by reading TextReflow.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 / normal to normal / 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.

Automated review (maintainer link)

Comment thread .changeset/single-line-word-break.md Resolved
Comment thread packages/core/src/Text/Heading.doc.mjs Resolved
Comment thread packages/core/src/Heading/Heading.tsx Resolved
@bezabyte bezabyte changed the title fix(Text): preserve words in single-line truncation fix(Text, Heading): preserve words in single-line truncation Nov 16, 2026
@bezabyte

Copy link
Copy Markdown
Contributor Author

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.

@bezabyte

Copy link
Copy Markdown
Contributor Author

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 wordBreak to break-word for 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 on main and 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 on main and pass here.
  • Claim: the Chromium reflow contract checks the computed normal / break-word pair. Verified by reading TextReflow.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, and nowrap and the ellipsis are unchanged. Verified: the Text and Heading single-line truncation stories render pixel-identical.
  • Claim: computed styles move from break-all / normal to normal / break-word, and words stay whole once white-space: normal is 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-all to break-word, with wordBreak="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 from main).
  • 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.

Automated review (maintainer link)

@duytbp

duytbp commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

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 break-all for maxLines={1} buys no visual difference while the line stays nowrap, and it splits words as soon as the line wraps.

What I ran

Scratch clone, Node 24.22.1, pnpm install --frozen-lockfile.

  1. vitest run --project ui packages/core/src/Text packages/core/src/Heading: 8 files, 365 tests, all pass on the head.

  2. Leftover defaults: git grep break-all on the head finds no maxLines-based break-all default anywhere else in packages/core (CodeBlock's break-all is its own), and no remaining "break-all for one line" claim in specs, docs (Text.doc.mjs, Heading.doc.mjs, both locales), stories or CLI templates.

  3. Rendering, plain HTML with the two rule sets the atomic classes produce, in Playwright with Chromium 1248 and Firefox 1555 at 16px sans-serif:

    • before: overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; word-break:break-all
    • after: the same with word-break:normal; overflow-wrap:break-word

    Seven strings: Latin words, a long URL, a German compound, Chinese, Thai (no spaces), Arabic (RTL), and emoji ZWJ sequences mixed with words. Six containers: a 180px block, a flex child with min-width:0, an auto-layout table cell, a grid-template-columns:auto 1fr cell, a shrink-to-fit inline-block, and a parent with overflow-wrap:anywhere, which stands in for the Banner and Toast containers. For each pair I compared a page screenshot and the element's box.

Browser nowrap (the default) Line wrapping restored (white-space:normal, Latin string, 180px)
Chromium 42 of 42 identical (screenshot and box) words split: before 1, after 0
Firefox 42 of 42 identical* words split: before 2, after 0

* 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 anywhere parent case matters because the old break-all class set no overflow-wrap, so a one-line clamp inherited anywhere inside those containers. It now gets break-word. Under nowrap that changes nothing, as the table shows (min-content is the whole line either way).

Notes (non-blocking)

  • I didn't run TextReflow.a11y.chromium.spec.ts, which needs a Storybook build. The plain-HTML check above covers the same computed values in a real engine.
  • An app that wants long unbroken tokens to wrap inside a narrow auto-sized column, after restoring wrapping, still needs its own overflow-wrap:anywhere, because break-word keeps min-content at the longest word. That matches maxLines above 1 and FR3, so it's consistent and not a gap in this PR.

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 21, 2026
@cixzhang
cixzhang marked this pull request as draft November 21, 2026 04:59
@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 05:00
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 012b411

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Text · Storybook 12.7 kB (0) · 6.2 kB CSS (0) 1,086 (−1) ✓ · ✓ · —
Selector 122.3 kB (−3 B) · 20.2 kB CSS (0) — — · — · —
Timer 15.2 kB (−3 B) · 6.8 kB CSS (0) — — · — · —

✓ passed · ✗ needs a fix · Δ changed, for review in the shots below · ↻ needs re-verify · — did not run

109 more components
Component Size LoC Visual · A11y · RTL
Slider 120.3 kB (−4 B) · 9.7 kB CSS (0) — — · — · —
TopNav 75.7 kB (−4 B) · 12.4 kB CSS (0) — — · — · —
richtext/RichTextView 292.1 kB (−4 B) · 2.4 kB CSS (0) — — · — · —
Button 71.6 kB (−5 B) · 11.3 kB CSS (0) — — · — · —
ChatComposerInput 93.2 kB (−5 B) · 12.8 kB CSS (0) — — · — · —
ChatComposerTokenElement 93.2 kB (−5 B) · 12.8 kB CSS (0) — — · — · —
ChatSendButton 72.0 kB (−5 B) · 11.3 kB CSS (0) — — · — · —
CheckboxList 69.6 kB (−5 B) · 8.5 kB CSS (0) — — · — · —
CheckboxListItem 86.4 kB (−5 B) · 13.1 kB CSS (0) — — · — · —
ContextMenu 110.8 kB (−5 B) · 20.0 kB CSS (0) — — · — · —
DropdownMenuSubMenu 82.8 kB (−5 B) · 11.6 kB CSS (0) — — · — · —
ListItem 85.5 kB (−5 B) · 13.1 kB CSS (0) — — · — · —
MultiSelector 111.4 kB (−5 B) · 19.5 kB CSS (0) — — · — · —
PowerSearch 329.1 kB (−5 B) · 27.9 kB CSS (0) — — · — · —
RadioList 65.8 kB (−5 B) · 8.0 kB CSS (0) — — · — · —
SideNavHeading 94.6 kB (−5 B) · 12.8 kB CSS (0) — — · — · —
Tokenizer 119.4 kB (−5 B) · 22.5 kB CSS (0) — — · — · —
TopNavHeading 93.7 kB (−5 B) · 12.7 kB CSS (0) — — · — · —
TopNavMegaMenu 86.8 kB (−5 B) · 13.4 kB CSS (0) — — · — · —
Typeahead 100.7 kB (−5 B) · 14.9 kB CSS (0) — — · — · —
lab/DiffViewer 100.8 kB (−5 B) · 2.3 kB CSS (0) — — · — · —
lab/SelectableCardGroup 74.9 kB (−5 B) · 162 B CSS (0) — — · — · —
lab/TabBarMoreList 99.4 kB (−5 B) · 1.8 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 299.0 kB (−5 B) · 454 B CSS (0) — — · — · —
AlertDialog 139.6 kB (−6 B) · 16.5 kB CSS (0) — — · — · —
AppShell 96.0 kB (−6 B) · 15.2 kB CSS (0) — — · — · —
Banner 73.6 kB (−6 B) · 11.9 kB CSS (0) — — · — · —
BaseTypeahead 89.0 kB (−6 B) · 12.4 kB CSS (0) — — · — · —
Calendar 82.8 kB (−6 B) · 12.0 kB CSS (0) — — · — · —
ChatComposer 96.1 kB (−6 B) · 14.0 kB CSS (0) — — · — · —
ChatDictationButton 72.2 kB (−6 B) · 11.4 kB CSS (0) — — · — · —
ChatMessageList 29.8 kB (−6 B) · 7.9 kB CSS (0) — — · — · —
ChatToolCalls 34.4 kB (−6 B) · 9.3 kB CSS (0) — — · — · —
CheckboxInput 74.5 kB (−6 B) · 11.1 kB CSS (0) — — · — · —
CodeBlock 87.9 kB (−6 B) · 13.1 kB CSS (0) — — · — · —
CommandPalette 87.3 kB (−6 B) · 14.0 kB CSS (0) — — · — · —
DateRangeInput 102.3 kB (−6 B) · 14.6 kB CSS (0) — — · — · —
Field 64.3 kB (−6 B) · 8.0 kB CSS (0) — — · — · —
FileInput 82.1 kB (−6 B) · 13.2 kB CSS (0) — — · — · —
Lightbox 156.3 kB (−6 B) · 12.5 kB CSS (0) — — · — · —
Link 61.6 kB (−6 B) · 7.8 kB CSS (0) — — · — · —
Popover 111.6 kB (−6 B) · 15.9 kB CSS (0) — — · — · —
RadioListItem 82.4 kB (−6 B) · 11.7 kB CSS (0) — — · — · —
SideNavCollapseButton 72.5 kB (−6 B) · 11.4 kB CSS (0) — — · — · —
Stepper 73.3 kB (−6 B) · 11.5 kB CSS (0) — — · — · —
Switch 115.1 kB (−6 B) · 11.0 kB CSS (0) — — · — · —
TableSelectionToolbar 82.2 kB (−6 B) · 14.9 kB CSS (0) — — · — · —
TabMenu 89.9 kB (−6 B) · 12.7 kB CSS (0) — — · — · —
TextArea 98.3 kB (−6 B) · 10.6 kB CSS (0) — — · — · —
Thumbnail 76.4 kB (−6 B) · 12.9 kB CSS (0) — — · — · —
TimeInput 188.2 kB (−6 B) · 18.3 kB CSS (0) — — · — · —
Timestamp 29.1 kB (−6 B) · 11.6 kB CSS (0) — — · — · —
TopNavMenu 92.9 kB (−6 B) · 12.7 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 135.3 kB (−6 B) · 773 B CSS (0) — — · — · —
lab/ListInput 103.3 kB (−6 B) · 1.3 kB CSS (0) — — · — · —
lab/TransferList 135.3 kB (−6 B) · 1.4 kB CSS (0) — — · — · —
lab/TransferListSelector 148.2 kB (−6 B) · 1.6 kB CSS (0) — — · — · —
BreadcrumbItem 106.8 kB (−7 B) · 14.3 kB CSS (0) — — · — · —
Carousel 83.5 kB (−7 B) · 12.4 kB CSS (0) — — · — · —
ChatLayout 95.3 kB (−7 B) · 11.9 kB CSS (0) — — · — · —
ChatLayoutScrollButton 72.1 kB (−7 B) · 11.5 kB CSS (0) — — · — · —
CommandPaletteInput 35.5 kB (−7 B) · 8.4 kB CSS (0) — — · — · —
ComplexSelector 89.0 kB (−7 B) · 13.7 kB CSS (0) — — · — · —
DateInput 216.1 kB (−7 B) · 19.5 kB CSS (0) — — · — · —
DateTimeInput 240.0 kB (−7 B) · 21.3 kB CSS (0) — — · — · —
Heading 13.5 kB (−7 B) · 6.2 kB CSS (0) — — · — · —
InputGroup 66.5 kB (−7 B) · 9.5 kB CSS (0) — — · — · —
NavHeadingMenuItem 20.7 kB (−7 B) · 7.1 kB CSS (0) — — · — · —
SideNavItem 87.9 kB (−7 B) · 12.6 kB CSS (0) — — · — · —
Spinner 26.4 kB (−7 B) · 7.0 kB CSS (0) — — · — · —
Toast 111.7 kB (−7 B) · 11.7 kB CSS (0) — — · — · —
ToggleButton 72.3 kB (−7 B) · 11.4 kB CSS (0) — — · — · —
lab/ChatReactionBar 136.8 kB (−7 B) · 1.1 kB CSS (0) — — · — · —
lab/CommentComposer 192.5 kB (−7 B) · 1.9 kB CSS (0) — — · — · —
lab/EmojiPicker 125.6 kB (−7 B) · 751 B CSS (0) — — · — · —
NumberInput 111.0 kB (−8 B) · 13.5 kB CSS (0) — — · — · —
SideNav 120.5 kB (−8 B) · 12.8 kB CSS (0) — — · — · —
Table 126.7 kB (−8 B) · 21.6 kB CSS (0) — — · — · —
TableCell 112.0 kB (−8 B) · 20.7 kB CSS (0) — — · — · —
TableHeaderCell 111.8 kB (−8 B) · 20.4 kB CSS (0) — — · — · —
lab/Comments 385.6 kB (−8 B) · 2.5 kB CSS (0) — — · — · —
richtext/RichTextEditor 315.5 kB (−8 B) · 2.7 kB CSS (0) — — · — · —
DropdownMenu 138.4 kB (−9 B) · 20.2 kB CSS (0) — — · — · —
IconButton 71.6 kB (−9 B) · 11.3 kB CSS (0) — — · — · —
MobileNavToggle 73.8 kB (−9 B) · 12.0 kB CSS (0) — — · — · —
MoreMenu 138.6 kB (−9 B) · 20.2 kB CSS (0) — — · — · —
Pagination 157.3 kB (−9 B) · 20.6 kB CSS (0) — — · — · —
lab/Schedule 124.1 kB (−9 B) · 3.9 kB CSS (0) — — · — · —
DialogHeader 74.9 kB (−13 B) · 13.0 kB CSS (0) — — · — · —
DrawerHeader 75.0 kB (−14 B) · 14.5 kB CSS (0) — — · — · —
lab/Tour 113.1 kB (−14 B) · 1.0 kB CSS (0) — — · — · —
MobileNav 85.2 kB (−15 B) · 12.0 kB CSS (0) — — · — · —
lab/CommentThread 378.6 kB (−15 B) · 2.4 kB CSS (0) — — · — · —
lab/DialogHeroHeader 96.4 kB (−15 B) · 372 B CSS (0) — — · — · —
Markdown 203.6 kB (−16 B) · 23.9 kB CSS (0) — — · — · —
charts/Chart 262.5 kB (−17 B) · 529 B CSS (0) — — · — · —
TextInput 105.6 kB (−17 B) · 13.2 kB CSS (0) — — · — · —
lab/VideoPlayer 241.4 kB (−17 B) · 2.1 kB CSS (0) — — · — · —
charts/ChartLegend 45.1 kB (−18 B) · 224 B CSS (0) — — · — · —
lab/MediaFullscreenButton 233.0 kB (−18 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTimeSlider 233.0 kB (−18 B) · 1.5 kB CSS (0) — — · — · —
lab/AudioPlayer 243.5 kB (−19 B) · 1.8 kB CSS (0) — — · — · —
lab/MediaCaptionsButton 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaPlaybackRate 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaPlayButton 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaSeekButton 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTime 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaVolume 233.0 kB (−19 B) · 1.5 kB CSS (0) — — · — · —
charts/ChartTooltip 238.4 kB (−31 B) · 451 B CSS (0) — — · — · —

Package size:

  • @astryxdesign/cli 4.96 MB packed (+45 B); no new dependencies
  • @astryxdesign/core 8.19 MB packed (+92 B); no new dependencies

API changes: core +0 · ~2 · −0

2 API changes (advisory)
Package Where Signature Usage
~ core . · Components · component Heading prop wordBreak?: WordBreak = 'break-all' for maxLines=1, 'break-word' otherwise → prop wordBreak?: WordBreak = 'break-word' <Heading wordBreak="break-word" />
~ core . · Components · component Text prop wordBreak?: WordBreak = 'break-all' for maxLines=1, 'break-word' otherwise → prop wordBreak?: WordBreak = 'break-word' <Text wordBreak="break-word" />

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.

Accessibility: 1 violation(s)

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang removed the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 21, 2026
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec ea12305

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026
The TextWordBreak CLI example ships in @astryxdesign/cli, so the
changeset must name that package too.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 25c4515

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the new wordBreak default, its tests and the rewritten FR4 rows hold up, but the two records still describe the old compatibility.

  • Both records still say the released default is preserved and the API does not change: docs/specs/components/Text/Text.spec.md (lines 43 and 58–60) and docs/specs/components/Heading/Heading.spec.md (lines 44 and 60–62) keep "Released default preserved: yes", "no public prop or default change" and "No API change." while FR4 now moves the maxLines={1} default from break-all to break-word, so set it to no with that reason and name the default change (a nonbreaking typography default; wordBreak="break-all" keeps the old split) in the Compatibility class and the at-a-glance row.

Non-blocking:

  • TextWordBreak.doc.mjs still lists only Text in componentsUsed: the block now uses Card and VStack, so add 'Card' and 'Stack' so CLI listings and search find it.
  • No test covers the wordBreak="break-all" opt-in: one case beside the new restored-wrap test would pin it, and a sentence instead of the spaceless URL would make those tests match their "breaks between words" names.
  • The new source comment is vague: in Text.tsx and Heading.tsx, "Keep the default word boundary behavior consistent" could read "A single-line clamp does not wrap. If a caller restores wrapping, lines break between words, as in a multi-line clamp."

The record edit needs a fresh /approve-spec <full head SHA> from an engineering owner for its head. In Chromium captures the default one-line ellipsis is pixel-identical and restored wrapping now keeps words whole.

Claims and files checked

Review mode: full; reason: requested

  • Title: the single-line truncation default becomes break-word: verified (Text.tsx:263, Heading.tsx:272; Text.test.tsx:254, Heading.test.tsx:325).
  • The default is break-word for one and several lines: verified (code and the same tests).
  • The break-all opt-in is unchanged: verified with a Chromium probe; no unit test.
  • Unit tests for the one-line clamp and for restored wrapping: verified (Text.test.tsx:254, :263; Heading.test.tsx:325, :338).
  • The Chromium reflow contract checks the computed pair: verified by reading TextReflow.a11y.chromium.spec.ts:114-127.
  • Docs, specs and a patch changeset for core and cli are updated: verified, except the records' compatibility lines (finding above).
  • The old break-all default was invisible under nowrap: verified (three default stories pixel-identical in Chromium).
  • Restored wrapping split words with the old default: verified (Chromium capture).
  • Lines now break between words, and a word wider than the line still wraps inside itself: verified (Chromium capture, Text and Heading).
  • Before and after computed pairs: after verified by the tests; before reported, matching the old source in ordinary flow.
  • nowrap and the ellipsis are unchanged: verified (tests and identical frames).
  • Verification list (unit tests, typecheck, repo check, browser contract, lint): reported; the two test files pass when run for this review (108 tests), and CI's lint and typecheck pass at this head.
  • Closes the linked issue: verified against its expected behaviour.
  • Changeset: the default moves from break-all to break-word, with break-all as the opt-in: verified; the changeset check passes.
  • Files: .changeset/single-line-word-break.md clear; apps/storybook/stories/Text.stories.tsx clear; Text.spec.md and Heading.spec.md blocking finding; TextWordBreak.tsx note; Text.tsx and Heading.tsx note; Text.test.tsx and Heading.test.tsx note; Text.doc.mjs, Heading.doc.mjs and TextReflow.a11y.chromium.spec.ts clear.

Automated review (maintainer link)

Comment thread docs/specs/components/Text/Text.spec.md Resolved
Comment thread packages/core/src/Text/Text.test.tsx Resolved
Comment thread packages/core/src/Text/Text.tsx Resolved
The Text and Heading records now say the maxLines={1} default changed
from break-all to break-word, a nonbreaking typography default, and
that wordBreak="break-all" keeps the old split. The wrap tests use a
sentence, a new test covers the break-all opt-in, the source comment
says what happens when a caller restores wrapping, and the
TextWordBreak block lists Card and Stack.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 5460972

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested, for the description only. The new wordBreak default, its tests, the rewritten FR4 records and the changeset hold up, and the default one-line clamp renders the same as before.

  • The description says nothing overflows and that lines no longer break inside words, but a token wider than the line still breaks inside itself, and with wrapping restored in an auto-sized box (an auto-layout table cell or an inline-block) break-word keeps the token's full width, so a URL in a 200 px container widened the table to 471 px where break-all wrapped it (reproduced locally in Chromium); please reword "Why" and "Before / after", for example: "Lines break between words, as in a multi-line clamp; only a word wider than the line breaks inside itself, and in an auto-sized box that word keeps its width and widens the box, as multi-line truncation already does."
  • Both verification maps still say the wordBreak defaults have no automated check (non-blocking): Text.spec.md:215 and Heading.spec.md:201 could name only the multi-line default now that the new tests pin the one-line default and the break-all opt-in.
Claims and files checked

Review mode: full; reason: requested

  • Claim, title: single-line truncation defaults to break-word: verified (Text.tsx:263, Heading.tsx:272).
  • Claim: both components default to break-word for one and several lines: verified (same lines, applied while truncating).
  • Claim: the break-all escape hatch is unchanged: verified (unchanged class; new opt-in tests pass).
  • Claim: unit coverage for the default clamp and for restored wrapping: verified (new cases pass on the head, fail on the base).
  • Claim: the Chromium reflow contract checks the normal / break-word pair: verified (assertion added; contract passes locally).
  • Claim: prop docs, both records and a patch changeset naming core and cli: verified (the CLI ships the block's assets).
  • Claim: the old default was break-all and stayed invisible under nowrap: verified (identical before and after frames).
  • Claim: restored wrapping used to split ordinary words: verified (base splits words mid-word).
  • Claim: lines now break between words instead of inside them (stated twice): false (a token wider than the line still splits).
  • Claim: a word wider than the line wraps inside itself, so nothing overflows: false (auto-sized boxes overflow).
  • Claim: the before and after computed pairs: reported for the base, verified for the head.
  • Claim: nowrap and the ellipsis are unchanged: verified.
  • Claim: the test, typecheck, repository-check and lint runs: reported; unit tests, the reflow contract and the changeset and knowledge checks re-run locally and pass.
  • Claim: closes the linked issue: verified (it reports this split and asks for this default).
  • Changeset: [feat] default change with the break-all opt-in named: verified.
  • Files: .changeset/single-line-word-break.md clear; apps/storybook/stories/Text.stories.tsx clear; docs/specs/components/Heading/Heading.spec.md non-blocking note; docs/specs/components/Text/Text.spec.md non-blocking note; packages/cli/assets/templates/blocks/components/Text/TextWordBreak.doc.mjs clear; packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx clear; packages/core/src/Heading/Heading.test.tsx clear; packages/core/src/Heading/Heading.tsx clear; 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 clear; packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts clear.

Automated review (maintainer link)

The new tests pin the one-line wordBreak default and the break-all
opt-in, so only the multi-line default stays a gap.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 7e8bb53

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested, for two sentences of the description only. The new wordBreak default, its tests, the owner-approved FR4 records, the prop docs and the changeset hold up, and the default one-line clamp renders exactly as before (pixel-identical in Chromium, reproduced locally).

  • The description says lines break between words and only an overlong word breaks inside itself, but word-break: normal follows each language's own line-breaking rules, so with wrapping restored a one-line clamp still splits Korean, Chinese and Japanese words that fit on the line (for example 디자인 became 디자 / 인 in a 180 px column, reproduced locally), in both the "Why" and the "Before / after" paragraphs.
  • No writing rubric results for the two changed records (non-blocking): the repository asks a pull request that edits a record to report the writing rubric under ## Writing rubric results, and a pass over the changed lines finds nothing to fix, so seven short lines would do.

Suggested wording for both paragraphs: "Lines break where a multi-line clamp breaks them (word-break: normal): between words in English and other space-separated text, while Korean, Chinese and Japanese still break between syllables or characters. A word wider than the line breaks inside itself, and in an auto-sized box that word keeps its width and widens the box."

Claims and files checked

Review mode: full; reason: requested

  • Claim, title: single-line truncation in Text and Heading defaults to break-word: verified (Text.tsx:263, Heading.tsx:272).
  • Claim: both components default to break-word for one and several lines: verified (same lines; the class applies whenever maxLines is above 0).
  • Claim: the explicit break-all escape hatch is unchanged: verified (unchanged class; new opt-in tests at Text.test.tsx:277 and Heading.test.tsx:352).
  • Claim: unit coverage for the default clamp and for callers that restore wrapping: verified (Text.test.tsx:254, :263; Heading.test.tsx:325, :338; pass locally).
  • Claim: the Chromium reflow contract checks the normal / break-word pair: verified by reading (TextReflow.a11y.chromium.spec.ts:106); not run locally.
  • Claim: prop docs, both records and a patch changeset naming core and cli, with the block shipping in the CLI: verified (every wordBreak descriptor entry updated; the CLI package ships assets).
  • Claim: the old default was break-all and stayed invisible under nowrap: reported for the base; identical before and after frames locally.
  • Claim: restoring wrapping used to split ordinary words: reported; reproduced locally on the base.
  • Claim: lines break between words and only a word wider than the line breaks inside itself (stated twice): false (Korean, Chinese and Japanese words that fit still split).
  • Claim: in an auto-sized box an overlong word keeps its width and widens the box, as multi-line truncation does: verified (469 px inside a 200 px container locally; multi-line uses the same class).
  • Claim: the before and after computed pairs: reported for the base, verified for the head (unit tests and a browser probe).
  • Claim: nowrap and the ellipsis are unchanged: verified (tests; pixel-identical frames).
  • Claim: wordBreak="break-all" keeps the old split: verified.
  • Claim: the test, typecheck, repository-check, browser-contract and lint runs: reported; unit tests and the changeset and knowledge checks re-run locally and pass, and CI's lint and typecheck pass.
  • Claim: the browser contract writes evidence screenshots to its results folder: verified (the spec writes there).
  • Claim: closes the linked issue: verified (it reports this split and asks for this default).
  • Changeset: [feat] default change from break-all to break-word with the break-all opt-in, patch for core and cli: verified (the changeset check passes locally).
  • Files: .changeset/single-line-word-break.md clear; apps/storybook/stories/Text.stories.tsx clear; docs/specs/components/Heading/Heading.spec.md non-blocking note (rubric results); docs/specs/components/Text/Text.spec.md non-blocking note (rubric results); packages/cli/assets/templates/blocks/components/Text/TextWordBreak.doc.mjs clear; packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx clear; packages/core/src/Heading/Heading.test.tsx clear; packages/core/src/Heading/Heading.tsx clear; 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 clear; packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested for one sentence of the description. The new wordBreak default, its tests, the owner-approved FR4 records, the prop docs and the changeset hold up, and the default one-line ellipsis renders identically before and after.

  • The description's Before block says a single-line clamp computed overflow-wrap: normal, but inside Banner, Toast, FieldStatus and CommandPaletteEmpty it inherited anywhere, because the old break-all class set no overflow-wrap (reproduced in a Banner), so please write it as "word-break: break-all with an inherited overflow-wrap (normal, or anywhere inside Core's anywhere containers)".

Two smaller points you can fix at the same time:

  • The Verification section's test count is stale: the two test files hold 110 tests at this head, not 90, and all of them pass.
  • Miss: The new source comment says lines break between words, but Korean, Chinese and Japanese text still breaks between syllables or characters; the inline comments suggest wording.
Claims and files checked

Review mode: full; reason: requested

  • Claim: both components default to break-word for one-line and multi-line truncation — verified (code; new tests fail before the change and pass after, run locally).
  • Claim: the break-all opt-in is unchanged — verified (styles unchanged; opt-in tests pass before and after).
  • Claim: unit tests cover the default one-line clamp and restored wrapping — verified (tests read and run).
  • Claim: the Chromium reflow contract now checks the computed normal / break-word pair — verified by reading the test; not run.
  • Claim: prop docs, both records and a patch changeset naming core and cli are updated — verified.
  • Claim: the old one-line default was break-all — reported; matches the base.
  • Claim: the old default was invisible while nowrap applied — verified (pixel-identical Chromium frames, base and head).
  • Claim: restored wrapping used to split words mid-letter — verified (base probe).
  • Claim: the default now matches multi-line truncation; lines break between words in English and between syllables or characters in Korean, Chinese and Japanese — verified for English and Korean in Chromium; Chinese and Japanese follow the same line-breaking class.
  • Claim: an overlong word breaks inside itself and widens an auto-sized box — verified (probe: a table cell grows from 170 to 469 px).
  • Claim: before, a one-line clamp computed break-all with overflow-wrap normal — false inside Core's anywhere containers (finding above).
  • Claim: after, it computes normal with break-word — verified, including inside a Banner.
  • Claim: nowrap and the ellipsis are unchanged, and break-all keeps the old split — verified.
  • Claim: the two test files ran 90 tests — reported; stale, 110 at this head (all pass, run locally).
  • Claim: typecheck, ESLint and Prettier pass — verified in CI at this head.
  • Claim: the repository check and the four-test Chromium contract pass — reported.
  • Claim: the default nowrap state is visually unchanged — verified (frames).
  • Claim: writing rubric results R1–R7 — verified against the changed record lines.
  • Claim: closes the linked word-break issue — verified; the change does what it asks.
  • Changeset: a patch feat note naming the old and new default and the break-all opt-in — verified.
  • Title: default single-line truncation to break-word — verified.
  • File .changeset/single-line-word-break.md — clear.
  • File apps/storybook/stories/Text.stories.tsx — clear.
  • File docs/specs/components/Heading/Heading.spec.md — clear.
  • File docs/specs/components/Text/Text.spec.md — clear.
  • File packages/cli/assets/templates/blocks/components/Text/TextWordBreak.doc.mjs — clear.
  • File packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx — clear.
  • File packages/core/src/Heading/Heading.test.tsx — clear.
  • File packages/core/src/Heading/Heading.tsx — comment note.
  • File packages/core/src/Text/Heading.doc.mjs — clear.
  • File packages/core/src/Text/Text.doc.mjs — clear.
  • File packages/core/src/Text/Text.test.tsx — clear.
  • File packages/core/src/Text/Text.tsx — comment note.
  • File packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts — clear.

Automated review (maintainer link)

Comment thread packages/core/src/Text/Text.tsx Resolved
Comment thread packages/core/src/Heading/Heading.tsx Resolved
Korean, Chinese and Japanese text still breaks between syllables or
characters, so the comment says lines break where a multi-line clamp
breaks them.
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 3b54759

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the deferred build, test and docsite-test jobs have not run on this head yet and must pass before merge.

The new single-line wordBreak default, the rewritten Text and Heading FR4 records (approved by an engineering owner for this head), the prop docs, tests, block template and changeset all hold up. Reproduced locally, the new default tests fail on the base and all 110 pass on this head, one-line truncation renders pixel-identically, and text whose wrapping is restored now breaks between words. Nothing else is needed from you; thank you for the fix.

Claims and files checked

Review mode: full; reason: requested

  • Claim: the title's single-line Text and Heading default is now break-word: verified (Text.tsx:263, Heading.tsx:272).
  • Claim: break-word is the default for both one-line and multi-line truncation: verified (code; the unit tests pass here and fail on the base).
  • Claim: the explicit break-all opt-in is unchanged: verified (the unchanged break-all style; Text.test.tsx:277, Heading.test.tsx:352).
  • Claim: unit coverage for the default one-line clamp and for restored wrapping: verified (Text.test.tsx:254 and :264, Heading.test.tsx:325 and :338).
  • Claim: the Chromium reflow contract checks the normal / break-word pair: verified (TextReflow.a11y.chromium.spec.ts:114-126).
  • Claim: prop docs and both records updated, with a patch changeset naming core and cli because the block template ships in the CLI: verified (English, Chinese and dense docs; the CLI package ships its assets; the changeset check passes).
  • Claim: the old one-line default was break-all, invisible under nowrap, and split ordinary words once wrapping was restored: verified (identical one-line frames; the base splits words in Chromium).
  • Claim: the default now matches multi-line truncation, breaking between words in English and between syllables or characters in Korean, Chinese and Japanese: verified (Chromium probe on this head).
  • Claim: a word wider than the line breaks inside itself, and in an auto-sized box it keeps its width and widens the box: verified (a URL splits in a 180 px box; a table cell grows to 479 px in a 200 px container).
  • Claim: before, word-break was break-all and overflow-wrap was inherited: reported, consistent with the base code and a base probe.
  • Claim: after, word-break is normal and overflow-wrap is break-word, with nowrap and the ellipsis unchanged: verified (unit tests, probe).
  • Claim: passing break-all keeps the old split: verified.
  • Claim: 110 unit tests pass: verified (110 of 110, reproduced locally).
  • Claim: the core typecheck passes: reported; CI's typecheck passes on this head.
  • Claim: the repository checks pass: reported; the changeset and knowledge checks pass locally.
  • Claim: the Chromium reflow contract passes its 4 tests: reported, not run here; CI's heavy jobs have not run yet.
  • Claim: targeted lint and Prettier checks pass: reported; CI's lint passes on this head.
  • Claim: the browser contract writes evidence screenshots under test-results, and the default nowrap state looks unchanged: verified (TextReflow.a11y.chromium.spec.ts:30; identical frames).
  • Claim: the writing rubric results for both records: verified against the changed record lines.
  • Claim: closes the linked word-break issue: verified; its expected behaviour matches this head.
  • Claim: the changeset's feat note names the old and new default and the break-all opt-in: verified.
  • File .changeset/single-line-word-break.md: clear
  • File apps/storybook/stories/Text.stories.tsx: clear
  • File docs/specs/components/Heading/Heading.spec.md: clear
  • File docs/specs/components/Text/Text.spec.md: clear
  • File packages/cli/assets/templates/blocks/components/Text/TextWordBreak.doc.mjs: clear
  • File packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx: clear
  • File packages/core/src/Heading/Heading.test.tsx: clear
  • File packages/core/src/Heading/Heading.tsx: clear
  • File packages/core/src/Text/Heading.doc.mjs: clear
  • File packages/core/src/Text/Text.doc.mjs: clear
  • File packages/core/src/Text/Text.test.tsx: clear
  • File packages/core/src/Text/Text.tsx: clear
  • File packages/core/src/Text/__tests__/TextReflow.a11y.chromium.spec.ts: clear

Automated review (maintainer link)

Resolve the Text verification map: keep main's truncation known limit
and name the tested one-line wordBreak default and break-all opt-in.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026
@cixzhang

cixzhang commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 012b411

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 4, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the heavy CI jobs that waited for review are now running on this head and must pass before merge.

The new one-line wordBreak default for Text and Heading, its tests, the approved FR4 records, the prop docs, the TextWordBreak block and the changeset all hold up. Run locally, the new tests fail on main and pass here. In Chromium the one-line ellipsis is pixel-identical before and after, and with wrapping restored the lines now break between words.

Claims and files checked

Review mode: full; reason: requested

Claims:

  • Title: single-line Text and Heading truncation now defaults to break-word. Verified: the resolver lines in Text.tsx and Heading.tsx; the new tests fail on main and pass on this branch, run locally.
  • Changeset: the default moves from break-all to break-word, wordBreak="break-all" opts back in, patch for core and cli. Verified: the code and opt-in tests, the CLI package ships its assets folder, and the changeset check passes locally.
  • Both components default to break-word for one and several lines. Verified in code and by the tests.
  • The explicit break-all opt-in is unchanged. Verified: its style class is untouched, and in Chromium it reproduces the old line breaks.
  • New unit tests cover the default one-line clamp and restored wrapping. Verified: run locally, 110 tests pass.
  • The Chromium reflow contract now checks the normal / break-word pair. Verified by reading the spec; the same computed values were probed on its story in Chromium. Your run of it is reported.
  • Prop docs, both records and the changeset are updated, and the block ships in the CLI. Verified: a repository-wide search for break-all finds no other one-line default claim.
  • The old one-line default was break-all, invisible under nowrap. Verified: computed values on main, and before/after frames that are pixel-identical.
  • Restored wrapping used to split words at any letter. Verified on main in a 180 px column (broug / ht).
  • The default now matches multi-line truncation, and lines break the way a multi-line clamp breaks them. Verified in code.
  • Space-separated text breaks between words, and Korean, Chinese and Japanese still break between syllables or characters. Verified for English and Japanese in Chromium, and for Korean by its line-break position; Chinese follows the same word-break: normal rule.
  • A word wider than the line breaks inside itself, and in an auto-sized box it keeps its width and widens the box. Verified: a URL in a 180 px column, and an auto-layout table that grows to 489 px inside 200 px.
  • Before block: break-all, with overflow-wrap inherited (anywhere inside Core's anywhere containers). Verified, including inside Banner.
  • After block: normal / break-word, with nowrap and the ellipsis unchanged. Verified, including inside Banner.
  • wordBreak="break-all" keeps the old split. Verified.
  • Verification list (110 tests, typecheck, repository checks, 4 Chromium contract tests, lint and format). Reported. The 110 tests were reproduced locally; lint and typecheck pass in CI on this head; the knowledge and changeset checks pass locally.
  • The browser contract writes its screenshots under test-results/text-reflow-evidence/. Verified in the spec file.
  • The default nowrap state is visually unchanged. Verified by pixel-identical frames.
  • Writing rubric results R1 to R7 for both records. Verified against the changed record lines.
  • Closes #11790. The issue's expected behavior is what the head does.

Files:

  • .changeset/single-line-word-break.md: clear
  • apps/storybook/stories/Text.stories.tsx: clear
  • docs/specs/components/Heading/Heading.spec.md: clear
  • docs/specs/components/Text/Text.spec.md: clear
  • packages/cli/assets/templates/blocks/components/Text/TextWordBreak.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/Text/TextWordBreak.tsx: clear
  • packages/core/src/Heading/Heading.test.tsx: clear
  • packages/core/src/Heading/Heading.tsx: clear
  • 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: clear
  • packages/core/src/Text/tests/TextReflow.a11y.chromium.spec.ts: clear

Automated review (maintainer link)

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Posted by Cindy's agent.) Approved at this exact head.

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Dec 4, 2026

This branch was successfully deployed

1 active deployment
Preview — 012b4119 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Text, Heading: maxLines={1} defaults to word-break: break-all, which splits words once the line wraps

4 participants