Skip to content

Commit 7c6e07d

Browse files
feat: add ARIA labels to inline action buttons in ConfigTable
Added `aria-label` and `title` attributes to the Check, X, and Pencil icon buttons in ConfigTable.tsx to improve screen reader accessibility and provide helpful tooltips for sighted users. Also recorded a journal entry in .Jules/palette.md about the importance of labeling icon-only inline actions. Co-authored-by: jmbish04 <26469722+jmbish04@users.noreply.github.com>
1 parent 86dd04f commit 7c6e07d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.Jules/palette.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 2024-05-21 - Accessible Inline Data Table Actions
2+
**Learning:** Icon-only buttons used for inline row actions in data tables (like edit, save, cancel) are completely invisible to screen readers without ARIA labels, and confusing to sighted users without tooltips. This is especially problematic in dense tables where context isn't obvious.
3+
**Action:** Always ensure any icon-only button, regardless of its placement inside complex components like tables, includes both an `aria-label` and `title` attribute explaining its function.

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 configuration" title="Save configuration">
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 editing" title="Cancel editing">
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 configuration" title="Edit configuration">
144144
<Pencil className="h-4 w-4" />
145145
</Button>
146146
)}

0 commit comments

Comments
 (0)