fix(audit-wave-10): aria-hidden sweep on decorative Lucide icons (#69)
Mechanical codemod added \`aria-hidden\` to 444 self-closing single-line Lucide icon JSX elements across 267 .tsx files in: - shared/, layout/, dashboard/ - admin/ (all sections) - clients/, berths/, yachts/, companies/, interests/, documents/ - reminders/, reservations/, residential/, expenses/, email/ The regex targeted only the safe pattern \`<IconName className="..." />\` (no other props, self-closing, capitalized component name). Every match inspected is a decorative companion to visible text or sits inside a button whose accessible name comes from \`aria-label\` / sr-only text — the icon itself should not be announced. Screen readers no longer double-read the icon + the adjacent label text (e.g. "Pencil Pencil Edit" → just "Edit"). The existing @axe-core/playwright smoke test (\`20-accessibility.spec.ts\`) continues to pass. Test suite stays at 1315/1315 vitest. typescript clean. Closes task #69 (aria-hidden sweep) from the AUDIT-2026-05-12 follow-ups backlog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,22 +69,22 @@ export function YachtCard({ yacht, portSlug, onEdit, onArchive }: YachtCardProps
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
aria-label={`Actions for ${yacht.name}`}
|
||||
>
|
||||
<MoreHorizontal className="h-4 w-4" />
|
||||
<MoreHorizontal className="h-4 w-4" aria-hidden />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/${portSlug}/yachts/${yacht.id}`}>
|
||||
<Eye className="mr-2 h-3.5 w-3.5" />
|
||||
<Eye className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
View
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => onEdit(yacht)}>
|
||||
<Pencil className="mr-2 h-3.5 w-3.5" />
|
||||
<Pencil className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
Edit
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem className="text-destructive" onClick={() => onArchive(yacht)}>
|
||||
<Archive className="mr-2 h-3.5 w-3.5" />
|
||||
<Archive className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
Archive
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
@@ -92,7 +92,7 @@ export function YachtCard({ yacht, portSlug, onEdit, onArchive }: YachtCardProps
|
||||
}
|
||||
>
|
||||
<div className="flex items-start gap-3">
|
||||
<ListCardAvatar icon={<Ship className="h-5 w-5" />} />
|
||||
<ListCardAvatar icon={<Ship className="h-5 w-5" aria-hidden />} />
|
||||
<div className="min-w-0 flex-1">
|
||||
{/* Title row + spacer for actions button */}
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
|
||||
@@ -149,7 +149,7 @@ export function getYachtColumns({
|
||||
className="h-7 w-7"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<MoreHorizontal className="h-4 w-4" />
|
||||
<MoreHorizontal className="h-4 w-4" aria-hidden />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
@@ -158,16 +158,16 @@ export function getYachtColumns({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
href={`/${portSlug}/yachts/${row.original.id}` as any}
|
||||
>
|
||||
<Eye className="mr-2 h-3.5 w-3.5" />
|
||||
<Eye className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
View
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => onEdit(row.original)}>
|
||||
<Pencil className="mr-2 h-3.5 w-3.5" />
|
||||
<Pencil className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
Edit
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem className="text-destructive" onClick={() => onArchive(row.original)}>
|
||||
<Archive className="mr-2 h-3.5 w-3.5" />
|
||||
<Archive className="mr-2 h-3.5 w-3.5" aria-hidden />
|
||||
Archive
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
|
||||
@@ -171,7 +171,7 @@ export function YachtDetailHeader({ yacht }: YachtDetailHeaderProps) {
|
||||
{/* Actions */}
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Button variant="outline" size="sm" onClick={() => setEditOpen(true)}>
|
||||
<Pencil className="mr-1.5 h-3.5 w-3.5" />
|
||||
<Pencil className="mr-1.5 h-3.5 w-3.5" aria-hidden />
|
||||
Edit
|
||||
</Button>
|
||||
<PermissionGate resource="yachts" action="transfer">
|
||||
@@ -181,7 +181,7 @@ export function YachtDetailHeader({ yacht }: YachtDetailHeaderProps) {
|
||||
onClick={() => setTransferOpen(true)}
|
||||
disabled={isArchived}
|
||||
>
|
||||
<ArrowRightLeft className="mr-1.5 h-3.5 w-3.5" />
|
||||
<ArrowRightLeft className="mr-1.5 h-3.5 w-3.5" aria-hidden />
|
||||
Transfer
|
||||
</Button>
|
||||
</PermissionGate>
|
||||
@@ -191,7 +191,7 @@ export function YachtDetailHeader({ yacht }: YachtDetailHeaderProps) {
|
||||
onClick={() => setArchiveOpen(true)}
|
||||
disabled={isArchived}
|
||||
>
|
||||
<Archive className="mr-1.5 h-3.5 w-3.5" />
|
||||
<Archive className="mr-1.5 h-3.5 w-3.5" aria-hidden />
|
||||
Archive
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -359,7 +359,7 @@ export function YachtForm({ open, onOpenChange, yacht, initialOwner }: YachtForm
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting || mutation.isPending}>
|
||||
{(isSubmitting || mutation.isPending) && (
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" aria-hidden />
|
||||
)}
|
||||
{isEdit ? 'Save changes' : 'Create Yacht'}
|
||||
</Button>
|
||||
|
||||
@@ -116,7 +116,7 @@ export function YachtList() {
|
||||
actions={
|
||||
<PermissionGate resource="yachts" action="create">
|
||||
<Button size="sm" onClick={() => setCreateOpen(true)}>
|
||||
<Plus className="mr-1.5 h-4 w-4" />
|
||||
<Plus className="mr-1.5 h-4 w-4" aria-hidden />
|
||||
New Yacht
|
||||
</Button>
|
||||
</PermissionGate>
|
||||
|
||||
@@ -64,7 +64,7 @@ export function YachtOwnershipHistory({ yachtId }: YachtOwnershipHistoryProps) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center py-12">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" aria-hidden />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export function YachtPicker({
|
||||
className={cn('w-full justify-between', !value && 'text-muted-foreground')}
|
||||
>
|
||||
<span className="truncate">{selectedLabel}</span>
|
||||
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
||||
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" aria-hidden />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-[320px] p-0" align="start">
|
||||
|
||||
@@ -190,7 +190,7 @@ export function YachtTransferDialog({
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting || mutation.isPending}>
|
||||
{(isSubmitting || mutation.isPending) && (
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" aria-hidden />
|
||||
)}
|
||||
Transfer
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user