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

[2-quell-the-fracus] [Bug Fix] - Ensure that users hand typing tex into Numeric Inputs on Desktop do not cause an infinite loop. #2175

Open
wants to merge 5 commits into
base: feature/numeric-dx-refactor
Choose a base branch
from

Conversation

SonicScrewdriver
Copy link
Contributor

@SonicScrewdriver SonicScrewdriver commented Jan 30, 2025

Summary:

This ticket is part of the Numeric Input project.

Numeric Input has different experiences on Desktop versus Mobile:

  1. Desktop allows users to enter basic math commands using their regular keyboard. Desktop does not display / visually support TeX, but CAN parse it as an answer.
  2. Mobile allows users to enter basic math commands using a keypad that crafts TeX to display the output using MathQuill / Math Input.

This diverged experience resulted in the possibility to hit an infinite loop on Desktop if the user tries to hand type \frac or \dfrac TeX commands , as the parser was unable to locate the next symbols to parse. This has likely been a bug since inception, but has become far more noticeable as we're now parsing answers on the fly to provide AI support. As a result, the answers are constantly being evaluated and would hit the infinite loop as soon as the user started typing the expressions.

Issue: LEMS-198

Test plan:

  • Run tests
  • New tex wrangler test

…to Numeric Inputs on Desktop do not cause an infinite loop.

I believe this solves the issue, but I'm putting this in a PR to perform some additional testing downstream.

Issue: LEMS-198

Test Plan:
- Run tests
- New tex wrangler test
…reate infinite loop with incomplete tex in Numeric Input
@SonicScrewdriver SonicScrewdriver self-assigned this Jan 30, 2025
Copy link
Contributor

github-actions bot commented Jan 30, 2025

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR2175

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

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

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Size Change: +112 B (+0.01%)

Total Size: 1.48 MB

Filename Size Change
packages/perseus-score/dist/es/index.js 113 kB +112 B (+0.1%)
ℹ️ 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 86.8 kB
packages/math-input/dist/es/index.js 77.7 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 43.5 kB
packages/perseus-editor/dist/es/index.js 688 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/index.js 382 kB
packages/perseus/dist/es/strings.js 5.82 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

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.

1 participant