-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Locked Figure Aria] Use spoken math in locked figure settings autogen labels #1858
Conversation
… within Locked Point aria labels
… label, update type on condenseTextNodes params
…labels When auto-generating the aria labels for locked figures, we want it to use words as if they were spoken rather than math expressions that might be read incorrectly by the screen reader. - Use the `generateSpokenMathDetails` utility within LockedLineSettings, following the pattern used in LockedPointSettings for this. - Update the locked line autogen function to include the labels on the locked points that define the locked line. Issue: https://khanacademy.atlassian.net/browse/LEMS-2548 Test plan: - `yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-line-settings.test.tsx` Storybook - Go to http://localhost:6006/iframe.html?args=&id=perseuseditor-widgets-interactive-graph--mafs-with-locked-figure-labels-all-flags&viewMode=story - Open the locked line settings - Change the visible label to hvae a mix of TeX (with `$...$`) and non-TeX - Press the "Auto-generate" button - Confirm that the input changes to include spoken math words for the TeX - Also try this with no labels, multiple labels, and the labels changed for the locked points that define the line
…is clicked rather when the props are changed
…is clicked rather than when the props are changed
…n labels When auto-generating the aria labels for locked figures, we want it to use words as if they were spoken rather than math expressions that might be read incorrectly by the screen reader. - Use the `generateSpokenMathDetails` utility within LockedVectorSettings, LockedEllipseSettings, LockedPolygonSettings, and LockedFunctionSettings. Issue: https://khanacademy.atlassian.net/browse/LEMS-2548 Test plan: - `yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-vector-settings.test.tsx` - `yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-ellipse-settings.test.tsx` - `yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-polygon-settings.test.tsx` - `yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-function-settings.test.tsx` Storybook - Go to http://localhost:6006/iframe.html?args=&id=perseuseditor-widgets-interactive-graph--mafs-with-locked-figure-labels-all-flags&viewMode=story - For each locked figure: - Open the figure settings - Change the visible label to have a mix of TeX and non-TeX - Press the "Auto-generate" button - Confirm that the input changes to include spoken math words for the TeX - Also try this with no labels, multiple labels, fully non-TeX, and fully teX labels.
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (7ee43a8) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1858 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1858 |
Size Change: -65 B (-0.01%) Total Size: 1.29 MB
ℹ️ View Unchanged
|
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship it!
@@ -24,6 +24,14 @@ const defaultProps = { | |||
|
|||
const defaultLabel = getDefaultFigureForType("label"); | |||
|
|||
// Mock the async function generateSpokenMathDetails | |||
jest.mock("./util", () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this mocking to help us identify the generated spoken math details in testing ❤️
@catandthemachines I agree that it's a bit awkward, but I believe that's the intended behavior. I think it's to make it more clear where the square root starts and ends for the cases in which the radicand is particularly complex. |
The parent pull-request (#1854) has been merged into |
Summary:
When auto-generating the aria labels for locked figures, we want it to use
words as if they were spoken rather than math expressions that might be
read incorrectly by the screen reader.
generateSpokenMathDetails
utility within LockedVectorSettings,LockedEllipseSettings, LockedPolygonSettings, and LockedFunctionSettings.
prePopulatedAriaLabel
andmake
getPrepopulatedAriaLabel
required.Issue: https://khanacademy.atlassian.net/browse/LEMS-2548
Test plan:
yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-vector-settings.test.tsx
yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-ellipse-settings.test.tsx
yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-polygon-settings.test.tsx
yarn jest packages/perseus-editor/src/widgets/interactive-graph-editor/locked-figures/locked-function-settings.test.tsx
Storybook
fully teX labels.