Skip to content

Commit 38a04b6

Browse files
Merge pull request #219 from mieweb/accessibility/a11y-button-labels
a11y: add aria-label to icon-only buttons
2 parents ba4ad4f + 2c7c877 commit 38a04b6

7 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/components/AI/AIChat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ export function AIChat({
383383
data-slot="ai-chat-header-action"
384384
className="rounded-lg p-2 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-300"
385385
title="Clear chat"
386+
aria-label="Clear chat"
386387
>
387388
<RefreshIcon />
388389
</button>

src/components/AuthDialog/AuthDialog.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ function LoginForm({ onSubmit, isLoading, onForgotPassword }: LoginFormProps) {
461461
type="button"
462462
onClick={() => setShowPassword(!showPassword)}
463463
className="text-muted-foreground absolute top-1/2 right-3 -translate-y-1/2 hover:text-gray-700"
464+
aria-label={showPassword ? 'Hide password' : 'Show password'}
464465
>
465466
{showPassword ? (
466467
<EyeOffIcon className="h-4 w-4" />
@@ -569,6 +570,7 @@ function SignupForm({
569570
type="button"
570571
onClick={() => setShowPassword(!showPassword)}
571572
className="text-muted-foreground absolute top-1/2 right-3 -translate-y-1/2 hover:text-gray-700"
573+
aria-label={showPassword ? 'Hide password' : 'Show password'}
572574
>
573575
{showPassword ? (
574576
<EyeOffIcon className="h-4 w-4" />
@@ -751,6 +753,7 @@ function ResetPasswordForm({ onSubmit, isLoading }: ResetPasswordFormProps) {
751753
type="button"
752754
onClick={() => setShowPassword(!showPassword)}
753755
className="text-muted-foreground absolute top-1/2 right-3 -translate-y-1/2 hover:text-gray-700"
756+
aria-label={showPassword ? 'Hide password' : 'Show password'}
754757
>
755758
{showPassword ? (
756759
<EyeOffIcon className="h-4 w-4" />

src/components/CommandPalette/CommandPalette.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ export function CommandPalette({
321321
onClick={() => setQuery('')}
322322
data-testid={`${testId}-clear`}
323323
className="text-muted-foreground absolute top-1/2 right-12 -translate-y-1/2 hover:text-gray-700 dark:hover:text-gray-200"
324+
aria-label="Clear search"
324325
>
325326
<XIcon />
326327
</button>

src/components/NotificationCenter/NotificationCenter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ export function NotificationCenter({
393393
variant="ghost"
394394
size="sm"
395395
className="h-auto p-1 text-xs opacity-0 group-hover:opacity-100"
396+
aria-label="Dismiss notification"
396397
onClick={(e) => {
397398
e.stopPropagation();
398399
onDismiss(notification.id);

src/components/OnboardingWizard/OnboardingWizard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export function OnboardingWizard({
221221
variant="outline"
222222
onClick={handleBack}
223223
disabled={!backEnabled || isFirstStep}
224+
aria-label={back}
224225
>
225226
<span className="hidden sm:inline">{back}</span>
226227
<i className="fas fa-chevron-left sm:hidden" />
@@ -243,6 +244,7 @@ export function OnboardingWizard({
243244
variant="primary"
244245
onClick={handleNext}
245246
disabled={!nextEnabled && !isLastStep}
247+
aria-label={isLastStep ? finish : next}
246248
>
247249
<span className="hidden sm:inline">
248250
{isLastStep ? finish : next}

src/components/ServiceCard/ServiceCard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export function ServiceCard({
213213
onClick={handleDeleteClick}
214214
className="text-muted-foreground hover:text-destructive p-1.5 transition-colors"
215215
title="Delete service"
216+
aria-label="Delete service"
216217
>
217218
<Trash2 className="h-4 w-4" />
218219
</button>
@@ -223,6 +224,7 @@ export function ServiceCard({
223224
onClick={handleEditClick}
224225
className="text-muted-foreground hover:text-primary p-1.5 transition-colors"
225226
title="Edit service"
227+
aria-label="Edit service"
226228
>
227229
<Pencil className="h-4 w-4" />
228230
</button>

src/components/Sidebar/Sidebar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ export function SidebarNavGroup({
364364
showCollapsed && 'justify-center'
365365
)}
366366
title={showCollapsed ? label : undefined}
367+
aria-label={showCollapsed ? label : undefined}
367368
>
368369
{icon && (
369370
<span
@@ -509,6 +510,7 @@ export function SidebarNavItem({
509510
data-testid={testId}
510511
className={baseClasses}
511512
title={showCollapsed ? label : undefined}
513+
aria-label={showCollapsed ? label : undefined}
512514
>
513515
{content}
514516
</a>
@@ -523,6 +525,7 @@ export function SidebarNavItem({
523525
data-testid={testId}
524526
className={baseClasses}
525527
title={showCollapsed ? label : undefined}
528+
aria-label={showCollapsed ? label : undefined}
526529
>
527530
{content}
528531
</button>

0 commit comments

Comments
 (0)