Skip to content

Commit bee3a52

Browse files
Add ARIA labels and title attributes to icon buttons in ConfigTable
Co-authored-by: jmbish04 <26469722+jmbish04@users.noreply.github.com>
1 parent 86dd04f commit bee3a52

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.Jules/palette.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
## 2024-03-24 - Accessibility for Icon-Only Buttons
3+
**Learning:** Found that multiple components (like ConfigTable) use icon-only buttons (`<Button size="icon">`) without providing `aria-label` or `title` attributes, making them inaccessible to screen readers and difficult to identify for sighted users who rely on tooltips.
4+
**Action:** When adding or reviewing icon-only buttons, always ensure they include an `aria-label` attribute for screen reader accessibility and a `title` attribute for hover tooltips.

src/frontend/src/components/config/ConfigTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ export function ConfigTable({ data, fields, onSave }: ConfigTableProps) {
132132
<TableCell className="text-right">
133133
{isEditing ? (
134134
<div className="flex justify-end gap-2">
135-
<Button size="icon" variant="ghost" onClick={() => handleSave(field.key, field.type)} disabled={isSaving}>
135+
<Button size="icon" variant="ghost" onClick={() => handleSave(field.key, field.type)} disabled={isSaving} aria-label="Save" title="Save">
136136
<Check className="h-4 w-4 text-green-500" />
137137
</Button>
138-
<Button size="icon" variant="ghost" onClick={handleCancel} disabled={isSaving}>
138+
<Button size="icon" variant="ghost" onClick={handleCancel} disabled={isSaving} aria-label="Cancel" title="Cancel">
139139
<X className="h-4 w-4 text-red-500" />
140140
</Button>
141141
</div>
142142
) : (
143-
<Button size="icon" variant="ghost" onClick={() => handleEdit(field.key, currentValue)}>
143+
<Button size="icon" variant="ghost" onClick={() => handleEdit(field.key, currentValue)} aria-label="Edit" title="Edit">
144144
<Pencil className="h-4 w-4" />
145145
</Button>
146146
)}

0 commit comments

Comments
 (0)