Skip to content

fix(core): five components' assembled built-in text follows the locale - #13132

Merged
nynexman4464 merged 2 commits into
mainfrom
nynexman4464/fix/core-assembled-text-i18n
Nov 21, 2026
Merged

nynexman4464 merged 2 commits into
mainfrom
nynexman4464/fix/core-assembled-text-i18n

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Five Core components build part of their built-in text in code, with English punctuation, word order or number format. No translation or override can change it:

  • ProgressBar: the default value text and aria-valuetext read 45% in every locale. Turkish writes %45, and French and German write 45 %.
  • Thumbnail: a thumbnail with both label and alt is named {label} — {alt}, a fixed join.
  • DateRangeInput: the trigger's accessible name is {label}: {value}, and the selected range is {start} – {end}.
  • Slider: a range slider's text value reads {start} – {end}.
  • MultiSelector: with triggerDisplay="labels", the trigger joins the shown labels with a literal , and adds , +{n}; with "badges", it adds a literal +{n}.

Problem and solution fit

  • Why lint missed them: no-hardcoded-i18n-string skips literal chunks that are only punctuation or spaces, and ProgressBar's helper name (defaultFormatValueLabel) is not one of the helper names it checks. An audit of packages/core/src and packages/richtext/src found these sites.
  • Why it matters: architecture:internationalization INV1a (Astryx-owned text is one catalog message, so a locale can reorder and re-punctuate it) and INV8 (locale-sensitive formatting goes through the shared helpers with the provider locale). component:ProgressBar FR3 and component:Thumbnail FR3 already record these two as implementation gaps.
  • The fix:
    • ProgressBar, through a formatter, not the catalog: the default value text is formatPercent(rounded, locale), a new export of the shared number module NumberInput/numberParser.ts (Intl.NumberFormat percent style, whole numbers). A percentage is a number format, like Timer's units, so no catalog string is added, and ProgressBar loads no message parser: a ProgressBar-only page grows 213 bytes gzip. A first version of this change used a catalog message; pnpm size:pages measured that page at +10,320 bytes, because ProgressBar then loads the translator and its parser. The @default JSDoc and component:ProgressBar FR3 say so.
    • Thumbnail, DateRangeInput, Slider and MultiSelector, through the catalog: five new keys, each with a translator description. @astryx.thumbnail.nameWithAlt is {label} — {alt}. @astryx.dateRangeInput.triggerLabel is {label}: {value} and @astryx.dateRangeInput.rangeValue is {start} – {end}. @astryx.slider.rangeValue is {start} – {end}. @astryx.multiSelector.overflowCount is +{count, number}, used after the badges and as the last item of the labels list.
    • MultiSelector's list: the shown labels join through useListFormatter, the provider locale's narrow conjunction list, with the overflow count as the list's last item. That is "Apple, Banana, Orange, +2" in English, as before, and "Apple, Banana, Orange und +2" in German, so the conjunction never lands between the shown labels.

Expected behavior and authority

  • component:ProgressBar FR3: this PR replaces "Astryx-owned value text comes from one catalog message (INV1a). Implementation gap: …" with "The default text is the rounded percentage as the provider locale writes it (45% in English, %45 in Turkish), through the shared number formatter (INV8)". It also removes the matching Current-state impact bullet, the governance line that pointed at the gap, and the verification row's "no test checks the default text in a non-English locale" gap, which the new tr test closes; Governing rules add INV8. These record edits need an engineering owner's /approve-spec.
  • component:Thumbnail FR3 already says "A joined name is one catalog message (INV1a)". This PR removes its implementation gap and the matching Current-state impact bullet.
  • DateRangeInput, Slider and MultiSelector records name no format for these strings. INV1a governs them.

