Repository navigation
fix(Spinner): localize the default assistive label through the i18n catalog - #6217
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsSpinner (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
AI review status for this pull request.
|
# Conflicts: # packages/core/src/Spinner/Spinner.test.tsx
There was a problem hiding this comment.
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.
|
Thanks! |
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.
Summary
Spinnersupplied 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 routeButtontakes for its loading announcement.The name precedence is unchanged: an explicit
aria-labelwins, then a stringlabelthrougharia-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 explicitaria-labelstill wins; the first fails with the literal restoredpnpm check:i18n-catalog— 363 keys, 29 locales consistent<Spinner size="sm" />call sites that rely on the default (Selector, ComplexSelector, TimeInput, Thumbnail) covered by their suitesRelated Issues
Closes #6214