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

BUGFIX: [Number Line] - Some exercises with fractions would not render #1762

Merged

Conversation

mark-fitzgerald
Copy link
Contributor

@mark-fitzgerald mark-fitzgerald commented Oct 17, 2024

Summary:

The code that generates the list of tick marks on the number line assumed an integer value for the number of ticks. Exercises with fractions could generate a seed value (numDivisions) that is a decimal value (i.e. 7.000001). This fix ensures that an integer value is used.

Issue: LEMS-2549

Test plan:

  1. Launch Storybook

  2. Open the Editor Page demo

  3. Add a Number Line widget

  4. Configure the widget as shown in the image:
    Number Line - Settings

  5. The number line in the preview should be visible

Affected behavior

Before

Number Line - Before

After

Number Line - After

@mark-fitzgerald mark-fitzgerald self-assigned this Oct 17, 2024
Copy link
Contributor

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1762

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

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

Copy link
Contributor

github-actions bot commented Oct 17, 2024

Size Change: +73 B (+0.01%)

Total Size: 867 kB

Filename Size Change
packages/perseus/dist/es/index.js 420 kB +73 B (+0.02%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.8 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 280 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 3.4 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

@mark-fitzgerald mark-fitzgerald marked this pull request as ready for review October 17, 2024 22:41
@khan-actions-bot khan-actions-bot requested a review from a team October 17, 2024 22:42
@khan-actions-bot
Copy link
Contributor

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/sour-horses-scream.md, packages/perseus/src/widgets/number-line/number-line.test.ts, packages/perseus/src/widgets/number-line/number-line.tsx, packages/perseus/src/widgets/number-line/__snapshots__/number-line.test.ts.snap

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

@SonicScrewdriver SonicScrewdriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :)

@mark-fitzgerald mark-fitzgerald merged commit a0f438f into main Oct 17, 2024
16 checks passed
@mark-fitzgerald mark-fitzgerald deleted the bugfix/LEMS-2549-number-line-breaks-with-some-fractions branch October 17, 2024 23:12
mark-fitzgerald pushed a commit that referenced this pull request Oct 17, 2024
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]

### Patch Changes

-   [#1747](#1747) [`81ee69b0a`](81ee69b) Thanks [@kevinb-khan](https://github.com/kevinb-khan)! - Update nodes.js to use ES6 classes


-   [#1748](#1748) [`93bd39b6b`](93bd39b) Thanks [@kevinb-khan](https://github.com/kevinb-khan)! - Convert nodes.js to use TypeScript

## @khanacademy/[email protected]

### Patch Changes

-   [#1751](#1751) [`c95d08056`](c95d080) Thanks [@Myranae](https://github.com/Myranae)! - Refine InputNumber's rubric type


-   [#1756](#1756) [`3a208ba12`](3a208ba) Thanks [@Myranae](https://github.com/Myranae)! - Refine LabelImage's Rubric type


-   [#1762](#1762) [`a0f438fd7`](a0f438f) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - BUGFIX - [Number Line] - Some exercises with fractions wouldn't render

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`93bd39b6b`](93bd39b)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`c95d08056`](c95d080), [`93bd39b6b`](93bd39b), [`3a208ba12`](3a208ba), [`a0f438fd7`](a0f438f)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`93bd39b6b`](93bd39b)]:
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: mark-fitzgerald

Required Reviewers:

Approved By: mark-fitzgerald

Checks: ⏭️  Publish npm snapshot, ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ gerald

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

3 participants