Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
🗄️ Schema Change: Changes Detected
|
🛠️ Item Splitting: No Changes ✅ |
|
Size Change: 0 B Total Size: 494 kB ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (6468bd7) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3414If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3414If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3414 |
…he type of `PerseusItem.answerArea`.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated # Releases ## @khanacademy/[email protected] ### Major Changes - [#3416](#3416) [`3e1e498bf5`](3e1e498) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove trivial function `getWidgetsMapFromItemData` - access widgets via `.question.widgets` instead. ### Patch Changes - [#3388](#3388) [`3f091b70cb`](3f091b7) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within image zoom view - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#3414](#3414) [`669ed4e6b1`](669ed4e) Thanks [@benchristel](https://github.com/benchristel)! - Remove `null` from the type of `PerseusItem.answerArea`. ### Minor Changes - [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util ## @khanacademy/[email protected] ### Minor Changes - [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47), [`3f091b70cb`](3f091b7), [`3e1e498bf5`](3e1e498)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#3419](#3419) [`2d8df47440`](2d8df47) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - changes return types of linter functions to not be readonly array; exports linterwarningitem - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 2 checks have been skipped, ✅ 6 checks were successful Pull Request URL: #3412
## Summary: In production, `answerArea` is never `null` or `undefined`. However, in test data, we sometimes want to leave it undefined for brevity. This change simplifies the type of `answerArea`, removing `null`. Currently, no code in the frontend repo sets `answerArea` to `null`. This also fixes an inconsistency between the `PerseusItem` type and the `EditorPage` component's props. The type `PropsFor<EditorPage>["answerArea"]` is equivalent to `PerseusAnswerArea | undefined` (because `answerArea` has a default prop), but the prop doesn't accept `null`. This means we currently can't pass a `PerseusItem` directly to `EditorPage` without converting `null` to `undefined` or suppressing typechecking. Issue: none ## Test plan: `pnpm tsc` Author: benchristel Reviewers: claude[bot], jeremywiebe, anakaren-rojas Required Reviewers: Approved By: jeremywiebe Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3414
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated # Releases ## @khanacademy/[email protected] ### Major Changes - [#3416](#3416) [`3e1e498bf5`](3e1e498) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove trivial function `getWidgetsMapFromItemData` - access widgets via `.question.widgets` instead. ### Patch Changes - [#3388](#3388) [`3f091b70cb`](3f091b7) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within image zoom view - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Major Changes - [#3414](#3414) [`669ed4e6b1`](669ed4e) Thanks [@benchristel](https://github.com/benchristel)! - Remove `null` from the type of `PerseusItem.answerArea`. ### Minor Changes - [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util ## @khanacademy/[email protected] ### Minor Changes - [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47), [`3f091b70cb`](3f091b7), [`3e1e498bf5`](3e1e498)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#3419](#3419) [`2d8df47440`](2d8df47) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - changes return types of linter functions to not be readonly array; exports linterwarningitem - Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]: - @khanacademy/[email protected] - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 2 checks have been skipped, ✅ 6 checks were successful Pull Request URL: #3412
Summary:
In production,
answerAreais nevernullorundefined. However, in testdata, we sometimes want to leave it undefined for brevity.
This change simplifies the type of
answerArea, removingnull. Currently, nocode in the frontend repo sets
answerAreatonull.This also fixes an inconsistency between the
PerseusItemtype and theEditorPagecomponent's props. The typePropsFor<EditorPage>["answerArea"]is equivalent to
PerseusAnswerArea | undefined(becauseanswerAreahas adefault prop), but the prop doesn't accept
null. This means we currentlycan't pass a
PerseusItemdirectly toEditorPagewithout convertingnullto
undefinedor suppressing typechecking.Issue: none
Test plan:
pnpm tsc