Repository navigation
fix(apollo-react): align chat message defaults with the catalog so lingui extract runs - #1452
roxana-mocanu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped translation changes match the existing catalog, with no unresolved blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes chat message-default conflicts that block Lingui extraction in apollo-react, aligning code with existing translations without changing catalog files.
Changes:
- Align attachment-limit error defaults across the intake hook and provider.
- Match attachment placeholders to the catalog’s named placeholders.
- Switch resource chips to their existing, dedicated translation IDs.
| File | Description |
|---|---|
packages/apollo-react/src/material/components/ap-chat/components/input/tiptap/resource-chip-node-view.tsx |
Uses resource-chip translation IDs for removal labels. |
packages/apollo-react/src/material/components/ap-chat/components/common/attachments.tsx |
Aligns removal text and the name placeholder with the catalog. |
packages/apollo-react/src/chat/headless/providers/attachments-provider.tsx |
Aligns attachment-limit messages and the maxCount placeholder. |
packages/apollo-react/src/chat/headless/hooks/use-attachment-intake.ts |
Matches intake error defaults to catalog wording. |
Review effort: Balanced
Dependency License Review
License distribution
Excluded packages
|
📊 Coverage + size by packagePer-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
"Coverage" is each package's own |
Storybook visual diffBaseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs Updated (PT): Oct 23, 2026, 12:58:08 AM |
…ngui extract runs lingui extract failed because four chat ids carried different default messages in different files. Align the code defaults for multiple-files, too-many-files, remove-file and remove-file-name with en.json, keep the catalog's placeholder names, and point the editor's resource chip at its own resource-chip ids, which en.json and every locale already define. No catalog changes; users already see the catalog text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e6799f7 to
17fe5c4
Compare
Why
lingui extractfails on main for the chat catalog:Lingui requires every use of an id to carry the same default message. Four chat ids
did not: the same id was written with different English in different files, and in
one case a component used another feature's ids. Each mismatch alone stops extraction,
and Lingui reports only the first one, so this PR fixes all four at once.
Nothing is broken for users today. The chat always renders inside its I18nProvider,
so every locale (English included) reads the catalog value and never the code
default. The defaults only drifted apart over successive refactors, and with no
extraction run to compare them, nothing flagged it.
What changed
Code defaults now match the catalog. No catalog file changes.
en.json)autopilot-chat.error.multiple-filesautopilot-chat.error.too-many-filesautopilot-chat.common.attachments.remove-fileautopilot-chat.common.attachments.remove-file-namemultiple-filesandtoo-many-filesare raised bytwo layers of the same check (the composer's intake hook, then the attachments
provider) and shown in the same error banner, so they keep one id each.
attachment ids, although
autopilot-chat.input.resource-chip.removeand...remove-namewere added toen.jsonalongside it and are already translated inevery locale. It now uses them, so the attachment ids only serve file chips. Its
tooltip and screen-reader label keep the same text in every locale except one
(see Localization impact).
variable in the template literal (
${allowedAttachments.maxCount}becomes{0}),so a local
constkeeps it as{maxCount}/{name}, ascomposer-strings.tsalready does.
Localization impact
The TMS only receives
en.json, so each id was translated once, from the catalogtext. The other English variants in code never reached localization, and nothing
signalled that they existed:
can be attached at a time" were not shown in any language, English included. Anyone
reading the code saw one text while users saw another.
every locale but never displayed. The chip showed the file chip's translations
instead. Those match in 11 locales. In Romanian they differ, so with this PR the
resource chip tooltip changes from "Înlăturare" (the file wording) to "Eliminare",
its intended translation.
No user saw wrong text, but English had two sources of truth, translation effort
went to strings that never shipped, and the extraction run that would have caught
the mismatch had been failing.
Wording choices
Where code and catalog disagreed, the catalog text was kept, since it is what users
already see and what is translated. It is also the clearest of the variants:
"per message" states the actual limit and points to the fix (remove the attached file
or send first). "At a time" suggested another file could be added afterwards, which
the intake check rejects when the draft already holds one.
Checks
pnpm run i18n:extractcompletes. Its catalog rewrite (key reordering, and emptyplaceholders for keys not yet translated) is left out of this PR, since locale
files are owned by the l10n sync.
vitest --run src/chat src/material/components/ap-chat: 435 of 436 tests passed.One scroll test in
message-list-scroll.test.tsxfailed once during the full run andpasses on its own, with and without this change. Two test files that import the
built package (
@uipath/apollo-react/ap-chat) need a local build to run.Follow-ups
autopilot-chat.tool-call.json.item-countand...key-countare ICU plurals, whichthe TMS cannot parse. Same fix as fix(apollo-react): replace ICU plurals in canvas counts with count-neutral labels #1451, in a separate PR.
🤖 Generated with Claude Code