🗑️ a11y: Add Accessible Name to Button for File Attachment Removal (#6709)

This commit is contained in:
Kay Belardinelli 2025-04-03 15:45:10 -04:00 committed by GitHub
parent c4f1da26b3
commit 95ecd05046
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -1,11 +1,15 @@
import { useLocalize } from '~/hooks';
export default function RemoveFile({ onRemove }: { onRemove: () => void }) {
const localize = useLocalize();
return (
<button
type="button"
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"
onClick={onRemove}
aria-label={localize('com_ui_attach_remove')}
>
<span>
<span aria-hidden="true">
<svg
stroke="currentColor"
fill="none"

View file

@ -509,6 +509,7 @@
"com_ui_attach_error_openai": "Cannot attach Assistant files to other endpoints",
"com_ui_attach_error_size": "File size limit exceeded for endpoint:",
"com_ui_attach_error_type": "Unsupported file type for endpoint:",
"com_ui_attach_remove": "Remove file",
"com_ui_attach_warn_endpoint": "Non-Assistant files may be ignored without a compatible tool",
"com_ui_attachment": "Attachment",
"com_ui_auth_type": "Auth Type",