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

[SR] Circle - Add the interactive elements circle description to the whole graph container #2060

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nishasy
Copy link
Contributor

@nishasy nishasy commented Dec 24, 2024

Summary:

Add the interactive Circle graph description to the full graph container.

This adds the "Interactive elements: Circle..." description to the outermost graph container.

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

Test plan:

@nishasy nishasy self-assigned this Dec 24, 2024
Copy link
Contributor

github-actions bot commented Dec 24, 2024

Size Change: +189 B (+0.01%)

Total Size: 1.27 MB

Filename Size Change
packages/perseus/dist/es/index.js 417 kB +189 B (+0.05%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 688 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 4.93 kB
packages/pure-markdown/dist/es/index.js 3.67 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

@@ -221,3 +207,59 @@ function crossProduct<A, B>(as: A[], bs: B[]): [A, B][] {
}
return result;
}

function CircleGraphDescription({state}: {state: CircleGraphState}) {
// CircleGraphDescription needs to the `usePerseusI18n`, hook so it has]
Copy link
Contributor

@anakaren-rojas anakaren-rojas Dec 27, 2024

Choose a reason for hiding this comment

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

?

Suggested change
// CircleGraphDescription needs to the `usePerseusI18n`, hook so it has]
// CircleGraphDescription needs the `usePerseusI18n` hook so it has

@@ -221,3 +207,59 @@ function crossProduct<A, B>(as: A[], bs: B[]): [A, B][] {
}
return result;
}

function CircleGraphDescription({state}: {state: CircleGraphState}) {
Copy link
Contributor

@anakaren-rojas anakaren-rojas Dec 27, 2024

Choose a reason for hiding this comment

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

this is the same as state: CircleGraphState? Or is there an additional benefit to the destructing in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that works too. I think the reason it was done this way (I was following what Ben did for the point description) is so it follows the prop structure the way they're standardly written for other functional components.

// Exported for testing
export function describeCircleGraph(
state: CircleGraphState,
i18n: {strings: PerseusStrings; locale: string},
Copy link
Contributor

@anakaren-rojas anakaren-rojas Dec 27, 2024

Choose a reason for hiding this comment

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

theres a I18nContextType that might be worth exporting to use here and around in the other graphs as needed. Alternatively, we could create a type in a utility file and destructure
{strings: PerseusStrings; locale: string}: I18ContextType then remove line 225

Copy link
Contributor

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR2060

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR2060

@nishasy nishasy marked this pull request as ready for review December 28, 2024 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants