Skip to content

[feat] i18n: PowerSearch migration (~50 strings, discriminated-union operator type) - #3922

Merged
nynexman4464 merged 1 commit into
mainfrom
nynexman4464/feat/i18n-powersearch
Jul 17, 2026
Merged

nynexman4464 merged 1 commit into
mainfrom
nynexman4464/feat/i18n-powersearch

Conversation

@nynexman4464

Copy link
Copy Markdown
Contributor

Stacked on #3765. Migrates PowerSearch — the biggest translation surface in @astryxdesign/core — through the i18n scaffold established there. Fully backward compatible: consumers who never render an InternationalizationProvider see today's English strings unchanged.

What's migrated

All ~50 hardcoded strings across PowerSearch and its sub-components:

  • UI chrome — Field, Operator, + Add filter, Remove filter, Delete, Cancel, Group operator, Apply (default for popoverSaveButtonLabel), plus the fallback Group.
  • Value-editor labels + placeholders — Value, Values, Time, Date, Relative date, Start date, End date, Entities, and their placeholders (Search…, Enter value…, Add values…, Enter number…, Select values…).
  • 21 built-in operator labels — contains, does not contain, starts with, ends with, is, is not, is greater than, is less than, is greater than or equal to, is between, is any of, is none of, and the true/false/equals/before/after variants.
  • ICU plurals — result count ({count, plural, one {result} other {results}}), overflow summaries for list-valued filters ({count} items, {count} entities), nested-filter summary ({count} filters), and the date range fallback.

