Skip to content
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

fix(LEMS-2745): update terminology for angle graphs #2061

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-mugs-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

update terminology for angle sides
34 changes: 19 additions & 15 deletions packages/perseus/src/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,18 @@ export type PerseusStrings = {
angleMeasure,
vertexX,
vertexY,
isX,
isY,
tsX,
tsY,
startingSideX,
startingSideY,
endingSideX,
endingSideY,
}: {
angleMeasure: string;
vertexX: string;
vertexY: string;
isX: string;
isY: string;
tsX: string;
tsY: string;
startingSideX: string;
startingSideY: string;
endingSideX: string;
endingSideY: string;
}) => string;
// The above strings are used for interactive graph SR descriptions.
};
Expand Down Expand Up @@ -543,12 +543,16 @@ export const strings: {
message:
"Point 2, vertex at %(x)s comma %(y)s. Angle %(angleMeasure)s degrees",
},
srAngleGraphAriaLabel: "An angle on a coordinate plane.",
srAngleGraphAriaLabel: {
context:
"Screenreader-accessible label of an angle graph on a coordinate plane",
message: "An angle on a coordinate plane.",
},
srAngleGraphAriaDescription: {
context:
"Screenreader-only description of an angle on a coordinate plane.",
message:
"The angle measure is %(angleMeasure)s degrees with a vertex at %(vertexX)s comma %(vertexY)s, a point on the initial side at %(isX)s comma %(isY)s and a point on the terminal side at %(tsX)s comma %(tsY)s",
"The angle measure is %(angleMeasure)s degrees with a vertex at %(vertexX)s comma %(vertexY)s, a point on the starting side at %(isX)s comma %(isY)s and a point on the ending side at %(tsX)s comma %(tsY)s",
},
// The above strings are used for interactive graph SR descriptions.
};
Expand Down Expand Up @@ -761,11 +765,11 @@ export const mockStrings: PerseusStrings = {
angleMeasure,
vertexX,
vertexY,
isX,
isY,
tsX,
tsY,
startingSideX,
startingSideY,
endingSideX,
endingSideY,
}) =>
`The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the initial side at ${isX} comma ${isY} and a point on the terminal side at ${tsX} comma ${tsY}.`,
`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}.`,
// The above strings are used for interactive graph SR descriptions.
};
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ function AngleGraph(props: AngleGraphProps) {
angleMeasure,
vertexX: srFormatNumber(coords[1][X], locale),
vertexY: srFormatNumber(coords[1][Y], locale),
isX: srFormatNumber(coords[2][X], locale),
isY: srFormatNumber(coords[2][Y], locale),
tsX: srFormatNumber(coords[0][X], locale),
tsY: srFormatNumber(coords[0][Y], locale),
startingSideX: srFormatNumber(coords[2][X], locale),
startingSideY: srFormatNumber(coords[2][Y], locale),
endingSideX: srFormatNumber(coords[0][X], locale),
endingSideY: srFormatNumber(coords[0][Y], locale),
});

const formatCoordinates = (x: number, y: number) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ describe("MafsGraph", () => {
"angle-description",
);
expect(angleGraph).toHaveTextContent(
"The angle measure is 270 degrees with a vertex at 0 comma 0, a point on the initial side at 1 comma 1 and a point on the terminal side at -1 comma 1.",
"The angle measure is 270 degrees with a vertex at 0 comma 0, a point on the starting side at 1 comma 1 and a point on the ending side at -1 comma 1.",
);
});

Expand Down
Loading