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

[Locked Labels] Count lone unescaped $ as regular dollar signs #1875

Merged
merged 12 commits into from
Nov 26, 2024

Commits on Nov 16, 2024

  1. [Locked Figure Aria] Fix $ edge cases for spoken math aria labels

    I received a couple suggestions in PR #1854.
    I'm implmementing them here:
    
    - Wrote a helper function that joins labels together so that we don't have to
      duplicate that code for every single locked figure.
    - Stopped calling `generateSpokenMathDetails()` on the whole aria string
      for the locked figure. Instead, it's now being called within
      the new helper function so that the labels can individually be converted,
      and we don't have to worry about the edge case with two different labels
      having dollar signs and causing all the content in between to be counted
      as TeX when it shouldn't.
    - Handled the case with a lone unescaped dollar sign, which should not count
      as TeX.
    
    Note: The lone unescaped dollar isn't handled for the TeX inside the
    graph itself yet. This will be in the next PR.
    
    Issue: https://khanacademy.atlassian.net/browse/LEMS-2548
    
    Test plan:
    `yarn jest`
    
    Storybook
    - http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--mafs-with-locked-figure-labels-all-flags
    - Add two visible labels to the point, with one having "$1 and" as the label
      and the other having "$1" as the label.
    - Press the autogenerate button and confirm that the "and" is normal and not "a n d".
      Also confirm that the dollar signs show up normally.
    - Add two TeX labels and confirm that the auto-generated text is as expected.
    - Repeat for all the other locked figures.
    nishasy committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    3058e93 View commit details
    Browse the repository at this point in the history
  2. [Locked Labels] Count lone unescaped $ as regular dollar signs

    Right now, if you type "$1" into the locked label input, it
    shows up as "undefined1" in the graph TeX.
    
    - Update the parsed content to count a lone unescaped $
      as a regular $.
    
    Issue: https://khanacademy.atlassian.net/browse/LEMS-2591
    
    Test plan:
    `yarn jest packages/perseus/src/widgets/interactive-graphs/utils.test.ts`
    
    Storybook
    - Go to http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--interactive-graph-with-aria-label
    - Create a new locked figure
    - Add a label "$1" and confirm it shows up as "$1" in the preview
    - Play around with different escaped and unescaped dollar signs
      and confirm they work as expected
    nishasy committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    a271489 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. Use math only parser

    nishasy committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    3379e89 View commit details
    Browse the repository at this point in the history
  2. address PR comments

    nishasy committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    90c76cd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8a22f88 View commit details
    Browse the repository at this point in the history
  4. Use the new mathOnlyParser

    nishasy committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    93cfb8f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7aad8b1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b6be09d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f71abc4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b57fd42 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7827abc View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2024

  1. Configuration menu
    Copy the full SHA
    0b65428 View commit details
    Browse the repository at this point in the history