Skip to content

fix(core): Table, Chat, CommandPalette and the date and time inputs carry only their own English - #9452

Merged
cixzhang merged 1 commit into
mainfrom
i18n-en-fallback-slices-2
Nov 2, 2026
Merged

cixzhang merged 1 commit into
mainfrom
i18n-en-fallback-slices-2

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Why (maintainer impact)

Follow-up to #9429, which moved most Core components onto per-module English fallback maps. Table, Chat, PowerSearch, CommandPalette and the date and time inputs still resolved their keys through the public useTranslator, so every component that renders one (including Markdown, which renders Table) still bundled the whole English catalog, about 7 KB gzip, and architecture:internationalization INV15 recorded that as a known conformance gap.

Intended invariant

Nothing anyone sees changes (INV3–INV5, INV15). Every key these components resolve today resolves to the same English in every locale's fallback path. PowerSearch operator labels keep the whole catalog, because a caller-defined operator may name any Astryx key in i18nKey.

What changed

  • The remaining 43 key-naming Core modules (Table and its plugins, Chat, PowerSearch, CommandPalette, DateInput, DateRangeInput, DateTimeInput, TimeInput) import and register their own generated map and use the internal useComponentTranslator; TouchDateTimeField reads the internal context module.
  • resolveOperatorLabel registers the whole catalog, and joins the public useTranslator and the public context export in the allowed full-catalog list.
  • The wiring check is strict again: every module that names keys registers its own map, and no Core module outside i18n/ imports the public useTranslator or the public InternationalizationContext export.
  • Record: removes INV15's conformance gap and names PowerSearch operator labels among the full-catalog paths in owning code.
  • Patch Changeset in plain words.

Size (import cost, gzip bytes)

Same method as the per-pull-request size report (.github/scripts/lib/component-size.js, measureComponentImport), base and head on the same main commit.

Component Before After Change
Table 91,953 84,417 −7,536
Markdown 153,845 146,074 −7,771
CommandPalette 56,280 48,823 −7,457
DateInput 108,250 100,368 −7,882
DateRangeInput 76,678 68,650 −8,028
DateTimeInput 120,181 112,729 −7,452
TimeInput 95,779 88,039 −7,740
PowerSearch 182,747 183,558 +811
  • After this change only PowerSearch bundles the whole catalog. Across both changes, 59 of the 60 components that carried it no longer do, a median 7,150 B gzip each.
  • PowerSearch grows 811 B here (2,195 B across both changes): it keeps the whole catalog and now also carries its own modules' maps.

Risk

  • A missed module would show raw keys; the strict check fails the build and the test setup, and the parity test covers every key every module names.
  • A Core module that later imports the public translator would silently bring back the whole catalog; the check now rejects that.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Resolution-parity test (packages/core/src/i18n/__tests__/englishFallback.test.ts): every key each of the 112 key-naming Core modules names, in all 31 shipped runtime catalogs, from its own map versus the whole catalog: identical.
  • scripts/i18n-english-fallback.test.mjs: strict wiring failures on fixtures (public hook or context import, missing map), and the import-cost check on the built package now also covering Table and DateInput.
  • UI tests for i18n, Table, Chat, PowerSearch, CommandPalette, DateInput, DateRangeInput, DateTimeInput and TimeInput (97 files, 2,349 tests), check:repo, Core typecheck, Core build, eslint on changed files (no errors).

CI impact

No workflow changes and no new jobs; the generator and tests are unchanged in cost.

Writing rubric results

R1 narration: none; the record edit removes the gap sentence and states the full-catalog paths in the present tense.
R2 research: none in the record.
R3 evidence: unchanged verification cells name tests and checks.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.

@vercel

vercel Bot commented Nov 2, 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 2, 2026 5:37am UTC

Request Review

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

astracat-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9efe454

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

The English-fallback wiring itself looks right: the remaining Table, Chat, CommandPalette and date and time input modules resolve through their own maps, the strict check and the parity test pass, and the record update matches. One change is needed before approval: the title says PowerSearch now carries only its own English, but PowerSearch still bundles the whole catalog, as the description and changeset say, and grows slightly. Please retitle, for example fix(core): Table, Chat, CommandPalette and the date and time inputs carry only their own English.

[Automated review]

@cixzhang
cixzhang force-pushed the i18n-en-fallback-slices-2 branch from 9efe454 to b2ce5ab Compare November 2, 2026 04:45
@cixzhang cixzhang changed the title fix(core): Table, Chat, PowerSearch, CommandPalette and the date and time inputs carry only their own English fix(core): Table, Chat, CommandPalette and the date and time inputs carry only their own English Nov 2, 2026
@cixzhang cixzhang closed this Nov 2, 2026
@cixzhang cixzhang reopened this Nov 2, 2026
@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec b2ce5ab

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d63585c

⏳ Building… Until it's ready, Storybook · Sandbox open the branch's previous preview.

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

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

This looks ready to merge: the remaining Table, Chat, CommandPalette and date and time input modules now resolve through their own English maps, the strict wiring check and the 31-locale parity test pass, and each affected component's import drops 7.1 to 8.0 KB gzip with no string change. The retitle resolves the earlier request, since PowerSearch still carries the whole catalog for caller-defined operator keys, as the changeset says. Nothing else is needed from you.

[Automated review]

…arry only their own English

The remaining Core modules that name catalog keys register their own derived
English map and use the internal translator. The wiring check is strict again:
every such module registers its own map, and no Core module imports the public
useTranslator or the public context export. PowerSearch operator labels keep
the whole catalog, since a custom operator may name any Astryx key, so
PowerSearch still bundles it.
@cixzhang
cixzhang force-pushed the i18n-en-fallback-slices-2 branch from b2ce5ab to d63585c Compare November 2, 2026 05:27
@cixzhang cixzhang closed this Nov 2, 2026
@cixzhang cixzhang reopened this Nov 2, 2026
@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec d63585c

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

This looks ready to merge: the remaining Table, Chat, CommandPalette and date and time input modules now resolve through their own English maps, and each affected import drops 7.2 to 8.1 KB gzip with no string change in any shipped locale. PowerSearch keeps the whole catalog for caller-defined operator keys, as the changeset says. Nothing else is needed from you.

[Automated review]

@cixzhang
cixzhang merged commit 16fe5f1 into main Nov 2, 2026
72 of 108 checks passed
@github-actions
github-actions Bot deleted the i18n-en-fallback-slices-2 branch November 2, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — d63585c4 Deployed Nov 2, 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