Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
})
)
);
Expand All @@ -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`,
})
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
})
)
);
Expand All @@ -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`,
})
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<StyledAttachment
Expand Down Expand Up @@ -201,12 +203,12 @@ export const Attachment = React.memo(
iconSize={token.Icon.IconS}
iconName="close"
tooltip={_(
msg({ id: 'autopilot-chat.common.attachments.remove-file', message: `Remove file` })
msg({ id: 'autopilot-chat.common.attachments.remove-file', message: `Remove` })
)}
ariaLabel={_(
msg({
id: 'autopilot-chat.common.attachments.remove-file-name',
message: `Remove ${attachment.name}`,
message: `Remove ${name}`,
})
)}
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ const ResourceChipBaseInner: React.FC<ResourceChipBaseProps> = ({
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}`,
})
)}
Expand Down
Loading