diff --git a/components/email/__tests__/conversation-reading.test.tsx b/components/email/__tests__/conversation-reading.test.tsx index 8d65ebe61..df3e86ca6 100644 --- a/components/email/__tests__/conversation-reading.test.tsx +++ b/components/email/__tests__/conversation-reading.test.tsx @@ -67,7 +67,7 @@ describe('conversation controls name their target', () => { hasAttachment: true, attachments: [{ partId: '2', blobId: 'blob2', name: 'report.pdf', type: 'application/pdf', size: 2048 }], })]); - expect(screen.getByRole('button', { name: /^email_viewer\.(download|preview)_named \{"name":"report\.pdf"\}$/ })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: /^(email_viewer\.download|files\.preview) report\.pdf/ })).toBeInTheDocument(); }); }); diff --git a/components/email/thread-conversation-view.tsx b/components/email/thread-conversation-view.tsx index f3ed998d9..cfaed8831 100644 --- a/components/email/thread-conversation-view.tsx +++ b/components/email/thread-conversation-view.tsx @@ -1013,10 +1013,12 @@ export function ConversationEmailBody({ onDownloadAttachment?.(attachment.blobId, attachment.name || 'attachment', attachment.type, source); }} title={opensPreview ? t('files.preview') : t('email_viewer.download')} - aria-label={t(opensPreview ? 'email_viewer.preview_named' : 'email_viewer.download_named', { name: attachment.name ? stripBidiControls(attachment.name) : 'Attachment' })} className="flex items-center gap-2 px-3 py-2 rounded-lg bg-muted hover:bg-muted/80 transition-colors text-sm" > + {/* The action, for screen readers: the visible name alone + doesn't say whether the button previews or downloads. */} + {opensPreview ? t('files.preview') : t('email_viewer.download')}{' '} {attachment.name ? stripBidiControls(attachment.name) : 'Attachment'} {formatFileSize(attachment.size)}