-
Notifications
You must be signed in to change notification settings - Fork 350
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
Remove the legacy keypad and replace it with MobileKeypad #825
Conversation
Previously, the KeypadSwitch component let you toggle between the new and old keypads. Now we always use the new keypad. Issue: https://khanacademy.atlassian.net/browse/LC-739 Test plan: `yarn test`
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (a343751) and published it to npm. You Example: yarn add @khanacademy/perseus@PR825 |
Size Change: -29.6 kB (-3%) Total Size: 834 kB
ℹ️ View Unchanged
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #825 +/- ##
==========================================
+ Coverage 60.68% 62.55% +1.87%
==========================================
Files 484 409 -75
Lines 105898 100106 -5792
Branches 6225 8639 +2414
==========================================
- Hits 64266 62624 -1642
+ Misses 41632 37482 -4150
... and 33 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
<Basic | ||
keypadElement={keypadElement} | ||
setKeypadElement={setKeypadElement} | ||
keypadActive={keypadActive} | ||
setKeypadActive={setKeypadActive} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid breaking compatibility with existing callers, it might be better to wrap the MobileKeypad in a component that uses the KeypadContext.Consumer
to get keypadActive
and setKeypadActive
. @handeyeco do you think that would be an improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's definitely the way I'd like to go. See this ticket:
What’s even nicer is that this could likely all happen within Perseus - rather than passing things around in Webapp, we can pass things around in Perseus using Context; the Perseus widget passes a config up to the Perseus context which passes the config down to the Perseus keypad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -11,7 +11,7 @@ | |||
* extend a `ProvideKeypad` component instead of using this mixin. | |||
*/ | |||
|
|||
import {MobileKeypad} from "@khanacademy/math-input"; | |||
import {KeypadContext, MobileKeypad} from "@khanacademy/math-input"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action needed: just for reference, both ProvideKeypad and ItemRenderer are dead code now. It's fine if it's out of scope for this PR, but I also wouldn't spend much more time updating them.
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 - [#825](#825) [`7cb40e4c`](7cb40e4) Thanks [@benchristel](https://github.com/benchristel)! - We've removed the deprecated `useV2Keypad` prop from the MobileKeypad component. The V2 keypad is now the default, and the old keypad has been removed. Additionally, the mobile keypad no longer accepts the `keypadActive` or `setKeypadActive` props. It now gets those values itself from the `KeypadContext`. ## @khanacademy/[email protected] ### Major Changes - [#825](#825) [`7cb40e4c`](7cb40e4) Thanks [@benchristel](https://github.com/benchristel)! - We've removed the deprecated `useV2Keypad` prop from the MobileKeypad component. The V2 keypad is now the default, and the old keypad has been removed. Additionally, the mobile keypad no longer accepts the `keypadActive` or `setKeypadActive` props. It now gets those values itself from the `KeypadContext`. ### Minor Changes - [#816](#816) [`cdcd162e`](cdcd162) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Wrap all SvgImage instances in AssetContext (ensures that host applications can correctly wait for all images to load in a renderer before proceeding). - [#788](#788) [`8f1f0208`](8f1f020) Thanks [@jeanettehead](https://github.com/jeanettehead)! - create randomized storybook stories for some widgets ### Patch Changes - Updated dependencies \[[`7cb40e4c`](7cb40e4)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Minor Changes - [#827](#827) [`c7410ccc`](c7410cc) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Revert defensive code in ExpressionEditor that caused a crash when an expression config's answer form was missing a `key` property. ### Patch Changes - Updated dependencies \[[`cdcd162e`](cdcd162), [`7cb40e4c`](7cb40e4), [`8f1f0208`](8f1f020)]: - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ Upload Coverage, ⏭ Publish npm snapshot, ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ Cypress (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 16.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 16.x), ✅ gerald Pull Request URL: #819
Summary:
Previously, the KeypadSwitch component let you toggle between the new
and old keypads. Now we always use the new keypad.
Issue: https://khanacademy.atlassian.net/browse/LC-739
Test plan:
yarn test