Skip to content

[Image] | (a11y) | Add aria-describedby to Explore Image modal#3504

Open
nishasy wants to merge 2 commits intomainfrom
explore-modal-describedby
Open

[Image] | (a11y) | Add aria-describedby to Explore Image modal#3504
nishasy wants to merge 2 commits intomainfrom
explore-modal-describedby

Conversation

@nishasy
Copy link
Copy Markdown
Contributor

@nishasy nishasy commented Apr 16, 2026

Summary:

The internal audit pointed out that we're missing aria-describedby on the Explore Image modal.
In order to follow best practices, I'm adding that here.

As per the suggestion in the ticket, I'm adding both caption and description IDs if the
caption is present. If there is no caption, then it's just the description ID.

NOTE: This change is not possible to test in VoiceOver since it has a behavior discrepancy -
it will be the same as before adding the aria-describedby. We should be able to see a
difference when using NVDA though.

Update: I confirmed that it reads the describedby content before the close button when using
NVDA on my personal Windows machine!

Issue: https://khanacademy.atlassian.net/browse/LEMS-4046

Test plan:

pnpm jest packages/perseus/src/widgets/image/components/explore-image-modal.test.tsx

Storybook

  • Go to /?path=/story/widgets-image-widget-demo--image
  • Open the Elements tab in dev tools
  • Confirm that the role="dialog" element has aria-describedby that points to the
    caption and description IDs.
Before After
Screenshot 2026-04-16 at 2 10 32 PM Screenshot 2026-04-16 at 2 10 23 PM

nishasy added 2 commits April 16, 2026 14:03
…o Explore Image modal

The internal audit pointed out that we're missing aria-describedby on the Explore Image modal.
In order to follow best practices, I'm adding that here.

As per the suggestion in the ticket, I'm adding both caption and description IDs if the
caption is present. If there is no caption, then it's just the description ID.

NOTE: This change is not possible to test in VoiceOver since it has a behavior discrepancy -
it will be the same as before adding the aria-describedby. We should be able to see a
difference when using NVDA though.

Issue: https://khanacademy.atlassian.net/browse/LEMS-4046

Test plan:
`pnpm jest packages/perseus/src/widgets/image/components/explore-image-modal.test.tsx`

Storybook
- Go to `/?path=/story/widgets-image-widget-demo--image`
- Open the Elements tab in dev tools
- Confirm that the `role="dialog"` element has `aria-describedby` that points to the
  caption and description IDs.
@nishasy nishasy self-assigned this Apr 16, 2026
@github-actions github-actions bot added schema-change Attached to PRs when we detect Perseus Schema changes in it item-splitting-change labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (ffa1ad4) and published it to npm. You
can install it using the tag PR3504.

Example:

pnpm add @khanacademy/perseus@PR3504

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3504

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3504

@github-actions github-actions bot removed the schema-change Attached to PRs when we detect Perseus Schema changes in it label Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Size Change: +100 B (+0.02%)

Total Size: 499 kB

📦 View Changed
Filename Size Change
packages/perseus/dist/es/index.js 196 kB +100 B (+0.05%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.5 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.36 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 11.9 kB
packages/perseus-core/dist/es/index.js 25.1 kB
packages/perseus-editor/dist/es/index.js 102 kB
packages/perseus-linter/dist/es/index.js 9.3 kB
packages/perseus-score/dist/es/index.js 9.7 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 8.27 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

🛠️ Item Splitting: No Changes ✅

@nishasy nishasy requested review from a team and mark-fitzgerald April 16, 2026 21:25
@nishasy nishasy marked this pull request as ready for review April 16, 2026 21:25
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant