Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-05-22 - Accessibility Pattern: Icon Buttons
**Learning:** This application uses emojis and SVGs as icon-only buttons (e.g., in HangarList). These were previously inaccessible to screen readers as they lacked `aria-label` or accessible names.
**Action:** When working on UI components, specifically check for emoji-based or SVG-based buttons and ensure they have descriptive `aria-label` attributes.
17 changes: 15 additions & 2 deletions components/HangarList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,20 @@ export default function HangarList({
{plane.model}
</span>
<div className="flex gap-1">
<button onClick={(e) => { e.stopPropagation(); onEdit(e, plane); }} className="p-1.5 text-slate-400 hover:text-blue-600 hover:bg-blue-50 rounded-md transition-colors">✏️</button>
<button onClick={(e) => { e.stopPropagation(); onDelete(e, plane.id); }} className="p-1.5 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors">🗑️</button>
<button
onClick={(e) => { e.stopPropagation(); onEdit(e, plane); }}
className="p-1.5 text-slate-400 hover:text-blue-600 hover:bg-blue-50 rounded-md transition-colors"
aria-label={`Edit ${plane.registration}`}
>
✏️
</button>
<button
onClick={(e) => { e.stopPropagation(); onDelete(e, plane.id); }}
className="p-1.5 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors"
aria-label={`Delete ${plane.registration}`}
>
🗑️
</button>
</div>
</div>
<h3 className="text-2xl font-black text-slate-900 dark:text-white tracking-tight">{plane.registration}</h3>
Expand Down Expand Up @@ -119,6 +131,7 @@ export default function HangarList({
onAddToFleet(template);
}}
title="Add to My Hangar"
aria-label={`Add ${template.model} to My Hangar`}
className="w-8 h-8 flex items-center justify-center rounded-full bg-slate-50 dark:bg-slate-700 text-slate-400 hover:text-blue-600 hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-all active:scale-95"
>
<svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand Down