Skip to content

Commit b06885a

Browse files
authored
🗑️ a11y: Add Accessible Name to Button for File Attachment Removal (danny-avila#6709)
1 parent 69f2ac6 commit b06885a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

client/src/components/Chat/Input/Files/RemoveFile.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
import { useLocalize } from '~/hooks';
2+
13
export default function RemoveFile({ onRemove }: { onRemove: () => void }) {
4+
const localize = useLocalize();
25
return (
36
<button
47
type="button"
58
className="absolute right-1 top-1 -translate-y-1/2 translate-x-1/2 rounded-full bg-surface-secondary p-0.5 transition-colors duration-200 hover:bg-surface-primary"
69
onClick={onRemove}
10+
aria-label={localize('com_ui_attach_remove')}
711
>
8-
<span>
12+
<span aria-hidden="true">
913
<svg
1014
stroke="currentColor"
1115
fill="none"

client/src/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@
509509
"com_ui_attach_error_openai": "Cannot attach Assistant files to other endpoints",
510510
"com_ui_attach_error_size": "File size limit exceeded for endpoint:",
511511
"com_ui_attach_error_type": "Unsupported file type for endpoint:",
512+
"com_ui_attach_remove": "Remove file",
512513
"com_ui_attach_warn_endpoint": "Non-Assistant files may be ignored without a compatible tool",
513514
"com_ui_attachment": "Attachment",
514515
"com_ui_auth_type": "Auth Type",

0 commit comments

Comments
 (0)