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

Fixing the Shift functions Error by resolving a falsey bug with the Grapher Widget's asymptotes. #2336

Merged
merged 10 commits into from
Mar 28, 2025

Conversation

SonicScrewdriver
Copy link
Contributor

@SonicScrewdriver SonicScrewdriver commented Mar 28, 2025

Summary:

There's been a long standing bug regarding Graphers in hints, which has been making quite a bit of noise in our reports. (This bug has been causing nearly 70% of our rendering errors!)

After investigating with @Myranae, we discovered that the issue was stemming from a bug in the truthy logic when determining whether to render an asymptote. Normally, the asymptote property is null for graph types that do not require it. However, I believe that our staticTransform method may have been changing the asymptote to an empty array, which was resolving as "truthy".

I've separated out this logic into a new property to properly handle this case. I've opted not to add new tests or to dig too much deeper into the staticTransform method as this was a time-boxed bugfix for a deprecated widget that is scheduled to be replaced with our Interactive Graph Widget in the near future.

(PR completed with @Myranae)

Issue: LEMS-2717

Screenshot:

Screenshot 2025-03-28 at 1 47 44 PM

Test plan:

  • tests pass
  • manual testing upstream to ensure Shift Functions page loads correctly

@SonicScrewdriver SonicScrewdriver self-assigned this Mar 28, 2025
Copy link
Contributor

github-actions bot commented Mar 28, 2025

Size Change: +13 B (0%)

Total Size: 734 kB

Filename Size Change
packages/perseus/dist/es/index.js 371 kB +13 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39.1 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 10.5 kB
packages/math-input/dist/es/index.js 77.1 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 31.7 kB
packages/perseus-editor/dist/es/index.js 135 kB
packages/perseus-linter/dist/es/index.js 22.3 kB
packages/perseus-score/dist/es/index.js 20.7 kB
packages/perseus-utils/dist/es/index.js 809 B
packages/perseus/dist/es/strings.js 6.72 kB
packages/pure-markdown/dist/es/index.js 3.58 kB
packages/simple-markdown/dist/es/index.js 12.6 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Mar 28, 2025

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR2336

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

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

@SonicScrewdriver SonicScrewdriver changed the title docs(changeset): logging Fixing the Shift functions Error by resolving a falsey bug with the Grapher Widget's asymptotes. Mar 28, 2025
@SonicScrewdriver SonicScrewdriver marked this pull request as ready for review March 28, 2025 20:49
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.

Thank you so much for pairing with me and getting us that last final step! So excited!

@SonicScrewdriver SonicScrewdriver merged commit 3bfa609 into main Mar 28, 2025
22 of 38 checks passed
@SonicScrewdriver SonicScrewdriver deleted the console-test-shift branch March 28, 2025 21:05
jeremywiebe pushed a commit that referenced this pull request Mar 28, 2025
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

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   [#2306](#2306) [`87b129dbf`](87b129d) Thanks [@tatianasnook](https://github.com/tatianasnook)! - Added the @typescript-eslint/strict-boolean-expressions rule to enforce explicit boolean expressions for numbers. Disabled strict-boolean-expressions errors using inline eslint-disable comments where the rule was triggered.


-   [#2323](#2323) [`745b6337c`](745b633) Thanks [@nishasy](https://github.com/nishasy)! - [SR] Hide axis labels from screen readers


-   [#2336](#2336) [`3bfa609b9`](3bfa609) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Fix Grapher Widget so that static graphs without asymptotes load correctly.

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`87b129dbf`](87b129d), [`745b6337c`](745b633), [`c2e33e522`](c2e33e5), [`3bfa609b9`](3bfa609)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#2331](#2331) [`c2e33e522`](c2e33e5) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove CJS output from package (package is now ESM only)

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]

## [email protected]

### Minor Changes

-   [#2327](#2327) [`7d1e7b0eb`](7d1e7b0) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Migrate Rollup to v4

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`c2e33e522`](c2e33e5)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: jeremywiebe

Required Reviewers:

Approved By: jeremywiebe

Checks: ⏭️  1 check has been skipped, ✅ 4 checks were successful

Pull Request URL: #2335
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.

2 participants