Smallest restoration

  • No API, prop, layout or interaction change. ProgressBar's formatValueLabel default now follows the provider locale (FR3), so its @default tag reads "the rounded percentage in the provider locale (45% in English)". formatPercent is internal.
  • English output is unchanged, with one exception: a MultiSelector overflow of 1,000 or more reads +1,000 (the catalog's {count, number}), in both the labels and badges displays.
  • Shipped locales show English for the five new keys until translators add them, as for any new key. ProgressBar's percentage follows the provider locale at once, because it needs no catalog string.

Evidence

  • Reproduction before the change, and result after it: nine new tests fail on main and pass with the change.
    • ProgressBar under tr: reads %45 as its text and its aria-valuetext.
    • Thumbnail under ja, with an override {alt}({label}): named 表紙(file.png).
    • DateRangeInput under ja, with an override {value}({label}): the trigger is named 日付を選択(期間). Under de with an override {start} bis {end}, the selected range reads … bis ….
    • Slider under fr, with an override de {start} à {end}: reads de 20 à 80.
    • MultiSelector under de: reads Apple, Banana und Orange; with five selected and an override {count} weitere, the labels display reads Apple, Banana, Orange und 2 weitere and the badges display reads 3 weitere after its badges.
    • formatPercent: numberParser.test.ts pins 0%, 45%, 100%, %45 (tr) and 45 % (de).
  • Representative unchanged path: every existing English test in the five suites passes, including ProgressBar's 75%, Thumbnail's file.png — Clickable, DateRangeInput's Range: … name, and the MultiSelector labels and formatValue cases.

First-load size (architecture:component-import-boundaries INV10)

NumberInput/numberParser.ts gains an export that a second folder imports. pnpm size:pages, gzip bytes, against this branch's merge base with main (7dfa428218); against a newer main the Thumbnail and MultiSelector rows read a few bytes more:

Page (components) Base Head Change
docs (Text, Heading, Link, Card, Divider, List) 77,106 77,106 +0
form (Button, IconButton, TextInput, CheckboxInput, Text, Heading, Card) 107,781 107,781 +0
menu (DropdownMenu, ContextMenu, Button, Text) 111,841 111,841 +0
table (Table, Text, Button) 123,678 123,678 +0
ProgressBar alone 8,303 8,516 +213
NumberInput alone 103,138 103,138 +0
Thumbnail alone 68,368 68,372 +4
MultiSelector alone 105,372 105,510 +138

Not changed here

The audit found three more kinds of hard-coded text in Core, beyond the sites this PR fixes. They need an owner decision first, so they're not in this PR:

  • NumberInput's resting value is String(value), and the visible input posts it as the form value (component:NumberInput FR6). A locale decimal mark would change what a form submits.
  • Slider's number text is String(value). A shared plain-number helper (locale digits, no grouping, no rounding) would serve it and NumberInput together.
  • PowerSearch's typeahead rows (Title contains "partner") are built in English word order, and typed text is matched against that order.

Scope

Components: ProgressBar (value text; record FR3), Thumbnail (joined name; record gap), DateRangeInput (trigger name), Slider (range text value), MultiSelector (labels display), NumberInput (numberParser.ts gains formatPercent)

  • One defect is restored: built-in text assembled outside the catalog and the locale's number format.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

Record edits: component:ProgressBar FR3 and its Current-state impact; component:Thumbnail FR3 and its Current-state impact.

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: none.
  • R5 pull request or issue references: none.
  • R6 ruled open questions still listing options: none.
  • R7 project status: none.

Testing

  • vitest --project ui on the ProgressBar, Thumbnail, DateRangeInput, Slider, MultiSelector and NumberInput suites and the ESLint plugin: 40 files, 1,101 tests pass. vitest --project node on scripts/shared-identity.test.mjs and the swizzle proof samples: pass.
  • tsc --noEmit (core): clean.
  • CI=true eslint (strict) on every changed file: no findings.
  • node scripts/generate-i18n-runtime.mjs (English fallback maps and their wiring checks), node scripts/check-i18n-catalog.mjs, pnpm check:knowledge and check:changesets: pass.
  • pnpm size:pages: table above.
  • no-comment-provenance.baseline.mjs --check: up to date.
  • Local CI (lint, typecheck) at this head (before a changeset wording edit): pass. The heavy suites wait for review, as on GitHub; the suites listed above ran locally.

@vercel

vercel Bot commented Nov 20, 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 2:18am UTC

Request Review

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

astracat-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5a64a29

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ProgressBar · Storybook 12.3 kB (+214 B) · 6.7 kB CSS (0) 579 (+1) — · — · —
MultiSelector · Storybook 107.9 kB (+100 B) · 18.7 kB CSS (0) 2,768 (+7) — · — · —
PowerSearch 317.1 kB (+88 B) · 27.1 kB CSS (0) — — · — · —
17 more components
Component Size LoC Visual · A11y · RTL
lab/VideoPlayer 230.0 kB (+71 B) · 2.1 kB CSS (0) — — · — · —
lab/AudioPlayer 232.5 kB (+68 B) · 1.8 kB CSS (0) — — · — · —
lab/Comments 387.3 kB (+67 B) · 2.5 kB CSS (0) — — · — · —
lab/MediaPlaybackRate 222.4 kB (+67 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaPlayButton 222.4 kB (+67 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaCaptionsButton 222.4 kB (+66 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaFullscreenButton 222.4 kB (+66 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaSeekButton 222.4 kB (+66 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaVolume 222.4 kB (+66 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTime 222.4 kB (+65 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTimeSlider 222.4 kB (+65 B) · 1.5 kB CSS (0) — — · — · —
lab/CommentThread 380.2 kB (+61 B) · 2.4 kB CSS (0) — — · — · —
DateRangeInput · Storybook 105.1 kB (+48 B) · 13.9 kB CSS (0) 704 (+6) — · — · —
Thumbnail · Storybook 71.9 kB (+31 B) · 12.7 kB CSS (0) 370 (0) — · — · —
Slider · Storybook 116.0 kB (+22 B) · 9.2 kB CSS (0) 2,467 (+3) — · — · —
NumberInput · Storybook 105.7 kB (0) · 12.8 kB CSS (0) 1,482 (+6) — · — · —
Pagination 152.2 kB (0) · 19.8 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 7.90 MB packed (+1.2 kB); no new dependencies.

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

1 API change (advisory)
Package Where Signature Usage
~ core . · Components · component ProgressBar prop formatValueLabel?: (value: number, max: number) => string = (value, max) => `${Math.round((value / max) * 100)}%` → prop formatValueLabel?: (value: number, max: number) => string = the rounded percentage in the provider locale (`45%` in English) <ProgressBar formatValueLabel={…} />

Wide change (6 components): 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.

Approval waits on an engineering owner's spec decision for ProgressBar, and two fixes are needed whatever that decision is.

Owner decision: the current ProgressBar record (FR3) says its value text comes from one catalog message. This pull request instead writes the percentage with the locale's number formatter and rewrites FR3 to match, which also makes the formatValueLabel default locale-dependent (%45 in Turkish). An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

Blocking:

  • MultiSelector's labels overflow joins the three shown labels as a complete list and then appends the count, so a German trigger reads "Apple, Banana und Orange, +2" (13 other shipped locales likewise) and no translation of labelsOverflow can fix it; make the count the list's last item, formatList([...displayed, t('@astryx.multiSelector.labelsOverflow', {count: remaining})]) with +{count, number}, which keeps English at "Apple, Banana, Orange, +2".
  • The description says shipped locales show English for "the four new keys", but packages/core/locales/en.json adds six.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the five sites built their text in code on the base: verified in each base source file.
  • Claim: lint missed them (punctuation-only chunks skipped, helper name unchecked): verified in the hardcoded-string rule.
  • Claim: ProgressBar and Thumbnail records listed these as gaps: verified.
  • Claim: ProgressBar's default text follows the provider locale (%45 tr, 45 % de): verified by the formatter test, the ProgressBar test and a browser probe.
  • Claim: Thumbnail, DateRangeInput, Slider and MultiSelector strings each come from one catalog message: verified by eight tests that fail on the base.
  • Claim: a locale can reorder or re-punctuate them: false for MultiSelector's labels overflow (see above).
  • Claim: MultiSelector joins labels with the locale's list format, English unchanged: verified.
  • Claim: English output is unchanged except a grouped overflow of 1,000 or more: verified.
  • Claim: six keys with translator descriptions: verified; "four new keys" later in the description is false.
  • Claim: formatPercent is internal and needs an explicit locale: verified.
  • Claim: reference-page and ProgressBar size deltas: verified; the Thumbnail and MultiSelector rows measure +23 B and +175 B, not +4 B and +136 B.
  • Claim: tests, type check, catalog, knowledge, changeset and strict lint checks pass: verified for the touched suites and those checks; the comment-baseline and swizzle checks were not rerun.
  • .changeset/core-assembled-text-catalog.md: overflow re-punctuation claim false.
  • docs/specs/components/ProgressBar/ProgressBar.spec.md: awaiting owner decision.
  • docs/specs/components/Thumbnail/Thumbnail.spec.md: clear.
  • internal/eslint-plugin-astryx/no-raw-intl-locale.js: clear.
  • packages/core/locales/en.json: labelsOverflow needs reshaping with the overflow fix.
  • packages/core/src/DateRangeInput/DateRangeInput.tsx and its test: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx: misplaced conjunction in the labels overflow.
  • packages/core/src/MultiSelector/MultiSelector.test.tsx: the overflow test passes with the doubled conjunction.
  • packages/core/src/NumberInput/numberParser.ts and its test: clear.
  • packages/core/src/ProgressBar/ProgressBar.tsx and its test: awaiting owner decision.
  • packages/core/src/Slider/Slider.tsx and its test: clear.
  • packages/core/src/Thumbnail/Thumbnail.tsx and its test: 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.

Approval waits on an engineering owner's spec decision for ProgressBar; the two fixes the last review asked for are in, and nothing else blocks.

Owner decision: the current ProgressBar record (FR3) says its value text comes from one catalog message, while this pull request writes the percentage with the locale's number formatter and rewrites FR3 to match, which also makes the formatValueLabel default locale-dependent (%45 in Turkish). An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

  • Non-blocking: the size table's Thumbnail and MultiSelector rows measure +23 B and +152 B gzip against the base this pull request targets, not +4 B and +138 B.
Claims and files checked

Review mode: incremental; reason: none

  • Claim: the five sites built their text in code on the base: verified in each base source file.
  • Claim: lint missed them (punctuation-only chunks skipped, helper name unchecked): verified in the hardcoded-string rule.
  • Claim: the ProgressBar and Thumbnail records listed these sites as gaps: verified.
  • Claim: ProgressBar's default text follows the provider locale (%45 in Turkish, 45 % in German): verified by the formatter test, the ProgressBar test and a browser probe.
  • Claim: the Thumbnail, DateRangeInput, Slider and MultiSelector strings each come from one catalog message a locale can reword: verified by tests that fail on the base.
  • Claim: MultiSelector lists the overflow count last with the locale's list format (Apple, Banana, Orange, +2 in English, Apple, Banana, Orange und +2 in German): verified by the tests, a browser probe and a check over every shipped locale.
  • Claim: English output is unchanged except a grouped overflow of 1,000 or more: verified.
  • Claim: five new keys, each with a translator description, shown in English in shipped locales until translated: verified.
  • Claim: formatPercent is internal: verified.
  • Claim: the four reference pages are unchanged and a ProgressBar-only page grows 213 B: verified (menu +1 B and table +3 B gzip with identical minified output); the Thumbnail and MultiSelector rows differ, as above.
  • Claim: the touched suites, type check, catalog, runtime-map, changeset and strict lint checks pass: verified, with the knowledge and comment-baseline checks; the swizzle proof was not rerun at this head.
  • .changeset/core-assembled-text-catalog.md: clear.
  • docs/specs/components/ProgressBar/ProgressBar.spec.md: awaiting owner decision.
  • docs/specs/components/Thumbnail/Thumbnail.spec.md: clear.
  • internal/eslint-plugin-astryx/no-raw-intl-locale.js: clear.
  • packages/core/locales/en.json: clear.
  • packages/core/src/DateRangeInput/DateRangeInput.tsx and its test: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx and its test: clear.
  • packages/core/src/NumberInput/numberParser.ts and its test: clear.
  • packages/core/src/ProgressBar/ProgressBar.tsx and its test: awaiting owner decision.
  • packages/core/src/Slider/Slider.tsx and its test: clear.
  • packages/core/src/Thumbnail/Thumbnail.tsx and its test: clear.

Automated review (maintainer link)

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 137e08d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 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: an engineering owner approved the ProgressBar record change for this head, so the value-text decision is settled, and no other finding blocks.

CI has not run on this head yet, because the pull request is still a draft; marking it ready for review starts CI, and the merge waits for it.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: the five sites built their text in code, with English punctuation or number format, on the base: verified in each base source file.
  • Claim: lint missed them because punctuation-only chunks are skipped and ProgressBar's helper name is unchecked: verified in the hard-coded-string lint rule.
  • Claim: the ProgressBar and Thumbnail records listed these sites as implementation gaps: verified.
  • Claim: ProgressBar's default text and aria-valuetext are the rounded percentage in the provider locale (%45 in Turkish, 45 % in German) through the shared number module, with no catalog message: verified by the formatter test, the ProgressBar test and a browser probe.
  • Claim: the ProgressBar record edit needs an engineering owner's spec approval: given for this head.
  • Claim: the Thumbnail, DateRangeInput, Slider and MultiSelector strings each come from one catalog message that a locale can reword: verified by tests that fail on the base and pass here.
  • Claim: MultiSelector lists the overflow count last with the locale's list format (Apple, Banana, Orange, +2 in English, Apple, Banana, Orange und +2 in German): verified by the tests, a browser probe and a check over every shipped locale.
  • Claim: English output is unchanged except a MultiSelector overflow of 1,000 or more, which groups its digits: verified.
  • Claim: five new keys, each with a translator description, show English in shipped locales until translated: verified.
  • Claim: no API, prop, layout or interaction change beyond the formatValueLabel default, and formatPercent is internal: verified.
  • Claim: the size table against the branch's merge base (four reference pages +0, ProgressBar +213 B, Thumbnail +4 B, MultiSelector +138 B gzip), with a few bytes more against a newer base: verified by re-measuring.
  • Claim: nine new tests fail on the base and pass with the change: verified.
  • Claim: the touched suites, type check, strict lint, catalog, runtime-map, knowledge, changeset and comment-baseline checks pass: verified.
  • Claim: the shared-identity and swizzle-sample tests pass: verified.
  • Changeset: verified against the code.
  • .changeset/core-assembled-text-catalog.md: clear.
  • docs/specs/components/ProgressBar/ProgressBar.spec.md: clear (owner-approved).
  • docs/specs/components/Thumbnail/Thumbnail.spec.md: clear.
  • internal/eslint-plugin-astryx/no-raw-intl-locale.js: clear.
  • packages/core/locales/en.json: clear.
  • packages/core/src/DateRangeInput/DateRangeInput.tsx and its test: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx and its test: clear.
  • packages/core/src/NumberInput/numberParser.ts and its test: clear.
  • packages/core/src/ProgressBar/ProgressBar.tsx and its test: clear.
  • packages/core/src/Slider/Slider.tsx and its test: clear.
  • packages/core/src/Thumbnail/Thumbnail.tsx and its test: clear.

Automated review (maintainer link)

@nynexman4464
nynexman4464 marked this pull request as ready for review November 21, 2026 00:40
@nynexman4464
nynexman4464 marked this pull request as draft November 21, 2026 02:08
@nynexman4464
nynexman4464 force-pushed the nynexman4464/fix/core-assembled-text-i18n branch from 137e08d to 5a64a29 Compare November 21, 2026 02:08
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 5a64a29

@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: an engineering owner approved the ProgressBar record change for this head, so the value-text decision is settled, and no other finding blocks.

CI is still running on this head; the merge waits for its required checks to pass.

Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: the five sites built their text in code, with English punctuation or number format, on the base: verified in each base source file.
  • Claim: lint missed them because punctuation-only chunks are skipped and ProgressBar's helper name is unchecked: verified in the hard-coded-string lint rule.
  • Claim: the ProgressBar and Thumbnail records listed these sites as implementation gaps: verified.
  • Claim: ProgressBar's default text and aria-valuetext are the rounded percentage in the provider locale (%45 in Turkish, 45 % in German) through the shared number module, with no catalog message: verified by the formatter test, the ProgressBar test and a browser probe.
  • Claim: the ProgressBar record edit needs an engineering owner's spec approval: given for this head.
  • Claim: the Thumbnail, DateRangeInput, Slider and MultiSelector strings each come from one catalog message that a locale can reword: verified by tests that fail on the base and pass with the change.
  • Claim: MultiSelector lists the overflow count last with the locale's list format (Apple, Banana, Orange, +2 in English, Apple, Banana, Orange und +2 in German): verified by the tests, a browser probe and a check over every shipped locale.
  • Claim: English output is unchanged except a MultiSelector overflow of 1,000 or more, which groups its digits: verified.
  • Claim: five new keys, each with a translator description, show English in shipped locales until translated: verified.
  • Claim: no API, prop, layout or interaction change beyond the formatValueLabel default, and formatPercent is internal: verified.
  • Claim: the size table, measured against the base commit it names (four reference pages +0, ProgressBar +213 B, Thumbnail +4 B, MultiSelector +138 B gzip), with a few bytes more against a newer base: verified against that commit; the branch has since been rebased, which changed none of its files.
  • Claim: nine new tests fail on the base and pass with the change: verified.
  • Claim: the touched suites, type check, strict lint, catalog, runtime-map, knowledge, changeset and comment-baseline checks pass: verified.
  • Claim: the shared-identity and swizzle-sample tests pass: verified: the change adds no module-scope symbol, registry or context, the only things those tests scan for.
  • Changeset: verified against the code.
  • .changeset/core-assembled-text-catalog.md: clear.
  • docs/specs/components/ProgressBar/ProgressBar.spec.md: clear (owner-approved).
  • docs/specs/components/Thumbnail/Thumbnail.spec.md: clear.
  • internal/eslint-plugin-astryx/no-raw-intl-locale.js: clear.
  • packages/core/locales/en.json: clear.
  • packages/core/src/DateRangeInput/DateRangeInput.tsx and its test: clear.
  • packages/core/src/MultiSelector/MultiSelector.tsx and its test: clear.
  • packages/core/src/NumberInput/numberParser.ts and its test: clear.
  • packages/core/src/ProgressBar/ProgressBar.tsx and its test: clear.
  • packages/core/src/Slider/Slider.tsx and its test: clear.
  • packages/core/src/Thumbnail/Thumbnail.tsx and its test: clear.

Automated review (maintainer link)

@nynexman4464
nynexman4464 marked this pull request as ready for review November 21, 2026 02:29
@nynexman4464
nynexman4464 merged commit 35bda7f into main Nov 21, 2026
295 of 303 checks passed
cixzhang added a commit that referenced this pull request Nov 21, 2026
main's #13132 writes a range's text value through the
@astryx.slider.rangeValue catalog message. The reserve now counts that
message with both values at the longest length, plus one ch, instead of a
fixed ' – ' join; in English the floor is unchanged. A test reserves a
French range through an overridden message.
@github-actions
github-actions Bot deleted the nynexman4464/fix/core-assembled-text-i18n branch November 21, 2026 06:04
cixzhang added a commit that referenced this pull request Nov 22, 2026
…umeric track keeps its length (#12496)

* fix(Slider): a text value keeps the track's length while the value changes

With valueDisplay="text", the value text sat beside the track and changed
width with each value (90 to 100 lost the track 8 px), so a dragged thumb
moved out from under the pointer. Hidden copies of the text at the ends of
the range now hold the box at its widest, with tabular figures.

* fix(Slider): the text value also reserves the values one step in, and keys copies uniquely

A fractional step's first value (0.1 next to 0 and 1) was wider than both
ends, so the track still shrank there. The hidden copies now cover the
values at and one step in from each end, deduplicated so equal texts
(min equal to max) share one key, and are built only for a text value
display. The changeset says a mid-range-widest formatValue still widens
the box.

* Merge main; the Slider text reserves its width in CSS, with snapped end values

The hidden copies of the value text are gone (component-style-authoring
INV7: no hidden twin to reserve space). The one text element takes a
min-inline-size reserved per character of the widest end text: a tabular
digit at 0.6em, a space at 0.3em, anything else at 1em. The values one
step in from each end are snapped and clamped like a reached value, so a
0-to-0.8 slider reserves 0.7, not 0.7000000000000001.

* fix(Slider): the text value reserves digits and spaces in ch

A digit at 0.6em fell short in fonts with wider digits (Figtree 0.625em,
DejaVu Sans 0.636em, monospace with 0.602em spaces), so the track could
still change length. A tabular digit or a space now counts as 1ch, the
width of the font's own zero, plus 1px for a text run's rounding. The
reserve takes the most ch and the most em any end text needs. Browser
cases under monospace and DejaVu Sans keep the range's track at one
length.

* docs(Slider): the stable-track claim names fonts with tabular figures

In a font whose digits are neither tabular nor no wider than its zero
(Poppins in Y2K), the track can still shift by a pixel or two; the
changeset, comment and description now say so.

* chore(changeset): credit AKnassa's earlier Slider track fix

#4050 reserved the text value's width in characters, end-aligned, with no
hidden copy, for the ends and their neighbours; this pull request arrived
at the same shape.

Co-authored-by: AKnassa <[email protected]>

* chore(changeset): one contributor handle per line

Co-authored-by: AKnassa <[email protected]>

* Merge branch 'main' into l0/slider-text-value-stable-track

Conflict: Slider.tsx's text-value style, where main added the label line
height and this branch tabular figures; both kept.

* Merge branch 'main' into l0/slider-text-value-stable-track

* fix(Slider): a text value pads only its missing digits when the text around them is the same

Counting each non-digit character as 1em over-reserved: a unit such as
"°F" took 2em of blank space and a word value took far more than its
width. When every end text has the same characters around its digits, the
box now pads the current text by the digits it lacks, in ch, so it is
exactly as wide as the widest end text. Word values reserve nothing, as on
main. Texts whose non-digit characters differ keep the estimate. The
browser proof compares track widths to a quarter pixel, since layout rounds
a text run to 1/64 px.

* fix(Slider): a text value reserves its width only when its two ends differ in shape

The digit pad assumed a tabular digit is 1ch wide, which several theme
fonts break, and it put the text display over INV10's 307 B first-load
limit. The box now reserves the wider end with a floor (1ch per digit or
space, 1em per other character, plus 1px) only when the two ends show
digits and differ in shape. Ends of the same shape (60°F and 90°F) and
words reserve nothing, so they keep main's width. The value text turns
kerning off, so a digit pair keeps its width. A Slider page grows 307 B
gzip without the feature (size:pages --page slider=Slider,Text).

* Merge branch 'main' into l0/slider-text-value-stable-track

* fix(Slider): the text value's box has a ch floor from its longer end value

Following the records decision on track stability, the box takes a floor of
one ch per character of the longer end text, plus one, with the text at its
end, so the track keeps one length across values and during a drag in every
bundled theme font. A resting track shorter than main's is the accepted
cost. tabular-nums and kerning none are dropped: tabular-nums widened the
space and period in some theme fonts. The browser proof now runs the
default font and each bundled theme's body font, loaded from the theme
packages. A Slider page grows 176 B gzip without the feature.

* fix(Slider): the text value's floor counts the longest text any step shows

Following the track-stability decision's bar (one track length across
every value), the floor now takes the longest formatted text among every
step value, memoized on the range, the step and formatValue. Above 200
steps it counts the ends and the values one step in from them; the Slider
record names that residual. Opacity (a fractional step whose inner values
are wider than its ends) and Rating (a word scale whose widest word is
mid-range) join the per-font track-stability cases. A Slider page grows
256 B gzip without the feature.

* docs(Slider): the release note and the style comment state the floor rule that ships

The floor counts the longest text any step value shows (every value up to
200 steps; above that, the ends and the values one step in), so the
changeset and the style comment no longer describe the end-value rule.

* docs(Slider): the release note says which value texts keep one track length

The floor counts characters, so characters much wider than a digit (stars,
capital letters) can outgrow it by a few pixels; the release note says so.

* docs(Slider): FR3's known gap names the wide-glyph residual

The floor counts characters, so value text whose characters are much wider
than a digit may move the track; the record now says so, as the release
note does.

* docs(Slider): the release note gives the wide-glyph figure

* fix(Slider): the floor counts max as End shows it, off the step grid too

End shows max itself, which can lie off the step grid (min 0, max 10.25,
step 1), so the floor counts format(max) beside the snapped step values.
A unit test asserts the floor for that slider (6ch for "10.25").

* Merge branch 'main' into l0/slider-text-value-stable-track

main's #13132 writes a range's text value through the
@astryx.slider.rangeValue catalog message. The reserve now counts that
message with both values at the longest length, plus one ch, instead of a
fixed ' – ' join; in English the floor is unchanged. A test reserves a
French range through an overridden message.

* Merge branch 'main' into l0/slider-text-value-stable-track

This branch was successfully deployed

1 active deployment
Preview — 5a64a29a 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.

1 participant