All catalog keys use camelCase (see #3641 comment for the convention research and #3920 for the follow-up lint rule).

Public API change — PowerSearchOperator is now a discriminated union

type PowerSearchOperator =
  | { key: string; value: OperatorValue; label: string;    i18nKey?: never }  // raw text
  | { key: string; value: OperatorValue; i18nKey: string; label?: never   }  // catalog lookup

Two variants — exactly one of label or i18nKey is required. The type prevents the "forgot to set a label" footgun structurally: a bare {key, value} is now a compile error.

Backward compatible for existing consumers: {key: 'is_any_of', label: 'is any of', value: {...}} compiles unchanged. Consumers who want astryx's translated defaults can switch to the i18nKey variant:

{key: 'is_any_of', i18nKey: '@astryx.powersearch.operator.isAnyOf', value: {...}}

Astryx's own built-in operators (via usePowerSearchConfig) now use the i18nKey variant so they translate through the active locale. Consumers who pass their own custom operators keep working via the label variant.

Consumer-side data (informed the design)

Sub-agent research across ~275 astryx PowerSearch call-site files in Meta's internal codebase:

  • 75% never specify explicit operators — they rely on the defaults generated from FieldDefinition.type. These consumers pick up translated operator labels for free.
  • 25% pass explicit operators arrays. Of those, ~81% of labels are astryx-default lookalikes (label: 'is any of', label: 'contains') that would benefit from switching to i18nKey. The remaining ~19% are genuinely custom (label: 'in my rotations', label: 'has the phrase') — these keep working via the label variant.
  • Zero call sites were translating operator labels at the call site pre-migration. Clean-slate design.

Testing

  • 5 new e2e tests covering default operators, ICU plurals, pseudo-locale wrap, provider overrides, and consumer-provided-label passthrough.
  • All 300+ existing PowerSearch, PowerSearchEditPopover, and PowerSearchValueEditor tests pass unchanged — proves the migration is behavior-preserving.
  • Full core suite: 206 tests pass (PowerSearch + i18n + Pagination).
  • Full repo: 6,658/6,666 pass; 8 failures are the pre-existing parallel-pnpm build flake in build-css.test.mjs / build-theme.*.test.mjs / search.test.mjs (each passes in isolation, none touch PowerSearch or i18n).
  • Lint clean, check:repo all green.

Follow-ups filed

New exports

  • Types: PowerSearchOperatorBase, PowerSearchOperatorWithLabel, PowerSearchOperatorWithI18nKey
  • Runtime: resolveOperatorLabel(op, t) — used by consumers with custom token renderers via components.Token

Refs #3641, builds on #3765

@vercel

vercel Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 17, 2026 7:31pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 14, 2026
nynexman4464 added a commit that referenced this pull request Jul 14, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-scaffold branch from a79523b to 4731e75 Compare July 14, 2026 22:42
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from eb2f410 to 4121545 Compare July 14, 2026 22:56
nynexman4464 added a commit that referenced this pull request Jul 14, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
…iolations

Adds a new ESLint rule that flags any hardcoded user-facing string
literal on JSX attributes / object props / destructure defaults inside
packages/core/src whose prop name matches user-facing conventions:

  Exact:    label, placeholder, title, tooltip, text, summary, message,
            description, hint
  Suffix:   *Label, *Text, *Placeholder, *Title, *Message, *Tooltip,
            *Hint, *Description, *Summary
  All aria-* attributes (with a small exclude list).

The rule ignores tests, doc files, stories, and non-user-facing string
shapes (single lowercase word, SCREAMING_SNAKE, URLs, paths).

Configuration follows the plugin convention: 'error' in strict,
'warn' in recommended.

The rule immediately caught 33 hardcoded strings across 22 files that
my hand-inventory missed during PRs #3765/#3922/#3941 — good
validation. All fixed in this PR using the standard alias-and-resolve
pattern for prop defaults, and t() calls for JSX-attr and
config-property cases. 30 new catalog entries added.

Files migrated: Breadcrumbs, Chat (Composer, ComposerDrawer,
ComposerInput, useSpeechRecognition), CommandPalette (root, input,
list), ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector, Outline, PowerSearch (label,
placeholder, popoverSaveButtonLabel), Resizable/ResizeHandle,
Selector, SideNavHeading, Table/plugins/pagination/useTablePagination,
TimeInput, TopNavHeading, Typeahead.

Placeholders that used '...' (three ASCII dots) are now '…' (Unicode
ellipsis) in en.json — a small typography normalization.

Refs #3641, builds on #3941
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
…iolations

Adds a new ESLint rule that flags any hardcoded user-facing string
literal on JSX attributes / object props / destructure defaults inside
packages/core/src whose prop name matches user-facing conventions:

  Exact:    label, placeholder, title, tooltip, text, summary, message,
            description, hint
  Suffix:   *Label, *Text, *Placeholder, *Title, *Message, *Tooltip,
            *Hint, *Description, *Summary
  All aria-* attributes (with a small exclude list).

The rule ignores tests, doc files, stories, and non-user-facing string
shapes (single lowercase word, SCREAMING_SNAKE, URLs, paths).

Configuration follows the plugin convention: 'error' in strict,
'warn' in recommended.

The rule immediately caught 33 hardcoded strings across 22 files that
my hand-inventory missed during PRs #3765/#3922/#3941 — good
validation. All fixed in this PR using the standard alias-and-resolve
pattern for prop defaults, and t() calls for JSX-attr and
config-property cases. 30 new catalog entries added.

Files migrated: Breadcrumbs, Chat (Composer, ComposerDrawer,
ComposerInput, useSpeechRecognition), CommandPalette (root, input,
list), ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector, Outline, PowerSearch (label,
placeholder, popoverSaveButtonLabel), Resizable/ResizeHandle,
Selector, SideNavHeading, Table/plugins/pagination/useTablePagination,
TimeInput, TopNavHeading, Typeahead.

Placeholders that used '...' (three ASCII dots) are now '…' (Unicode
ellipsis) in en.json — a small typography normalization.

Refs #3641, builds on #3941
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
…iolations

Adds a new ESLint rule that flags any hardcoded user-facing string
literal on JSX attributes / object props / destructure defaults inside
packages/core/src whose prop name matches user-facing conventions:

  Exact:    label, placeholder, title, tooltip, text, summary, message,
            description, hint
  Suffix:   *Label, *Text, *Placeholder, *Title, *Message, *Tooltip,
            *Hint, *Description, *Summary
  All aria-* attributes (with a small exclude list).

The rule ignores tests, doc files, stories, and non-user-facing string
shapes (single lowercase word, SCREAMING_SNAKE, URLs, paths).

Configuration follows the plugin convention: 'error' in strict,
'warn' in recommended.

The rule immediately caught 33 hardcoded strings across 22 files that
my hand-inventory missed during PRs #3765/#3922/#3941 — good
validation. All fixed in this PR using the standard alias-and-resolve
pattern for prop defaults, and t() calls for JSX-attr and
config-property cases. 30 new catalog entries added.

Files migrated: Breadcrumbs, Chat (Composer, ComposerDrawer,
ComposerInput, useSpeechRecognition), CommandPalette (root, input,
list), ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector, Outline, PowerSearch (label,
placeholder, popoverSaveButtonLabel), Resizable/ResizeHandle,
Selector, SideNavHeading, Table/plugins/pagination/useTablePagination,
TimeInput, TopNavHeading, Typeahead.

Placeholders that used '...' (three ASCII dots) are now '…' (Unicode
ellipsis) in en.json — a small typography normalization.

Refs #3641, builds on #3941
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-scaffold branch from 4731e75 to 45cbbfc Compare July 15, 2026 18:19
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from 4121545 to 0a7243e Compare July 15, 2026 18:19
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@nynexman4464
nynexman4464 marked this pull request as ready for review July 15, 2026 18:35
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-scaffold branch from 45cbbfc to 856a36e Compare July 15, 2026 18:48
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from 0a7243e to 5c9488d Compare July 15, 2026 18:48
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 15, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-scaffold branch from 463bc41 to 8741710 Compare July 17, 2026 16:26
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from 47fab76 to d233a3c Compare July 17, 2026 16:26
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-scaffold branch from 8741710 to 43ebff5 Compare July 17, 2026 17:54
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from d233a3c to 923b9d6 Compare July 17, 2026 17:54
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@nynexman4464
nynexman4464 deleted the branch main July 17, 2026 18:02
@nynexman4464 nynexman4464 reopened this Jul 17, 2026
@nynexman4464
nynexman4464 changed the base branch from nynexman4464/feat/i18n-scaffold to main July 17, 2026 19:18
Migrates all ~50 hardcoded strings in PowerSearch through the i18n
scaffold from #3765:

- UI chrome: Field / Operator / Add filter / Remove filter / Delete /
  Cancel / Group operator / Apply, plus value-editor labels and
  placeholders (Value / Values / Time / Date / Search... / Enter
  number... / etc.)
- 21 built-in operator labels: contains / does not contain /
  starts with / is between / is any of / is none of / etc.
- ICU plurals for result counts and overflow summaries:
  {count, plural, one {result} other {results}},
  {count} items, {count} entities, {count} filters

Astryx default English wording is preserved verbatim — consumers who
never render an InternationalizationProvider see no visible change.

Type change (source-breaking, minor in practice): PowerSearchOperator
is now a discriminated union — {key, value, label} (raw text) OR
{key, value, i18nKey} (catalog lookup). Existing consumers with
label: 'is any of' compile unchanged. New i18nKey variant lets
consumers opt into astryx's translated defaults or their own catalog
entries. A bare {key, value} is now a compile error, closing the
'forgot to set a label' footgun.

Consumer report on 274 fbsource files showed:
- 75% use zero explicit operators (get translations for free)
- 25% pass explicit operators; of those, ~81% of labels are
  astryx-default lookalikes ('is any of', 'contains', ...) that
  can migrate to i18nKey for free translation
- ~19% are genuinely custom labels ('in my rotations', 'has the
  phrase', ...) — those keep working via the label variant.

Refs #3641, builds on #3765
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/i18n-powersearch branch from 923b9d6 to 78ca3d8 Compare July 17, 2026 19:27
github-actions Bot added a commit that referenced this pull request Jul 17, 2026
@github-actions

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.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: No accessibility violations detected.


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

@nynexman4464
nynexman4464 merged commit 3813843 into main Jul 17, 2026
19 checks passed
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Third wave of the core i18n migration, following the scaffold in #3765
and the PowerSearch migration in #3922. Migrates all remaining ~55
hardcoded user-facing strings across 27 components through
useTranslator().

Components: AlertDialog, AppShell, AvatarGroup, Banner, Calendar,
Carousel, Chat (ChatMessageMetadata + ChatPastedTextToken),
CheckboxList, CommandPalette, DateRangeInput, DateTimeInput, Dialog,
DropdownMenu, Lightbox, Markdown, MobileNav, MultiSelector, Popover,
Selector, SideNav, TabList, Table (BaseTable, filtering, selection,
sortable plugins), Toast (Toast + ToastViewport), Tokenizer, TopNav,
TreeList, Typeahead.

Prop defaults with translated fallbacks use the alias-and-resolve
pattern (`label: labelFromProps` in the destructure, then
`const label = labelFromProps ?? t('@astryx.foo.label')` in the body).

Notes:
- DropdownMenu.button is now truly optional and defaults to
  `t('@astryx.dropdownMenu.label')` for its aria-label.
- ChatMessageMetadata uses `i18nKey` on its STATUS_CONFIG map and
  resolves at render (pattern established by PowerSearch operators).
- Markdown.renderBlock takes `t: TranslatorFn` as a parameter,
  threaded through from the top-level Markdown component.
- TreeList switched from `[aria-label='Toggle children']` querySelector
  to `[data-tree-toggle]` for row activation, since the aria-label is
  now locale-dependent.

58 new catalog entries added to packages/core/locales/en.json, all
camelCase per the convention agreed in #3641.

Zero visible changes for consumers who don't render an
InternationalizationProvider.

Refs #3641, builds on #3765 + #3922
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
nynexman4464 added a commit that referenced this pull request Jul 17, 2026
…r() (#4011)

Completes the string coverage for the i18n scaffold work in the #3641
series. 30 new catalog entries added to packages/core/locales/en.json.
The lint rule that caught these violations lands in a separate PR.

Files migrated: Breadcrumbs, Chat (Composer/ComposerDrawer/
ComposerInput/useSpeechRecognition), CommandPalette (root/input/list),
ContextMenu, DateInput, DateRangeInput, DateTimeInput, Link,
MobileNavToggle, MoreMenu, MultiSelector (trigger placeholder),
Outline, PowerSearch (label/placeholder/apply defaults that #3922
missed), Resizable/ResizeHandle, Selector (trigger placeholder),
SideNavHeading (nav-menu dialog), Table pagination plugin, TimeInput,
TopNavHeading (nav-menu dialog), Typeahead.

Placeholders that used '...' (three ASCII dots) are normalized to '…'
(Unicode ellipsis) in the shipped en.json catalog — a small
typography normalization consistent with existing ellipsis characters
in previously-migrated strings.

Refs #3641, builds on #3941
@github-actions
github-actions Bot deleted the nynexman4464/feat/i18n-powersearch branch July 18, 2026 06:42

This branch was successfully deployed

1 active deployment
Preview — 78ca3d84 Deployed Jul 17, 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