From 17fe5c4af889561ee37647d0adf66058c25b1499 Mon Sep 17 00:00:00 2001 From: Roxana Mocanu Date: Thu, 22 Oct 2026 21:47:42 +0300 Subject: [PATCH] fix(apollo-react): align chat message defaults with the catalog so lingui 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 --- .../src/chat/headless/hooks/use-attachment-intake.ts | 4 ++-- .../src/chat/headless/providers/attachments-provider.tsx | 6 ++++-- .../components/ap-chat/components/common/attachments.tsx | 6 ++++-- .../components/input/tiptap/resource-chip-node-view.tsx | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/apollo-react/src/chat/headless/hooks/use-attachment-intake.ts b/packages/apollo-react/src/chat/headless/hooks/use-attachment-intake.ts index 030ca8f63..bd7cba6b1 100644 --- a/packages/apollo-react/src/chat/headless/hooks/use-attachment-intake.ts +++ b/packages/apollo-react/src/chat/headless/hooks/use-attachment-intake.ts @@ -124,7 +124,7 @@ export function useAttachmentIntake() { _( msg({ id: 'autopilot-chat.error.multiple-files', - message: `Only one file can be attached at a time`, + message: `Only one file can be attached per message`, }) ) ); @@ -137,7 +137,7 @@ export function useAttachmentIntake() { _( msg({ id: 'autopilot-chat.error.too-many-files', - message: `Maximum ${maxCount} files allowed`, + message: `Too many files. ${maxCount} files are allowed per message`, }) ) ); diff --git a/packages/apollo-react/src/chat/headless/providers/attachments-provider.tsx b/packages/apollo-react/src/chat/headless/providers/attachments-provider.tsx index 9f78fa6a0..d31f047ba 100644 --- a/packages/apollo-react/src/chat/headless/providers/attachments-provider.tsx +++ b/packages/apollo-react/src/chat/headless/providers/attachments-provider.tsx @@ -101,11 +101,13 @@ export function AutopilotAttachmentsProvider({ children }: { children: React.Rea const totalCount = filesToAdd.length; if (allowedAttachments.maxCount && totalCount > allowedAttachments.maxCount) { + // Named `maxCount` to match the catalog's placeholder. + const maxCount = allowedAttachments.maxCount; setError( _( msg({ id: 'autopilot-chat.error.too-many-files', - message: `Maximum ${allowedAttachments.maxCount} files allowed`, + message: `Too many files. ${maxCount} files are allowed per message`, }) ) ); @@ -118,7 +120,7 @@ export function AutopilotAttachmentsProvider({ children }: { children: React.Rea _( msg({ id: 'autopilot-chat.error.multiple-files', - message: `Only one file is allowed`, + message: `Only one file can be attached per message`, }) ) ); diff --git a/packages/apollo-react/src/material/components/ap-chat/components/common/attachments.tsx b/packages/apollo-react/src/material/components/ap-chat/components/common/attachments.tsx index 77a3b474e..8b1e6a80b 100644 --- a/packages/apollo-react/src/material/components/ap-chat/components/common/attachments.tsx +++ b/packages/apollo-react/src/material/components/ap-chat/components/common/attachments.tsx @@ -171,6 +171,8 @@ export const Attachment = React.memo( return [IconComp, fileType]; }, [attachment]); + // Named `name` to match the catalog's placeholder. + const name = attachment.name; return ( { diff --git a/packages/apollo-react/src/material/components/ap-chat/components/input/tiptap/resource-chip-node-view.tsx b/packages/apollo-react/src/material/components/ap-chat/components/input/tiptap/resource-chip-node-view.tsx index b71a400b4..1c551f918 100644 --- a/packages/apollo-react/src/material/components/ap-chat/components/input/tiptap/resource-chip-node-view.tsx +++ b/packages/apollo-react/src/material/components/ap-chat/components/input/tiptap/resource-chip-node-view.tsx @@ -119,13 +119,13 @@ const ResourceChipBaseInner: React.FC = ({ iconName="close" tooltip={_( msg({ - id: 'autopilot-chat.common.attachments.remove-file', + id: 'autopilot-chat.input.resource-chip.remove', message: 'Remove', }) )} ariaLabel={_( msg({ - id: 'autopilot-chat.common.attachments.remove-file-name', + id: 'autopilot-chat.input.resource-chip.remove-name', message: `Remove ${label}`, }) )}