Skip to content

[6.x] Announces the password reset error message in via the live region#19303

Draft
gcamacho079 wants to merge 4 commits into
6.xfrom
lupe/acc-222-when-pressing-the-reset-password-button-the-loading-state
Draft

[6.x] Announces the password reset error message in via the live region#19303
gcamacho079 wants to merge 4 commits into
6.xfrom
lupe/acc-222-when-pressing-the-reset-password-button-the-loading-state

Conversation

@gcamacho079

Copy link
Copy Markdown
Contributor

Description

Also:

  • Fixes a double semicolon in CSS
  • Renames LiveRegion to GlobalLiveRegion for clarity; remove conditional render to ensure announcement is read.

Related issues

Resolves ACC-221

@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label Jul 23, 2026
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ACC-221

ACC-222

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves accessibility of authentication error handling by switching login/reset-password error announcements to a shared global live region, ensuring screen readers reliably announce messages (ACC-221). It also includes a small CSS cleanup and adds initial a11y documentation for craft-button.

Changes:

  • Route login and reset-password error messages through the shared useAnnouncer() mechanism (instead of updating a shadow-DOM live region).
  • Replace LiveRegion with GlobalLiveRegion and render it unconditionally in relevant layouts.
  • Fix a CSS double-semicolon and add craft-button a11y requirements documentation.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
resources/js/modules/auth/components/login/login-reset-password.ts Announces reset-password errors via useAnnouncer() and centralizes error setting.
resources/js/modules/auth/components/login/login-form.ts Announces login errors via useAnnouncer() rather than a local shadow live region.
resources/js/common/layouts/AuthBase.vue Adds the global live region to auth pages; fixes a minor CSS typo.
resources/js/common/layouts/AppLayout.vue Replaces legacy LiveRegion usage with GlobalLiveRegion.
resources/js/common/components/LiveRegion.vue Removes the old conditional live region component.
resources/js/common/components/GlobalLiveRegion.vue Adds an always-present global live region tied to useAnnouncer().
packages/craftcms-ui/src/components/button/button.a11y.md Adds initial accessibility requirements documentation for craft-button.
Comments suppressed due to low confidence (2)

resources/js/modules/auth/components/login/login-reset-password.ts:42

  • #setError() trims the error for display but announces the untrimmed message. This can cause the announced text to differ from what’s shown (and can announce pure whitespace). Announce the trimmed value and skip announcing if it becomes empty.
  #setError(message: string) {
    this._error = message.trim();
    useAnnouncer().announce(message);
  }

resources/js/modules/auth/components/login/login-form.ts:212

  • #setError() trims the error for display but announces the untrimmed message. Announce the trimmed value (and avoid announcing an empty/whitespace-only message) so the screen reader output matches what’s visible.
  #setError(message: string) {
    const { announce } = useAnnouncer();
    this._error = message.trim();
    announce(message);
  }

import './login-challenge.js';
import './login-reset-password.js';

import { useAnnouncer } from '@/common/composables/useAnnouncer';
import {property, query, state} from 'lit/decorators.js';
import {actionClient, t} from '@craftcms/ui';
import componentStyles from './login-form.styles.js';
import { useAnnouncer} from '@/common/composables/useAnnouncer';
@github-actions

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/uiopen Storybook

Changed components:

resources/jsopen Storybook

No changed components detected in this Storybook.

@gcamacho079
gcamacho079 marked this pull request as draft July 24, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility 👤 features related to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants