Skip to content

Commit 3e65840

Browse files
committed
fix: convey summary status in Reading Level card accessible name
The Reading Level summary card visually displays a status such as 'Summary required', but its aria-label only announced the reading level (e.g. 'View reading level details: 12th'), so screen reader users never received the visible status. Include the summary status in the card's accessible name when one is displayed. Fixes #1765 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNWw6kF1g1nyCpeDyXRb6L
1 parent 27c4c59 commit 3e65840

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/sidebar/components/Panels/AccessibilityStatus.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,19 @@ const AccessibilityStatus = () => {
248248
onClick={ handleReadingLevelClick }
249249
role="button"
250250
tabIndex={ 0 }
251-
aria-label={ sprintf(
252-
__( 'View reading level details: %s', 'accessibility-checker' ),
253-
readingLevelText,
254-
) }
251+
aria-label={ summaryStatus
252+
? sprintf(
253+
/* translators: 1: reading level, 2: simplified summary status. */
254+
__( 'View reading level details: %1$s, %2$s', 'accessibility-checker' ),
255+
readingLevelText,
256+
summaryStatus,
257+
)
258+
: sprintf(
259+
/* translators: %s: reading level. */
260+
__( 'View reading level details: %s', 'accessibility-checker' ),
261+
readingLevelText,
262+
)
263+
}
255264
onKeyDown={ ( e ) => {
256265
if ( e.key === 'Enter' || e.key === ' ' ) {
257266
if ( e.key === ' ' ) {

0 commit comments

Comments
 (0)