Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

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

Kay Belardinelli95ecd05046d9
diff --git a/client/src/components/Chat/Input/Files/RemoveFile.tsx b/client/src/components/Chat/Input/Files/RemoveFile.tsx
index a3c76a910f..bb83b6a135 100644
--- a/client/src/components/Chat/Input/Files/RemoveFile.tsx
+++ b/client/src/components/Chat/Input/Files/RemoveFile.tsx
@@ -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"
diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json
index 89af9f4a40..13635d453c 100644
--- a/client/src/locales/en/translation.json
+++ b/client/src/locales/en/translation.json
@@ -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",