From cc9d3a4bc8866bbdaa09e2bf3fdb321fb9a125c1 Mon Sep 17 00:00:00 2001 From: Sarah Third Date: Thu, 12 Dec 2024 09:41:06 -0800 Subject: [PATCH] One weird trick that delights screen readers (#1988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: This is a simple PR that adds an aria-hidden tag to our graphie container so that we don't read out axis labels or "Made by Raphael" on screen readers. As a result, screen readers should have an easier time navigating the website. While this may hide some labels within graphie, we've taken the position that the alt tags should be the sole source of truth for our screen readers. Issue: LEMS-2712 ## Test plan: - manual testing Author: SonicScrewdriver Reviewers: mark-fitzgerald Required Reviewers: Approved By: mark-fitzgerald Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x) Pull Request URL: https://github.com/Khan/perseus/pull/1988 --- .changeset/cool-moons-reply.md | 5 +++++ .../__tests__/__snapshots__/graph.test.tsx.snap | 1 + packages/perseus/src/util/graphie.ts | 3 +++ .../widgets/grapher/__snapshots__/grapher.test.ts.snap | 2 ++ .../interaction/__snapshots__/interaction.test.ts.snap | 1 + .../__snapshots__/interactive-graph.test.tsx.snap | 9 +++++++++ .../number-line/__snapshots__/number-line.test.ts.snap | 10 ++++++++++ 7 files changed, 31 insertions(+) create mode 100644 .changeset/cool-moons-reply.md diff --git a/.changeset/cool-moons-reply.md b/.changeset/cool-moons-reply.md new file mode 100644 index 0000000000..a71cab37b6 --- /dev/null +++ b/.changeset/cool-moons-reply.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/perseus": minor +--- + +Hiding graphie labels from screen readers. diff --git a/packages/perseus/src/components/__tests__/__snapshots__/graph.test.tsx.snap b/packages/perseus/src/components/__tests__/__snapshots__/graph.test.tsx.snap index 6e245cd588..a5722937de 100644 --- a/packages/perseus/src/components/__tests__/__snapshots__/graph.test.tsx.snap +++ b/packages/perseus/src/components/__tests__/__snapshots__/graph.test.tsx.snap @@ -7,6 +7,7 @@ exports[`graph should render 1`] = ` style="width: 400px; height: 400px;" >