Skip to content

fix(Spinner): localize the default assistive label through the i18n catalog - #6217

Merged
cixzhang merged 2 commits into
meta:mainfrom
kyu-rong:fix/spinner-default-label-i18n
Sep 15, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
kyu-rong:fix/spinner-default-label-i18n

Conversation

@kyu-rong

Copy link
Copy Markdown
Contributor

Summary

Spinner supplied its default accessible name as the literal "Loading" in component source, so a localized app could not translate the status. It now resolves through the translation runtime as @astryx.spinner.loading, the same route Button takes for its loading announcement.

The name precedence is unchanged: an explicit aria-label wins, then a string label through aria-labelledby, then the localized default. The English default is still "Loading", so an app without translations sees no change.

Test Plan

  • pnpm test — two new cases: a non-English locale gets the translated label, and an explicit aria-label still wins; the first fails with the literal restored
  • pnpm check:i18n-catalog — 363 keys, 29 locales consistent
  • Internal <Spinner size="sm" /> call sites that rely on the default (Selector, ComplexSelector, TimeInput, Thumbnail) covered by their suites

Related Issues

Closes #6214

@vercel

vercel Bot commented Sep 10, 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 Sep 11, 2026 2:25pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 10, 2026
@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 labels Sep 10, 2026
@kyu-rong
kyu-rong marked this pull request as ready for review September 10, 2026 16:27
github-actions Bot added a commit that referenced this pull request Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Spinner (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 295 -
Complexity N/A High (25) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

Status: No visual change across 2 compared shot(s).


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

@astracat-bot

astracat-bot Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Sep 15, 2026, 4:14 AM UTC

# Conflicts:
#	packages/core/src/Spinner/Spinner.test.tsx

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

Localized applications now expose Spinner’s default assistive label through the active translation catalog while explicit labels keep precedence.

AST-009 release evidence for exact head 3ecbd9f523d624e221d556efd1c576a4982f82a4: merge evidence is complete. The first stable release containing this change remains blocked until these pending rows pass or receive a current owner exception:

  • NVDA + Chrome on Windows — pending
  • VoiceOver + Safari on macOS — pending

Scenario: render Spinner with the catalog-backed default and with explicit consumer labels, then verify the localized default status is announced and explicit labels remain unchanged.

github-actions Bot added a commit that referenced this pull request Sep 11, 2026
@kyu-rong

Copy link
Copy Markdown
Contributor Author

Thanks!

@cixzhang
cixzhang merged commit 5ca0362 into meta:main Sep 15, 2026
31 checks passed
AKnassa added a commit to AKnassa/astryx that referenced this pull request Sep 26, 2026
Addresses astracat-bot's review (CHANGES_REQUESTED, 2026-09-24) and the
two @astryx/no-hardcoded-i18n-string errors failing `lint`.

- F1: a single-value delimiter commit now announces
  t('@astryx.tokenizer.tokenAdded', {label}), the same message the
  Enter/click create path uses, instead of a hard-coded `Added ${label}`.
  `t` is added to commitDelimitedText's useCallback deps.
- F2: a batch commit announces the new ICU-plural catalog message
  @astryx.tokenizer.tokensAdded ("Added {count, number} {count, plural,
  one {item} other {items}}") instead of `Added ${n} items`. Only en.json
  gets the key (other locales fall back, per meta#6217/meta#6220). English output
  is unchanged, so the existing English announce tests stay green. The
  changeset mentions both keys.
- F3: TOKEN_MESSAGES.fr gains a tokensAdded override, and two tests
  render the delimiter path under <InternationalizationProvider
  locale="fr">: a typed "alice," and a pasted "a, b, c". Before the fix
  they failed with "expected 'Added alice' to be 'Ajouté : alice'" and
  "expected 'Added 3 items' to be '3 éléments ajoutés'"; both pass now.

Checks: Tokenizer/Typeahead/PowerSearch suites (14 files, 441 tests)
and the i18n suite pass; eslint (also ASTRYX_STRICT_LINT=1) is clean on
Tokenizer.tsx; core tsc, prettier, check:i18n-catalog,
check:changesets, check:sync and check:knowledge pass.

This branch was successfully deployed

1 active deployment
Preview — 3ecbd9f5 Deployed Sep 11, 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. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spinner: default assistive label bypasses the translation runtime

2 participants