You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(LEMS-1733): adds aria labels to line segment (#2032)
## Summary:
- Adds aria label and description to whole line segment graph
- Adds copy that distinguishes between single line segment on a coordinate plane and multiple line segments on a coordinate plane
- Adds aria label for individual end points of line segment
Issue: LEMS-1733
## Test plan:
1. Navigate to [Chromatic](https://650db21c3f5d1b2f13c02952-crydbfdmmp.chromatic.com/?path=/docs/perseuseditor-editorpage--docs)
2. Select Line Segment Interactive Graph from drop down
3. Validate screen reader can read line segment
### Expected behavior
#### Single Segment
1. Screen reader reads aria label for whole graph: `A line segment on a coordinate plane.`
2. Screen reader reads aria description for whole graph: `A line segment on a coordinate plane. Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 ${point2X} comma ${point2Y}. Segment length %(length)s units.`
#### Multiple Segments
1. Screen reader reads aria label for whole graph: `{Number of segments} segment on a coordinate plane.`
2. Screen reader reads aria description for whole graph: `{Number of segments} segment on a coordinate plane. Segment {N}: Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 ${point2X} comma ${point2Y}. Segment length %(length)s units.`
#### Individual Points
1. When selected, screen reader reads aria label for end points: `Endpoint ${endpointNumber} at ${x} comma ${y}`
2. When moving a point, aria labels and descriptions adjust to include new end points and length, as appropriate
## Screenshots:
### Single Segment on a Coordinate Plane - Aria Label and Description
<img width="1576" alt="image" src="https://github.com/user-attachments/assets/82c66b8a-33ed-473d-855d-bdfb8105ee49" />
### Multiple segments on a coordinate plane - Aria Label and Description
<img width="1623" alt="image" src="https://github.com/user-attachments/assets/854ae6cd-6127-499c-9528-25baa86b7d46" />
### Individual Segment Aria Label - Description
<img width="1608" alt="image" src="https://github.com/user-attachments/assets/ac70d28e-dd31-478a-a4d1-7d11baf0c772" />
Author: anakaren-rojas
Reviewers: nishasy, anakaren-rojas, catandthemachines
Required Reviewers:
Approved By: nishasy, catandthemachines
Checks: ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x)
Pull Request URL: #2032
srAngleGraphAriaLabel: "An angle on a coordinate plane.",
526
588
srAngleGraphAriaDescription:
527
589
"The angle measure is %(angleMeasure)s degrees with a vertex at %(vertexX)s comma %(vertexY)s, a point on the starting side at %(startingSideX)s comma %(startingSideY)s and a point on the ending side at %(endingSideX)s comma %(endingSideY)s",
590
+
srSingleSegmentGraphAriaLabel: "A line segment on a coordinate plane.",
591
+
srMultipleSegmentGraphAriaLabel:
592
+
"%(countOfSegments)s line segments on a coordinate plane.",
`The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`,
838
+
srSingleSegmentGraphAriaLabel: "A line segment on a coordinate plane.",
0 commit comments