Skip to content

Conversation

@nishasy
Copy link
Contributor

@nishasy nishasy commented Dec 8, 2025

Summary:

Create a generator for the Explanation widget to make testdata easier to read and write.

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

Test plan:

pnpm jest

@nishasy nishasy self-assigned this Dec 8, 2025
@nishasy nishasy requested review from a team, Myranae and catandthemachines December 8, 2025 23:48
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Size Change: +51 B (+0.01%)

Total Size: 499 kB

Filename Size Change
packages/perseus-core/dist/es/index.js 25 kB +51 B (+0.2%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.8 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 99.2 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 13.1 kB
packages/perseus-editor/dist/es/index.js 97.9 kB
packages/perseus-linter/dist/es/index.js 8.64 kB
packages/perseus-score/dist/es/index.js 9.2 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 200 kB
packages/perseus/dist/es/strings.js 7.73 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.72 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR3104

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3104

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3104

Base automatically changed from dropdown-generator to main December 9, 2025 00:04
@nishasy nishasy marked this pull request as ready for review December 9, 2025 00:05
Copy link
Contributor

@Myranae Myranae left a comment

Choose a reason for hiding this comment

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

Looks good! Just had a couple small comments :)

};

describe("generateExplanationOptions", () => {
it("builds a default explanation options", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it("builds a default explanation options", () => {
it("builds a default explanation options object", () => {

},
alignment: "default",
},
widgets: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this something that is included in the default options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! This is the default options object inside Explanation's widgetLogic:

const defaultWidgetOptions: ExplanationDefaultWidgetOptions = {
    showPrompt: "Explain",
    hidePrompt: "Hide explanation",
    explanation: "explanation goes here\n\nmore explanation",
    widgets: {},
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OH I see. I can remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to add it here then if it gets added via the generate functions?

@nishasy nishasy merged commit 71908ba into main Dec 9, 2025
11 checks passed
@nishasy nishasy deleted the explanation-generator branch December 9, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants