Skip to content

fix(Citation): a citation pill grows with its label when the text grows past it - #12461

Merged
cixzhang merged 6 commits into
mainfrom
fix/citation-grows-with-text
Nov 21, 2026
Merged

cixzhang merged 6 commits into
mainfrom
fix/citation-grows-with-text

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

A Citation's label and number pills grow with their text when the text size grows past their 20 px height, instead of clipping the label.

User impact

  • People who use large text (iOS Dynamic Type accessibility sizes, or a browser's larger text): a citation's label is no longer cut off. At iOS AX5, 58 px of label sat in a 20 px pill.
  • Everyone at the default text size: unchanged. Each pill keeps its 20 px height.

Change

  • Citation.tsx: the label pill's height is max(20 px, 1lh) (--spacing-5), the rule Button uses. At the default text size one line is no taller than the pill. The superscript number badge keeps the same line height (so the default text size lays out exactly as on main in every theme) and grows to max(20 px, min(1lh, 1.5em)): at most 1.5em, which holds the text box of common UI fonts (Noto Sans needs about 1.4em), so at larger text it holds its digits and raises its line less than a full line-height badge would.
  • New Citation/__tests__/CitationTextSize.interaction.browser.spec.ts:
    • At the default text size every citation in the Variants story is 20 px.
    • With the text enlarged (40 px on a 60 px line) and spacing unchanged, each pill holds its text.
  • Citation.spec.md: system_specs lists spec:AST-102, and verified_by lists the spec.
  • Changeset: [fix] patch.

Authority

spec:AST-102 FR4: "A control grows with its text rather than holding a fixed height, so its height never clips a label." The label's existing maxWidth (15em) and ellipsis are unchanged.

Evidence

  • Real Chromium (Playwright 1.61.1), desktop page: the growth case fails on main and passes here, and the default-height case passes in both.
  • Citation and Markdown units pass 1487/1487; tsc, eslint, check:knowledge and check:changesets are clean. WebKit runs in CI.
  • Desktop frames, this head's label pill against main, at text-only 200% (Dynamic-Type style): centring is unchanged, and the label pill grows from 20 to 40 px with no clipped text, where main clips each label. At this head, in all eight published themes, desktop (1280, mouse) and touch (390), light and dark: 100% is byte-identical to main in all 64 cases, In A Sentence included; at text-only 200% no text sits outside any pill or badge; and the number badge's line rises no more than with a full line-height badge in all 16 theme and pointer cases. The tallest text box among the theme fonts is 1.423 em (Fustat, Gothic), then Poppins 1.38 em and Noto Sans (Linux fallback) 1.375 em, all within the badge's 1.5 em cap. On Linux, the text-size browser spec passes with Liberation Sans and with Noto Sans.
  • A run under machine load failed one test once: Citation.missingSource.test.tsx "Citation without a source > names the prop and the fix" (a development-warning check this change does not touch). It passed 3 of 3 runs on its own and in the full Citation run.

Overlap checked: #12434 (merged; it centres the label pill on its line, and this head keeps that alongside the height change)

Writing rubric results

  • R1 narration: the record lines name files and tests in the present tense.
  • R2 research: none.
  • R3 evidence: none in the record beyond verified_by and verification rows.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none.

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: code review, CI, merge.

…ws past it

The label and number pills held a fixed 20 px height with the label inside,
so at large text sizes the label was clipped (58 px of label in 20 px at iOS
AX5). Their height is now max(20 px, 1lh): at the default text size one
line is no taller than the pill, so each keeps its height, and a larger text
size grows it. A browser spec covers both; Citation's record lists AST-102
and the spec.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@vercel

vercel Bot commented Nov 17, 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 Nov 21, 2026 1:15am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 3:47 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bde896a

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7df19cb

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Citation · Storybook 21.2 kB (+4 B) · 4.5 kB CSS (+31 B) 242 (0) ✓ · ✓ · —
Markdown 208.2 kB (+5 B) · 23.4 kB CSS (+22 B) — — · — · —
lab/Comments 387.3 kB (+9 B) · 2.5 kB CSS (0) — — · — · —
1 more component
Component Size LoC Visual · A11y · RTL
lab/CommentThread 380.2 kB (+5 B) · 2.4 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 7.87 MB packed (+206 B); no new dependencies.

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


Generated by PR Enrichment workflow | View full report

@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.

Requesting changes for one sentence in the description. The pill change itself conforms: the new browser spec fails on main and passes here, and the default text size renders identically.

  • The description calls max(20 px, 1lh) "the rule Button and SegmentedControl use", but SegmentedControl still has fixed heights at this head (SegmentedControlItem.tsx:168-179) and only gets this rule in #12457, so the sentence should name Button only.

Optional: the new comment at Citation.tsx:81-82 restates max(); it could instead say why this is a height and not a minHeight (with an auto height, the borders would make the default pill 22 px tall).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: the label and number pills grow with their text once it outgrows 20 px — verified (Citation.tsx:83, :144; the new spec fails on main and passes here).
  • Claim: this covers iOS Dynamic Type accessibility sizes or a browser's larger text — verified for iOS sizes and for a browser minimum font size; a browser's default font size or zoom already fit on main.
  • Claim: the default text size keeps each pill at 20 px — verified (default frames are pixel-identical).
  • Claim: the height uses the same rule as Button and SegmentedControl — false for SegmentedControl (SegmentedControlItem.tsx:168-179); true for Button (Button.tsx:291-293).
  • Claim: at the default size one line is no taller than the pill — verified (the line snaps to the 20 px pill).
  • Claim: the new spec checks 20 px at the default size and growth at a 40 px font on a 60 px line — verified.
  • Claim: the Citation record now links the typography spec and the new spec — verified.
  • Claim: a patch fix changeset — verified.
  • Claim: the quoted typography requirement — verified word for word.
  • Claim: the label's 15em maximum width and ellipsis are unchanged — verified (Citation.tsx:98, :104-109).
  • Claim: 58 px of label in a 20 px pill at the largest iOS size — not verifiable here (device measurement); an emulation of that size shows a 67.7 px line in the 20 px pill.
  • Claim: the growth case fails on main and passes here, and the default case passes on both — verified.
  • Claim: Citation and Markdown unit tests pass — verified.
  • Claim: TypeScript, ESLint, the knowledge check and the changeset check are clean — verified.
  • Claim: WebKit runs in CI — not yet: CI has not run on this draft head.
  • Claim: device stills will follow — pending.
  • Claim: the overlapping Citation pull request changes only vertical alignment — verified.
  • File: .changeset/citation-grows-with-text.md — clear.
  • File: docs/specs/components/Citation/Citation.spec.md — clear.
  • File: packages/core/src/Citation/Citation.tsx — clear (one optional comment suggestion).
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts — clear.

Automated review (maintainer link)

Comment thread packages/core/src/Citation/Citation.tsx Resolved

@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: CI has not run on this head yet, because the pull request is still a draft, and marking it ready for review starts the run.

The description now credits the max(20 px, 1lh) rule to Button only, which resolves the one earlier blocking point. The pill change conforms: the new browser spec fails on main and passes here, and the default text size renders identically.

Optional: the new comment at Citation.tsx:81-82 restates max(); it could instead say why this is a height and not a minHeight (with an auto height, the borders would make the default pill 22 px tall).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: a citation's label and number pills grow with their text once it outgrows 20 px — verified (Citation.tsx:83, :144; the new spec fails on main and passes here).
  • Claim: this covers iOS Dynamic Type accessibility sizes or a browser's larger text — verified for iOS sizes and for a browser minimum font size; a browser's default font size or zoom already fit on main.
  • Claim: the default text size keeps each pill at 20 px — verified (default frames are pixel-identical).
  • Claim: the height uses the rule Button uses — verified (Button.tsx:291-293).
  • Claim: at the default size one line is no taller than the pill — verified (the line snaps to the 20 px pill).
  • Claim: the new spec checks 20 px at the default size and growth at a 40 px font on a 60 px line with spacing unchanged — verified.
  • Claim: the Citation record now links the typography spec and the new spec — verified.
  • Claim: a patch fix changeset — verified.
  • Claim: the quoted typography requirement — verified word for word.
  • Claim: the label's 15em maximum width and ellipsis are unchanged — verified (Citation.tsx:98, :104-109).
  • Claim: 58 px of label in a 20 px pill at the largest iOS size — not verifiable here (device measurement); an emulation of that size shows a 67.7 px line in the 20 px pill.
  • Claim: the growth case fails on main and passes here, and the default case passes on both — verified.
  • Claim: Citation and Markdown unit tests pass — verified.
  • Claim: TypeScript, ESLint, the knowledge check and the changeset check are clean — verified.
  • Claim: WebKit runs in CI — not yet: CI has not run on this draft head.
  • Claim: device stills will follow — pending.
  • Claim: the overlapping Citation pull request changes only vertical alignment — verified.
  • File: .changeset/citation-grows-with-text.md — clear.
  • File: docs/specs/components/Citation/Citation.spec.md — clear.
  • File: packages/core/src/Citation/Citation.tsx — clear (one optional comment suggestion).
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts — clear.

Automated review (maintainer link)

@cixzhang cixzhang removed the needs:design-review Affects visuals — Design should review label Nov 20, 2026
# Conflicts:
#	packages/core/src/Citation/Citation.tsx
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 20, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0252d11

@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: a few CI jobs are still running on this head.

Both pill heights now follow max(--spacing-5, 1lh), which meets the typography requirement that a control's height never clips its label: in Chromium with the citation text at 24 to 40 px, every pill on main stays 20 px with its line 10 to 20 px outside it, while on this head each pill grows to hold the line, and the default size renders identically. The new browser spec fails against main and passes here.

Optional: the comment at Citation.tsx:89-90 restates max(); it could instead say why this is a height and not a minHeight (with an auto height the borders would make the default pill 22 px tall).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: the label and number pills grow with their text once it outgrows their 20 px height, instead of clipping the label — verified (Citation.tsx:91, :152; base and head probes with the citation text at 24, 36 and 40 px).
  • Claim: this covers iOS Dynamic Type accessibility sizes or a browser's larger text — verified for text that grows without its spacing; a browser's default font size or zoom scales the pill too and already fit on main.
  • Claim: at the default text size each pill keeps its 20 px height, unchanged for everyone — verified (default frames pixel-identical; every first-party theme's supporting line is 20 px or less; CI's visual regression shows the Citation shots unchanged).
  • Claim: 58 px of label sat in a 20 px pill at the largest iOS size — not verifiable here (device measurement) and not relied on.
  • Claim: the height uses the rule Button uses — verified (Button.tsx:291-293).
  • Claim: at the default size one line is no taller than the pill — verified (the 20.0004 px line lays out at the 20 px floor).
  • Claim: the new spec checks 20 px in the Variants story and, with text at 40 px on a 60 px line and spacing unchanged, that each pill holds its text — verified (spec lines 70-95).
  • Claim: the Citation record now lists the typography spec and the new spec — verified (Citation.spec.md:16, :35).
  • Claim: a patch fix changeset — verified.
  • Claim: the quoted typography requirement — verified word for word.
  • Claim: the label's 15em maximum width and ellipsis are unchanged — verified (Citation.tsx:106, :112-117; the ellipsis shows at a 40 px font on the head).
  • Claim: the growth case fails on main and passes here, and the default case passes in both — verified (Chromium, both Storybook builds).
  • Claim: Citation and Markdown unit tests pass — verified (1518 of 1518 at this head, which includes tests merged from main).
  • Claim: TypeScript, ESLint, the knowledge check and the changeset check are clean — verified.
  • Claim: WebKit runs in CI — verified (CI's WebKit interaction leg passed on this head).
  • Claim: iOS device stills will follow — pending.
  • Claim: the other open Citation fix changes vertical alignment only — verified; it is on main, merged here, and this diff changes only the heights.
  • File: .changeset/citation-grows-with-text.md — clear.
  • File: docs/specs/components/Citation/Citation.spec.md — clear.
  • File: packages/core/src/Citation/Citation.tsx — clear (one optional comment suggestion).
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts — clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 16:33
A superscript badge as tall as its line raised the line at large text sizes.
It now grows to its digits plus its padding on each side, which is its
spacing size at the default text size.
@cixzhang
cixzhang marked this pull request as draft November 20, 2026 17:41
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ab74572

@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.

Requesting changes: the number badge's new height changes its size at the default text size and fails the new browser test.

  • The badge's max(--spacing-5, calc(1em + 2 × --spacing-1)) height (Citation.tsx:155) makes it 21 px in Gothic, and on touch phones 21 px in Butter and Stone and 22 px in Neutral and Chocolate, at the default text size where main draws 20 px, so the changeset's "At the default text size each pill keeps its height" and the description's "at the default size that is also 20 px" are not true at this head.
  • The new growth test fails at this head in Chromium on Linux, where the number citation's text box sits 4 px above its 48 px badge (CitationTextSize.interaction.browser.spec.ts:92), because Storybook loads no theme font and the result depends on the runner's fallback font.

Keeping the badge at --spacing-5 when no text size is set, for example with the max(--spacing-5, 1lh) the label pill uses, fixes both; the label pill's growth meets the typography requirement and is ready. Extending the default-size test to Gothic and a touch-phone profile would keep this covered.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: the label and number pills grow with their text once it outgrows their 20 px height, instead of clipping the label — verified (Citation.tsx:91, :155; base and head probes with the text at 24 px and 40 px).
  • Claim: this covers iOS Dynamic Type accessibility sizes or a browser's larger text — verified for text that grows without its spacing; a browser's default font size scales the rem spacing too and already fit on main.
  • Claim: at the default text size each pill keeps its 20 px height, unchanged for everyone — false for the number badge in Gothic and, on touch phones, in Neutral, Chocolate, Butter and Stone (21 to 22 px); true for the label pill in every theme.
  • Claim: 58 px of label sat in a 20 px pill at the largest iOS size — not verifiable here (a device measurement) and not relied on.
  • Claim: the label pill uses the rule Button uses, and one default-size line is no taller than the pill — verified (Button.tsx:291-293; the default line lays out at 20 px).
  • Claim: the number badge grows with its own digits plus padding and is 20 px at the default size — the formula is verified (Citation.tsx:155); the 20 px is false in the five themes above.
  • Claim: the new spec checks 20 px in the Variants story and, with text at 40 px on a 60 px line, that each pill holds its text — verified as written (spec lines 70-95).
  • Claim: the growth case fails on main and passes here, and the default case passes in both — it fails on main and the default case passes in both (verified); the growth case also fails at this head, on the number citation.
  • Claim: the Citation record lists the typography spec and the new spec — verified (Citation.spec.md:16, :35).
  • Claim: a patch fix changeset — verified.
  • Claim: the quoted typography requirement — verified word for word.
  • Claim: the label's 15em maximum width and ellipsis are unchanged — verified (Citation.tsx:106, :112-117).
  • Claim: Citation and Markdown unit tests pass — verified (1506 of 1506 in the selection run at this head).
  • Claim: TypeScript, ESLint, the knowledge check and the changeset check are clean — verified for Core's build type-check, ESLint on the Citation folder and both checks.
  • Claim: WebKit runs in CI — not verifiable at this head; CI has not run on this draft.
  • Claim: desktop frames at 200% text show the label pill growing from 20 to 40 px with no clipped text, where main clips each label — verified.
  • Claim: the number badge's own-text height is re-checked at this head — the new growth test fails on it here.
  • Claim: one unrelated unit test failed once under load and passed on reruns — it passed at this head.
  • Claim: the other Citation fix, which centres the label on its line, is merged and kept here — verified (Citation.tsx:88).
  • File: .changeset/citation-grows-with-text.md — finding (the default-size claim).
  • File: docs/specs/components/Citation/Citation.spec.md — clear.
  • File: packages/core/src/Citation/Citation.tsx — finding at :155; non-blocking comment notes at :89-90 and :152-154.
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts — finding at :92.

Automated review (maintainer link)

Comment thread packages/core/src/Citation/Citation.tsx Resolved
Comment thread .changeset/citation-grows-with-text.md Resolved
With the font's own line height, the badge's 1lh is its digits' text box.
It stays at its spacing size at the default text size in every theme and on
every pointer, as on main, holds the text box in any font, and raises the line
less than the line's own leading would.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 274ac70

@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.

Requesting changes: the number badge's new line height fails Core's text-role leading test, while the growth fix itself works in every theme.

  • Citation.tsx:147 sets line-height: normal on the number badge style, which also sets --text-supporting-size, but textRoleLeading.test.ts does not name that style in OWN_LINE_HEIGHT, so the test fails on this head (it passes on main) and the typography spec's FR1 is not met; name the style there with its reason, or keep the supporting leading.

A shorter wording for the comment at Citation.tsx:152-154 is suggested inline (optional).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: the label and number pills grow with their text once it passes their 20 px height, instead of clipping it: verified (Citation.tsx:91, :155; browser probes at 24 px and 40 px text in every theme).
  • Claim: this covers iOS Dynamic Type accessibility sizes or a browser's larger text: verified for text that grows without its spacing (text-only zoom); no iOS device result is stated.
  • Claim: 58 px of label sat in a 20 px pill at the largest iOS size: not verifiable here (a device measurement) and not relied on.
  • Claim: at the default text size each pill keeps its 20 px height: verified in Core's default and all seven theme packages, on desktop and a touch phone, with and without the theme fonts (Matcha and Y2K stay 30 px, as on main).
  • Claim: the label pill uses the rule Button uses, and one default line is no taller than the pill: verified (Button.tsx:291-293; the default line lays out at 20 px).
  • Claim: the badge takes the font's own line height, about 1.2 to 1.4 em, stays 20 px by default, and at larger text holds its digits and raises its line less: verified; the measured range is 1.2 em to 1.5 em across the theme fonts.
  • Claim: the new browser test checks 20 px in the Variants story and that each pill holds its text at 40 px on a 60 px line: verified as written (lines 70-95).
  • Claim: the growth case fails on main and passes here, and the default case passes in both: verified.
  • Claim: the Citation record lists the typography spec and the new test: verified (Citation.spec.md:16, :35).
  • Claim: a patch fix changeset: verified.
  • Claim: the quoted typography requirement: verified word for word.
  • Claim: the label's 15em maximum width and ellipsis are unchanged: verified (Citation.tsx:106, :112-117).
  • Claim: Citation and Markdown unit tests pass: verified; the text-role leading test outside those folders fails (finding above).
  • Claim: TypeScript, ESLint, the knowledge check and the changeset check are clean: verified.
  • Claim: WebKit runs in CI: not verifiable, since CI has not run on this draft head.
  • Claim: desktop frames at text-only 200% show unchanged centring and the label growing from 20 to 40 px with no clipped text, where main clips each label: verified.
  • Claim: the badge is re-checked in all eight published themes, desktop and touch, at 100% and text-only 200%: verified across Core's default and the seven theme packages.
  • Claim: one unrelated unit test failed once under load: it passed on this head.
  • Claim: the earlier centring fix is kept: verified (Citation.tsx:88).
  • Changeset: the pills grow with their text past their 20 px height instead of clipping, and keep their height at the default text size: verified.
  • File: .changeset/citation-grows-with-text.md: clear.
  • File: docs/specs/components/Citation/Citation.spec.md: clear.
  • File: packages/core/src/Citation/Citation.tsx: finding at :147; comment suggestion at :152-154.
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Citation/Citation.tsx Resolved
Comment thread packages/core/src/Citation/Citation.tsx Resolved
…to 1.5em

A font's own line height moved the badge's baseline by up to 0.73 px at the
default text size. The badge now keeps the role's leading, so the default is
as on main, and caps its growth at 1.5em, which holds the text box.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ed308af

@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: test-node is red on this head for a reason outside this change, so CI needs a rerun before merge.

Both pill heights follow the typography spec's growth rule, the number badge keeps the supporting text's line height, and default-size rendering is unchanged in every theme, light and dark, on desktop and touch. test-node fails in packed-gather-cache.npm-packed.test.mjs, which fails on main too since Core 0.7.17 reached npm (#13136 fixes that test), and one shard stopped at its time limit in CLI tests this change does not touch; rerun CI on this head once that fix lands. The two optional suggestions from the earlier review (the badge comment's wording and the changeset's "a browser's larger text") still stand.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none
  • Claim: the label and number pills grow with their text past their 20 px height instead of clipping it: verified (Citation.tsx:91, :156; enlarged-text probes in Stone, Y2K and Neutral; the new spec passes).
  • Claim: this helps people using iOS Dynamic Type accessibility sizes or a browser's larger text: verified for text that grows without its spacing (simulated in Chromium); a desktop browser's larger default font size or zoom already grew both pills on main; no iOS device result is stated.
  • Claim: at the largest iOS size, 58 px of label sat in a 20 px pill: not verifiable here (a device measurement) and not relied on.
  • Claim: at the default text size each pill keeps its 20 px height: verified; 64 frames are pixel-identical to main (30 px in Matcha and Y2K, as on main).
  • Claim: the label pill uses the rule Button uses, and one default line is no taller than the pill: verified (Button.tsx:291-293; every default supporting line is 20 px or less).
  • Claim: the badge keeps its line height, so the default size lays out exactly as on main in every theme: verified (Citation.tsx:147; pixel-identical frames).
  • Claim: the badge grows to at most 1.5em, which holds the text box of common UI fonts, so it holds its digits and raises its line less than a line-tall badge: verified; the digit stays 0.6 to 3.7 px inside the badge in every enlarged probe, and the badge is never taller than its line.
  • Claim: the new browser test checks 20 px pills in the Variants story and that each pill holds its text at 40 px on a 60 px line: verified as written (lines 70-95).
  • Claim: the Citation record lists the typography spec and the new test: verified (Citation.spec.md:16, :35).
  • Claim: a patch fix changeset: verified.
  • Claim: the quoted typography requirement, and the unchanged 15em maximum width and ellipsis: verified (Citation.tsx:106, :114).
  • Claim: in real Chromium the growth case fails on main and passes here, and the default case passes in both: verified.
  • Claim: Citation and Markdown unit tests pass, and TypeScript, ESLint, the knowledge check and the changeset check are clean: verified (1519 tests pass with the text-role leading test; CI's typecheck and lint pass on this head; both checks pass at this head).
  • Claim: WebKit runs in CI: verified; the WebKit interaction job passed on this head.
  • Claim: frames with text enlarged alone show unchanged centring and the label growing past 20 px with no clipped text, where main clips each label: verified.
  • Claim: in all eight published themes, desktop and touch, light and dark, the default size is byte-identical to main in 64 cases, the sentence story included: verified (64 of 64 pixel-identical).
  • Claim: with text enlarged alone no text sits outside any pill or badge, and the badge raises its line no more than a full line-height badge: verified.
  • Claim: the tallest theme-font text box is 1.423em (Fustat), then Poppins 1.38em and Noto Sans 1.375em, all within the cap: Noto Sans measures 1.36em here, within the cap; the theme web fonts do not load here, so the Fustat and Poppins figures are not verifiable.
  • Claim: on Linux the text-size spec passes with Liberation Sans and with Noto Sans: verified with Noto Sans; Liberation Sans is not installed here.
  • Claim: one unrelated unit test failed once under load: the Citation unit tests pass on this head.
  • Claim: the earlier centring fix is kept: verified (Citation.tsx:88; that pull request is merged).
  • Claim: the record lines name files and tests in the present tense: verified (the record edit is two frontmatter list entries).
  • Changeset: the pills grow with their text past their 20 px height instead of clipping, and keep their height at the default text size: verified; the "browser's larger text" wording is the optional suggestion above.
  • File: .changeset/citation-grows-with-text.md: clear; optional wording suggestion at line 5.
  • File: docs/specs/components/Citation/Citation.spec.md: clear.
  • File: packages/core/src/Citation/Citation.tsx: clear; optional comment suggestion at lines 152-155.
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

Comment on lines +152 to +155
// Its spacing size at the default text size, where one line is shorter.
// A taller line grows the badge, but only to 1.5em, which holds the text
// box of common UI fonts (Noto Sans needs about 1.4em). A superscript
// badge as tall as the line raises the line more.

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.

Optional (comment style): the first sentence has no verb, and the second joins the growth and the reason for the cap. For example:

// The badge keeps its spacing size at the default text size.
// A taller line grows it, but only to 1.5em.
// 1.5em holds the text box of common UI fonts; Noto Sans needs about 1.4em.
// A badge as tall as the line raises a superscript line more.

'@astryxdesign/core': patch
---

[fix] A Citation's label and number pills grow with their text when the text size grows past their 20 px height (iOS Dynamic Type at its accessibility sizes, or a browser's larger text), instead of clipping the label. At the default text size each pill keeps its height.

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.

Optional (wording): on a desktop browser, a larger default font size or zoom also grows the rem spacing, so both pills already grew on main (frames at 200% and 300% are identical on main and this head). The clipping happened when text grew without its spacing, so "(iOS Dynamic Type at its accessibility sizes, or Android's system font scale)" would say who gains.

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 21:44

@rubyycheung rubyycheung 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.

Design approval for the citation text-sizing fix. Compared the exact base and PR head at normal and 200% text size, with spacing unchanged. The normal-size screenshots are pixel-identical; enlarged labels and numbers fit their growing pills instead of being clipped or overflowing. Verified in Neutral light.

@cixzhang
cixzhang marked this pull request as draft November 21, 2026 01:02
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Nov 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 7df19cb

@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: every CI check passes on this head.

Both pill heights follow the typography spec's rule that a control grows with its text, the number badge keeps the supporting text's line height, and default-size rendering is unchanged. The new browser spec passes in CI's Chromium and WebKit jobs on this head and fails on main. Two optional suggestions from the earlier review still stand: the wording of the badge comment in Citation.tsx (lines 152-155), and naming iOS Dynamic Type and Android's system font scale instead of "a browser's larger text" in the changeset.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none
  • Claim: the label and number pills grow with their text past their 20 px height instead of clipping it: verified (Citation.tsx:91, :156; enlarged-text frames and probes; the new spec passes in CI on this head).
  • Claim: this helps people using iOS Dynamic Type accessibility sizes or a browser's larger text: verified for text that grows without its spacing (simulated in Chromium); a desktop browser's larger default font size or zoom already grew both pills on main; no iOS device result is stated.
  • Claim: at the largest iOS size, 58 px of label sat in a 20 px pill: not verifiable here (a device measurement) and not relied on.
  • Claim: at the default text size each pill keeps its 20 px height: verified; default-size frames are pixel-identical to main (30 px in Matcha and Y2K, as on main), and CI's stable visual regression passes on this head.
  • Claim: the label pill uses the rule Button uses, and one default line is no taller than the pill: verified (Button.tsx:291-293; every default supporting line is 20 px or less).
  • Claim: the badge keeps its line height, so the default size lays out exactly as on main in every theme: verified (Citation.tsx:147; pixel-identical default frames).
  • Claim: the badge grows to at most 1.5em, which holds the text box of common UI fonts, so it holds its digits and raises its line less than a line-tall badge: verified; the digit stays inside the badge in every enlarged probe, and the badge is never taller than its line.
  • Claim: the new browser test checks 20 px pills in the Variants story and that each pill holds its text at 40 px on a 60 px line: verified as written (lines 70-95).
  • Claim: the Citation record lists the typography spec and the new test: verified (Citation.spec.md:16, :35).
  • Claim: a patch fix changeset: verified.
  • Claim: the quoted typography requirement, and the unchanged 15em maximum width and ellipsis: verified (Citation.tsx:106, :114).
  • Claim: in real Chromium the growth case fails on main and passes here, and the default case passes in both: verified (red-first run on main; CI's Chromium and WebKit interaction jobs pass on this head).
  • Claim: Citation and Markdown unit tests pass, and TypeScript, ESLint, the knowledge check and the changeset check are clean: verified; CI's unit, typecheck and lint jobs pass on this head.
  • Claim: WebKit runs in CI: verified; the WebKit interaction job passes on this head.
  • Claim: frames with text enlarged alone show unchanged centring and the label growing past 20 px with no clipped text, where main clips each label: verified.
  • Claim: in all eight published themes, desktop and touch, light and dark, the default size is identical to main in 64 cases, the sentence story included: verified (64 of 64 pixel-identical on the identical patch).
  • Claim: with text enlarged alone no text sits outside any pill or badge, and the badge raises its line no more than a full line-height badge: verified.
  • Claim: the tallest theme-font text box is 1.423em, then Poppins 1.38em and Noto Sans 1.375em, all within the cap: Noto Sans measures 1.36em, within the cap; the theme web fonts do not load in the review's browser, so the other figures are not verifiable.
  • Claim: on Linux the text-size spec passes with Liberation Sans and with Noto Sans: verified with Noto Sans; Liberation Sans was not available.
  • Claim: one unrelated unit test failed once under load: the Citation unit tests pass on the identical patch.
  • Claim: the earlier centring fix is kept: verified (Citation.tsx:88; that pull request is merged).
  • Claim: the record lines name files and tests in the present tense: verified (the record edit is two frontmatter list entries).
  • Changeset: the pills grow with their text past their 20 px height instead of clipping, and keep their height at the default text size: verified; the "browser's larger text" wording is the optional suggestion above.
  • File: .changeset/citation-grows-with-text.md: clear; optional wording suggestion at line 5.
  • File: docs/specs/components/Citation/Citation.spec.md: clear.
  • File: packages/core/src/Citation/Citation.tsx: clear; optional comment suggestion at lines 152-155.
  • File: packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 03:24
@cixzhang
cixzhang merged commit e10484a into main Nov 21, 2026
151 checks passed
cixzhang added a commit that referenced this pull request Nov 21, 2026
The main merge brought in packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts, which had no time; 1.7 s from #12461's pr-interaction leg (run 44860960331). Chromium now times 142 of 142.
cixzhang added a commit that referenced this pull request Nov 21, 2026
…ps unmeasured ones (#13193)

* ci: record Chromium times for every interaction spec; the refresh keeps unmeasured ones

main timed 127 of 141 interaction spec files (90.07%), on the playwright-legs test's 90% floor, so a pull request adding one spec failed it. The 14 missing times come from main's latest full Chromium runs (median), and for three specs newer than those runs, from their own pull requests' green runs. The weekly refresh's median now keeps the recorded time of a tracked spec its runs did not time instead of dropping it.

* ci: the interaction refresh reuses mergeRecord; MarksFitTheBox at the refresh's own median

The refresh keeps unmeasured tracked specs through scripts/lib/duration-split.mjs mergeRecord (now with an order option, so the record keeps its byte order), which also drops a file git no longer tracks when a run timed it. MarksFitTheBox is 3.3 s, the median medianTimes gives over its two full runs.

* Merge main into ci/interaction-durations-fill

* ci: record CitationTextSize's Chromium time from #12461's green leg

The main merge brought in packages/core/src/Citation/__tests__/CitationTextSize.interaction.browser.spec.ts, which had no time; 1.7 s from #12461's pr-interaction leg (run 44860960331). Chromium now times 142 of 142.

* Merge main into ci/interaction-durations-fill

Main recorded CitationTextSize at 1.0 s (#13238); keep main's time for it.
@github-actions
github-actions Bot deleted the fix/citation-grows-with-text branch November 22, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 7df19cbe Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants