Label more icon-only buttons for screen readers

Continues the labelling sweep: close X buttons in
UpdateConfirmationModal, ChangePasswordModal, SuggestProfileModal,
UserAssignmentsDialog, the Patrol configuration popover, the Toast
dismiss control, the SSO provider test result and metadata preview
dismiss buttons, and the compact ContainerUpdateBadge button (which
becomes icon-only when compact). Each gets aria-label + title; the
inline SVG icons get aria-hidden so the button label is the only
announced text.
This commit is contained in:
rcourtman
2026-05-10 16:59:44 +01:00
parent 057df88c79
commit 6ea6f11a7d
8 changed files with 21 additions and 4 deletions
@@ -112,9 +112,11 @@ export const ChangePasswordModal: Component<ChangePasswordModalProps> = (props)
type="button"
onClick={handleClose}
disabled={loading()}
aria-label="Close password dialog"
title="Close"
class="text-slate-400 hover:text-muted disabled:opacity-50"
>
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -531,6 +531,8 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
<button
type="button"
onClick={() => setTestResult(null)}
aria-label="Dismiss test result"
title="Dismiss"
class="text-slate-400 hover:text-base-content"
>
<X class="w-4 h-4" />
@@ -687,6 +689,8 @@ export const SSOProvidersPanel: Component<SSOProvidersPanelProps> = (props) => {
<button
type="button"
onClick={() => setShowMetadataPreview(false)}
aria-label="Close metadata preview"
title="Close"
class="text-slate-400 hover:text-base-content"
>
<X class="w-5 h-5" />
@@ -238,9 +238,11 @@ export const SuggestProfileModal: Component<SuggestProfileModalProps> = (props)
<button
type="button"
onClick={props.onClose}
aria-label="Close profile suggestion dialog"
title="Close"
class="p-1.5 rounded-md text-slate-500 hover:text-base-content hover:bg-surface-hover"
>
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -40,6 +40,8 @@ export const UserAssignmentsDialog: Component<UserAssignmentsDialogProps> = (pro
<button
type="button"
onClick={props.onClose}
aria-label="Close user assignments"
title="Close"
class="p-1.5 rounded-md hover:text-base-content hover:bg-surface-hover"
>
<X class="w-5 h-5" />
@@ -138,9 +138,11 @@ export const Toast: Component<ToastProps> = (props) => {
<button
type="button"
onClick={handleClose}
aria-label="Dismiss notification"
title="Dismiss"
class="flex-shrink-0 text-muted hover:text-base-content hover:bg-surface rounded-md p-1.5 transition-all duration-200"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -50,11 +50,13 @@ export function UpdateConfirmationModal(props: UpdateConfirmationModalProps) {
<h2 class="text-xl font-semibold text-base-content">Confirm Update</h2>
<button
onClick={handleClose}
aria-label="Close confirmation"
title="Close"
class=" hover:text-base-content"
disabled={props.isApplying}
type="button"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -168,6 +168,7 @@ export const UpdateButton: Component<UpdateButtonProps> = (props) => {
e.stopPropagation();
}}
disabled={state.isButtonDisabled()}
aria-label={state.buttonTooltip() || state.buttonLabel()}
data-prevent-toggle
onMouseEnter={(e) => {
const rect = e.currentTarget.getBoundingClientRect();
@@ -257,6 +257,8 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
</h4>
<button
onClick={() => state.setShowAdvancedSettings(false)}
aria-label="Close patrol configuration"
title="Close"
class="p-1 rounded-md hover:text-base-content hover:bg-surface-hover transition-colors"
>
<XIcon class="w-4 h-4" />