Skip to content

fix(Slider): range thumb names come from the catalog - #9023

Merged
cixzhang merged 3 commits into
mainfrom
fix/slider-thumb-names-i18n
Oct 31, 2026
Merged

cixzhang merged 3 commits into
mainfrom
fix/slider-thumb-names-i18n

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Part of #8955 (Slider). TimeInput and TextArea follow as separate PRs; the Table resize handle is fixed in its own PR.

User impact

Screen-reader users of a range Slider (two thumbs) in a non-English app hear each thumb named "Minimum value" or "Maximum value" in English, mixed into otherwise translated speech, for example "Prix, Minimum value, 20".

Problem and solution fit

  • Why English? The two thumb names were string literals in Slider.tsx, not catalog messages.
  • Why does that harm the task? The name is how a screen-reader user tells which thumb they're moving.
  • Why does that matter? Astryx-owned assistive text must follow the app's locale like its visible text.

The fix resolves both names through the catalog.

Expected behavior and authority

architecture:internationalization (current) INV1a: every Astryx-owned visible or assistive string, including aria-* values, MUST be an en.json key resolved by the canonical translator.

Smallest restoration

  • Slider.tsx: the range thumb names come from t('@astryx.slider.minimumThumb') and t('@astryx.slider.maximumThumb').
  • locales/en.json: those two keys, same English text, with translator descriptions. Other locales fall back to English until the translation sync (check:i18n-catalog passes).
  • No API, visual, or English text change.

Evidence

  • Reproduction before the change: "translates the range thumb names under another locale" fails on main.
  • Result after the change: it passes.
  • Representative unchanged path: the English names and single-thumb naming tests pass unchanged; the Slider suite passes (103).
  • Regression test: Slider.test.tsx "translates the range thumb names under another locale".

Scope

  • One defect is restored.
  • 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.

Testing

pnpm vitest run packages/core/src/Slider; node scripts/check-i18n-catalog.mjs; node scripts/generate-i18n-runtime.mjs --check.

The range thumbs' accessible names were English literals. Resolve them through
@astryx.slider.minimumThumb and @astryx.slider.maximumThumb
(architecture:internationalization INV1a).
@vercel

vercel Bot commented Oct 30, 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 Oct 31, 2026 3:57am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Slider (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 389B 389B 0B
Lines of Code 987 989 -
Complexity Very High Very High (149) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/Slider 49.3KB 49.3KB +34B 8.7KB 8.7KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 35.8KB 35.8KB 0B

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot

astracat-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 31, 2026, 4:08 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Slider change itself looks right: the range thumb names now come from the catalog, and the new French-override test fails before the change and passes after it. One fix is needed before merge: the changeset has no [fix] tag and no contributor credit, so pnpm check:changesets fails, and the required Lint check will fail once this leaves draft. Start the changeset body with [fix] and add your @handle on its own line, or regenerate it with pnpm changeset:new.

[Automated review]

Comment thread .changeset/slider-thumb-names-i18n.md Outdated
'@astryxdesign/core': patch
---

Slider: a range slider's thumb names ("Minimum value" and "Maximum value", announced to screen readers) now come from the message catalog (`@astryx.slider.minimumThumb`, `@astryx.slider.maximumThumb`), so they follow the app's locale.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This body needs a [fix] tag at the start and a contributor credit on its own line (spec:AST-017 FR7). Without them pnpm check:changesets fails on this file, and the required Lint check will fail once the pull request leaves draft. For example:

[fix] Slider: a range slider's thumb names ("Minimum value" and "Maximum value", announced to screen readers) now come from the message catalog (`@astryx.slider.minimumThumb`, `@astryx.slider.maximumThumb`), so they follow the app's locale.

@your-handle

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks ready to approve: range Slider thumb names now come from the catalog, and the new French-override test fails before the change and passes after it. The changeset now carries the [fix] tag and your credit. CI's required checks will run once the pull request leaves draft.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 02:51
…s-i18n

# Conflicts:
#	packages/core/src/Slider/Slider.tsx

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks ready to approve: range Slider thumb names now come from the catalog, and the new French-override test fails before the change and passes after it. One optional cleanup: both strings now live in the catalog, so 'Minimum value' and 'Maximum value' can come out of the Slider entry in the no-hardcoded-i18n-string allowlist in eslint.config.js, letting lint catch them if they ever return.

[Automated review]

@cixzhang
cixzhang merged commit ec128c4 into main Oct 31, 2026
64 checks passed

This branch was successfully deployed

1 active deployment
Preview — 4b360ae4 Deployed Oct 31, 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